Skip to content

Commit 13b9796

Browse files
authored
add sLoc metric to Complexity table (#58)
1 parent 7ddc2a2 commit 13b9796

File tree

10 files changed

+16
-0
lines changed

10 files changed

+16
-0
lines changed

src/components/complexity.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ const Complexity = ({stats, verbose}) => (
2121
<Th>Maximum</Th>
2222
</Tr>
2323

24+
<Tr>
25+
<RowSpan>Lines of Code</RowSpan>
26+
<FormatInteger
27+
value={stats['stylesheets.linesOfCode.sourceLinesOfCode.total']}
28+
/>
29+
</Tr>
30+
2431
<Tr>
2532
<RowSpan>Rules</RowSpan>
2633
<FormatInteger value={stats['rules.total']} />

test/no-options/snapshots/spec.js.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Generated by [AVA](https://ava.li).
2121
Complexity␊
2222
----------------------------------------------------␊
2323
Total Average Maximum␊
24+
‣ Lines of Code 1␊
2425
‣ Rules 1␊
2526
‣ Selectors 1 1.00 1␊
2627
‣ Identifiers 1 1.00 1␊
@@ -79,6 +80,7 @@ Generated by [AVA](https://ava.li).
7980
Complexity␊
8081
----------------------------------------------------␊
8182
Total Average Maximum␊
83+
‣ Lines of Code 1␊
8284
‣ Rules 1␊
8385
‣ Selectors 1 1.00 1␊
8486
‣ Identifiers 1 1.00 1␊
12 Bytes
Binary file not shown.

test/no-options/spec.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ test(`it shows a table with stats if no options are passed and CSS is passed via
1111
t.true(stdout.includes('Performance'))
1212
t.true(stdout.includes('Selectors'))
1313
t.true(stdout.includes('Branding'))
14+
t.true(stdout.includes('‣ Lines of Code 1'))
1415
t.true(
1516
stdout.includes('‣ Font-sizes 0 0 0.0%')
1617
)
@@ -24,6 +25,7 @@ test(`it shows a table with stats if no options are passed and CSS is passed as
2425
t.true(stdout.includes('Performance'))
2526
t.true(stdout.includes('Selectors'))
2627
t.true(stdout.includes('Branding'))
28+
t.true(stdout.includes('‣ Lines of Code 1'))
2729
t.true(
2830
stdout.includes('‣ Font-sizes 0 0 0.0%')
2931
)

test/option-format/snapshots/spec.js.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Generated by [AVA](https://ava.li).
3030
Complexity␊
3131
----------------------------------------------------␊
3232
Total Average Maximum␊
33+
‣ Lines of Code 1␊
3334
‣ Rules 1␊
3435
‣ Selectors 1 1.00 1␊
3536
‣ Identifiers 1 1.00 1␊
13 Bytes
Binary file not shown.

test/option-verbose/snapshots/spec.js.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Generated by [AVA](https://ava.li).
1212
Complexity␊
1313
----------------------------------------------------␊
1414
Total Average Maximum␊
15+
‣ Lines of Code 2␊
1516
‣ Rules 1␊
1617
‣ Selectors 1 1.00 1␊
1718
‣ Identifiers 1 1.00 1␊
@@ -104,6 +105,7 @@ Generated by [AVA](https://ava.li).
104105
Complexity␊
105106
----------------------------------------------------␊
106107
Total Average Maximum␊
108+
‣ Lines of Code 2␊
107109
‣ Rules 1␊
108110
‣ Selectors 1 1.00 1␊
109111
‣ Identifiers 1 1.00 1␊
@@ -196,6 +198,7 @@ Generated by [AVA](https://ava.li).
196198
Complexity␊
197199
----------------------------------------------------␊
198200
Total Average Maximum␊
201+
‣ Lines of Code 1␊
199202
‣ Rules 1␊
200203
‣ Selectors 1 1.00 1␊
201204
‣ Identifiers 1 1.00 1␊
14 Bytes
Binary file not shown.

test/options-format-and-verbose/snapshots/spec.js.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Generated by [AVA](https://ava.li).
1818
Complexity␊
1919
----------------------------------------------------␊
2020
Total Average Maximum␊
21+
‣ Lines of Code 2␊
2122
‣ Rules 1␊
2223
‣ Selectors 1 1.00 1␊
2324
‣ Identifiers 1 1.00 1␊
13 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)