}
}
if (hasApplicableChildren) {
- result = new Measure(context.getTargetMetric(), (totalMainMeasure / totalByMeasure));
+ result = new Measure(context.getTargetMetric(), totalMainMeasure / totalByMeasure);
}
return result;
}
Double byMeasure = MeasureUtils.getValue(data.getMeasure(byMetric), null);
Double mainMeasure = MeasureUtils.getValue(data.getMeasure(mainMetric), fallbackMeasure);
if (mainMeasure != null && byMeasure != null && byMeasure > 0.0) {
- result = new Measure(context.getTargetMetric(), (mainMeasure / byMeasure));
+ result = new Measure(context.getTargetMetric(), mainMeasure / byMeasure);
}
return result;
if (!hasValue && !forceZeroIfMissingData) {
return null;
}
- return new Measure(context.getTargetMetric(), (count==0 ? 0.0 : sum/count));
+ return new Measure(context.getTargetMetric(), count==0 ? 0.0 : sum/count);
}
}
Measure measure = child.getMeasure(context.getTargetMetric());
Measure weightingMeasure = child.getMeasure(weightingMetric);
if (MeasureUtils.haveValues(measure, weightingMeasure)) {
- sum += (measure.getValue() * weightingMeasure.getValue());
+ sum += measure.getValue() * weightingMeasure.getValue();
count += weightingMeasure.getValue();
hasValue=true;
}
return null;
}
- double result = (count==0.0 ? 0.0 : sum/count);
+ double result = count==0.0 ? 0.0 : sum/count;
return new Measure(context.getTargetMetric(), result);
}
}
@Override
public int hashCode() {
- return (key != null ? key.hashCode() : 0);
+ return key != null ? key.hashCode() : 0;
}
@Override
}
public Project getRoot() {
- return (parent == null ? this : parent.getRoot());
+ return parent==null ? this : parent.getRoot();
}
/**
*/
@Deprecated
public boolean getReuseExistingRulesConfig() {
- return (configuration != null && configuration.getBoolean(CoreProperties.REUSE_RULES_CONFIGURATION_PROPERTY, false));
+ return configuration!=null && configuration.getBoolean(CoreProperties.REUSE_RULES_CONFIGURATION_PROPERTY, false);
}
/**
* @since 3.1
*/
public static <A extends Annotation> A getAnnotation(Object objectOrClass, Class<A> annotationClass) {
- Class<?> initialClass = (objectOrClass instanceof Class<?> ? (Class<?>) objectOrClass : objectOrClass.getClass());
+ Class<?> initialClass = objectOrClass instanceof Class<?> ? (Class<?>) objectOrClass : objectOrClass.getClass();
for (Class<?> aClass = initialClass; aClass != null; aClass = aClass.getSuperclass()) {
A result = aClass.getAnnotation(annotationClass);
* Number of pages. It is greater than or equal 0.
*/
public int pages() {
- int p = (total / pageSize);
- if ((total % pageSize) > 0) {
+ int p = total / pageSize;
+ if (total % pageSize > 0) {
p++;
}
return p;
public TimeProfiler stop() {
if (start > 0) {
if (debug) {
- logger.debug("{} done: {} ms", name, (System.currentTimeMillis() - start));
+ logger.debug("{} done: {} ms", name, System.currentTimeMillis() - start);
} else {
- logger.info("{} done: {} ms", name, (System.currentTimeMillis() - start));
+ logger.info("{} done: {} ms", name, System.currentTimeMillis() - start);
}
}
start = 0;