@Test public void testConvertAbacusThresholdsToComplexityThresholds() { List<ComplexityThreshold> complexityThresholds; complexityThresholds = ComplexityThresholdsUtils.convertAbacusThresholdsToComplexityThresholds(new String[] {"Simple"}); Assert.assertNotNull(complexityThresholds); Assert.assertEquals(complexityThresholds.size(), 1); Assert.assertEquals(complexityThresholds.get(0).getComplexityName(), "Simple"); Assert.assertEquals(complexityThresholds.get(0).getThreshold(), null); complexityThresholds = ComplexityThresholdsUtils.convertAbacusThresholdsToComplexityThresholds(new String[] {"Simple:10", "Complex"}); Assert.assertNotNull(complexityThresholds); Assert.assertEquals(complexityThresholds.size(), 2); Assert.assertEquals(complexityThresholds.get(0).getComplexityName(), "Simple"); Assert.assertEquals(complexityThresholds.get(0).getThreshold(), Double.valueOf(10.0)); Assert.assertEquals(complexityThresholds.get(1).getComplexityName(), "Complex"); Assert.assertEquals(complexityThresholds.get(1).getThreshold(), null); }
public static List<ComplexityThreshold> convertAbacusThresholdsToComplexityThresholds(String[] propertyThresholds) { List<ComplexityThreshold> complexityThresholds = new ArrayList<ComplexityThreshold>(); String[] temp; for (String propertyThreshold : propertyThresholds) { temp = propertyThreshold.split(PARSING_SEPARATOR); Double thresholdValue = null; if (temp.length > 1) { thresholdValue = Double.valueOf(temp[1]); } complexityThresholds.add(new ComplexityThreshold(temp[0], thresholdValue)); } return complexityThresholds; }
ComplexityThresholdsUtils { public static List<ComplexityThreshold> convertAbacusThresholdsToComplexityThresholds(String[] propertyThresholds) { List<ComplexityThreshold> complexityThresholds = new ArrayList<ComplexityThreshold>(); String[] temp; for (String propertyThreshold : propertyThresholds) { temp = propertyThreshold.split(PARSING_SEPARATOR); Double thresholdValue = null; if (temp.length > 1) { thresholdValue = Double.valueOf(temp[1]); } complexityThresholds.add(new ComplexityThreshold(temp[0], thresholdValue)); } return complexityThresholds; } }
ComplexityThresholdsUtils { public static List<ComplexityThreshold> convertAbacusThresholdsToComplexityThresholds(String[] propertyThresholds) { List<ComplexityThreshold> complexityThresholds = new ArrayList<ComplexityThreshold>(); String[] temp; for (String propertyThreshold : propertyThresholds) { temp = propertyThreshold.split(PARSING_SEPARATOR); Double thresholdValue = null; if (temp.length > 1) { thresholdValue = Double.valueOf(temp[1]); } complexityThresholds.add(new ComplexityThreshold(temp[0], thresholdValue)); } return complexityThresholds; }  }
ComplexityThresholdsUtils { public static List<ComplexityThreshold> convertAbacusThresholdsToComplexityThresholds(String[] propertyThresholds) { List<ComplexityThreshold> complexityThresholds = new ArrayList<ComplexityThreshold>(); String[] temp; for (String propertyThreshold : propertyThresholds) { temp = propertyThreshold.split(PARSING_SEPARATOR); Double thresholdValue = null; if (temp.length > 1) { thresholdValue = Double.valueOf(temp[1]); } complexityThresholds.add(new ComplexityThreshold(temp[0], thresholdValue)); } return complexityThresholds; }  static List<ComplexityThreshold> convertAbacusThresholdsToComplexityThresholds(String[] propertyThresholds); static String convertCyclomaticComplexityToAbacusComplexity(Double cyclomaticComplexity, List<ComplexityThreshold> complexityThresholds); static void initCounterThreshold(List<ComplexityThreshold> complexityThresholds); static String buildComplexityDistributionMeasureValue(List<ComplexityThreshold> complexityThresholds); }
ComplexityThresholdsUtils { public static List<ComplexityThreshold> convertAbacusThresholdsToComplexityThresholds(String[] propertyThresholds) { List<ComplexityThreshold> complexityThresholds = new ArrayList<ComplexityThreshold>(); String[] temp; for (String propertyThreshold : propertyThresholds) { temp = propertyThreshold.split(PARSING_SEPARATOR); Double thresholdValue = null; if (temp.length > 1) { thresholdValue = Double.valueOf(temp[1]); } complexityThresholds.add(new ComplexityThreshold(temp[0], thresholdValue)); } return complexityThresholds; }  static List<ComplexityThreshold> convertAbacusThresholdsToComplexityThresholds(String[] propertyThresholds); static String convertCyclomaticComplexityToAbacusComplexity(Double cyclomaticComplexity, List<ComplexityThreshold> complexityThresholds); static void initCounterThreshold(List<ComplexityThreshold> complexityThresholds); static String buildComplexityDistributionMeasureValue(List<ComplexityThreshold> complexityThresholds);  }