style: include IMC_IMMATURE_CLASS_VAR_NAME
(#5197)
This commit is contained in:
parent
5e4db7baf1
commit
2e387fe54e
@ -216,9 +216,6 @@
|
|||||||
<Match>
|
<Match>
|
||||||
<Bug pattern="FCBL_FIELD_COULD_BE_LOCAL" />
|
<Bug pattern="FCBL_FIELD_COULD_BE_LOCAL" />
|
||||||
</Match>
|
</Match>
|
||||||
<Match>
|
|
||||||
<Bug pattern="IMC_IMMATURE_CLASS_VAR_NAME" />
|
|
||||||
</Match>
|
|
||||||
<Match>
|
<Match>
|
||||||
<Bug pattern="CFS_CONFUSING_FUNCTION_SEMANTICS" />
|
<Bug pattern="CFS_CONFUSING_FUNCTION_SEMANTICS" />
|
||||||
</Match>
|
</Match>
|
||||||
|
@ -5,16 +5,16 @@ public final class StandardDeviation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static double stdDev(double[] data) {
|
public static double stdDev(double[] data) {
|
||||||
double var = 0;
|
double variance = 0;
|
||||||
double avg = 0;
|
double avg = 0;
|
||||||
for (int i = 0; i < data.length; i++) {
|
for (int i = 0; i < data.length; i++) {
|
||||||
avg += data[i];
|
avg += data[i];
|
||||||
}
|
}
|
||||||
avg /= data.length;
|
avg /= data.length;
|
||||||
for (int j = 0; j < data.length; j++) {
|
for (int j = 0; j < data.length; j++) {
|
||||||
var += Math.pow((data[j] - avg), 2);
|
variance += Math.pow((data[j] - avg), 2);
|
||||||
}
|
}
|
||||||
var /= data.length;
|
variance /= data.length;
|
||||||
return Math.sqrt(var);
|
return Math.sqrt(variance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user