<commit_before>/* 
 * Mutability Detector
 *
 * Copyright 2009 <NAME>
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * 		http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package org.mutabilitydetector;

import static java.util.Arrays.asList;
import static org.mutabilitydetector.MutabilityReason.PUBLISHED_NON_FINAL_FIELD;

import java.util.Collection;

import org.junit.Ignore;
import org.mutabilitydetector.IAnalysisSession.IsImmutable;
import org.mutabilitydetector.unittesting.MutabilityAssert;

@Ignore
public class TestUtil {
	public static IsImmutable getIsImmutableResult(Class<?> toAnalyse) {
		IsImmutable result = new AnalysisSession().isImmutable(toAnalyse.getName());
		return result;
	}
	
	public static AnalysisResult getAnalysisResult(Class<?> toAnalyse) {
		return new AnalysisSession().resultFor(toAnalyse.getName());
	}
	
	public static String formatReasons(Collection<CheckerReasonDetail> reasons) {
		return MutabilityAssert.formatReasons(reasons);
	}

	public static Collection<CheckerReasonDetail> unusedCheckerReasonDetails() {
		return asList(new CheckerReasonDetail("this reason is not meant to be involved", null, PUBLISHED_NON_FINAL_FIELD));
	}
}<commit_msg>Added method to run a single checker and give an AnalysisResult.<commit_after>/* 
 * Mutability Detector
 *
 * Copyright 2009 <NAME>
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * 		http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package org.mutabilitydetector;

import static java.util.Arrays.asList;
import static org.mutabilitydetector.MutabilityReason.PUBLISHED_NON_FINAL_FIELD;

import java.util.Collection;

import org.junit.Ignore;
import org.mutabilitydetector.IAnalysisSession.IsImmutable;
import org.mutabilitydetector.checkers.IMutabilityChecker;
import org.mutabilitydetector.unittesting.MutabilityAssert;

@Ignore
public class TestUtil {
	public static IsImmutable getIsImmutableResult(Class<?> toAnalyse) {
		IsImmutable result = new AnalysisSession().isImmutable(toAnalyse.getName());
		return result;
	}
	
	public static AnalysisResult getAnalysisResult(Class<?> toAnalyse) {
		return new AnalysisSession().resultFor(toAnalyse.getName());
	}
	
	public static String formatReasons(Collection<CheckerReasonDetail> reasons) {
		return MutabilityAssert.formatReasons(reasons);
	}

	public static Collection<CheckerReasonDetail> unusedCheckerReasonDetails() {
		return asList(new CheckerReasonDetail("this reason is not meant to be involved", null, PUBLISHED_NON_FINAL_FIELD));
	}
	
	public static AnalysisResult runChecker(IMutabilityChecker checker, Class<?> toAnalyse) {
		CheckerRunner.createWithCurrentClasspath().run(checker, toAnalyse);
		return new AnalysisResult(toAnalyse.getCanonicalName(), checker.result(), checker.reasons());
	}
}
{'fraction_non_alphanumeric': 0.08256130790190735, 'fraction_numerical': 0.004359673024523161, 'mean_word_length': 5.555357142857143, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5112306', 'n_tokens_mistral': 1041, 'n_tokens_neox': 998, 'n_words': 318}