Skip to content

Commit 2db9409

Browse files
committed
Fix Linting in Index of Coincidence Operation
1 parent 36c8c03 commit 2db9409

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/core/operations/IndexOfCoincidence.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,20 @@ class IndexOfCoincidence extends Operation {
3434
* @returns {number}
3535
*/
3636
run(input, args) {
37-
const text = input.toLowerCase().replace(/[^a-z]/g, ''),
38-
frequencies = new Array(26).fill(0),
39-
alphabet = Utils.expandAlphRange("a-z")
37+
const text = input.toLowerCase().replace(/[^a-z]/g, ""),
38+
frequencies = new Array(26).fill(0),
39+
alphabet = Utils.expandAlphRange("a-z");
4040
let coincidence = 0.00,
4141
density = 0.00,
4242
result = 0.00,
4343
i;
4444

4545
for (i=0; i < alphabet.length; i++) {
46-
frequencies[i] = text.count(alphabet[i]);
46+
frequencies[i] = text.count(alphabet[i]);
4747
}
4848

4949
for (i=0; i < frequencies.length; i++) {
50-
coincidence += frequencies[i] * (frequencies[i] - 1);
50+
coincidence += frequencies[i] * (frequencies[i] - 1);
5151
}
5252

5353
density = frequencies.sum();
@@ -67,7 +67,7 @@ class IndexOfCoincidence extends Operation {
6767
* @returns {html}
6868
*/
6969
present(ic) {
70-
return `Index of Coincidence: ${ic}
70+
return `Index of Coincidence: ${ic}
7171
Normalized: ${ic * 26}
7272
<br><canvas id='chart-area'></canvas><br>
7373
- 0 represents complete randomness (all characters are unique), whereas 1 represents no randomness (all characters are identical).
@@ -99,8 +99,8 @@ The graph shows the IC of the input data. A low IC generally means that the text
9999
}
100100
]);
101101
</script>
102-
`
103-
}
102+
`;
103+
}
104104

105105
}
106106

0 commit comments

Comments
 (0)