Skip to content

Commit

Permalink
JS-272 Improve S3776 (cognitive-complexity): Do not increase comple…
Browse files Browse the repository at this point in the history
…xity on short-circuiting and null coalescing
  • Loading branch information
yassin-kammoun-sonarsource committed Oct 8, 2024
1 parent f77ef3c commit 51b0f0b
Show file tree
Hide file tree
Showing 29 changed files with 22 additions and 300 deletions.
15 changes: 0 additions & 15 deletions its/ruling/src/test/expected/jsts/Ghost/javascript-S3776.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,16 @@
{
"Ghost:core/client/app/utils/ajax.js": [
7
],
"Ghost:core/server/api/settings.js": [
38
],
"Ghost:core/server/config/index.js": [
112
],
"Ghost:core/server/config/url.js": [
149
],
"Ghost:core/server/data/import/index.js": [
16
],
"Ghost:core/server/data/meta/title.js": [
4
],
"Ghost:core/server/data/schema/commands.js": [
10
],
"Ghost:core/server/data/validation/index.js": [
41
],
"Ghost:core/server/errors/index.js": [
93
],
"Ghost:core/server/helpers/body_class.js": [
15
],
Expand Down
3 changes: 0 additions & 3 deletions its/ruling/src/test/expected/jsts/Joust/typescript-S3776.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@
"Joust:ts/protocol/HSReplayDecoder.ts": [
159
],
"Joust:ts/state/GameStateHistory.ts": [
15
],
"Joust:ts/state/plugins/Timer.ts": [
42
]
Expand Down
21 changes: 0 additions & 21 deletions its/ruling/src/test/expected/jsts/TypeScript/javascript-S3776.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
],
"TypeScript:lib/tsc.js": [
534,
659,
798,
822,
928,
Expand All @@ -19,10 +18,8 @@
4682,
5421,
5705,
5909,
6083,
6321,
7114,
7228,
7276,
7302,
Expand All @@ -33,8 +30,6 @@
11386,
11754,
11862,
12038,
12952,
13338,
14150,
14721,
Expand All @@ -47,13 +42,11 @@
17513,
17563,
17592,
18105,
18227,
18291,
18519,
18577,
18809,
19555,
19709,
20043,
20128,
Expand All @@ -62,7 +55,6 @@
20436,
21072,
21130,
21270,
21350,
21544,
21720,
Expand All @@ -74,11 +66,9 @@
22636,
22694,
22796,
22828,
22882,
23029,
23115,
23162,
23233,
23772,
23864,
Expand All @@ -92,7 +82,6 @@
24539,
24606,
24798,
24901,
24925,
25022,
25191,
Expand All @@ -106,15 +95,13 @@
26052,
26269,
26365,
26416,
26522,
26595,
26669,
27089,
27163,
27299,
27474,
27514,
27607,
27712,
27769,
Expand All @@ -123,7 +110,6 @@
28010,
28040,
28138,
28223,
28329,
28387,
28512,
Expand Down Expand Up @@ -215,7 +201,6 @@
37614,
37700,
37859,
37894,
38037,
38281,
38333,
Expand All @@ -229,12 +214,10 @@
39147,
39425,
40198,
40234,
40372,
40416,
43630,
43766,
43830,
44156,
44259,
44400,
Expand All @@ -249,9 +232,6 @@
48389,
49050,
49503,
49873,
50175,
50366,
50389,
50482,
50517,
Expand Down Expand Up @@ -287,7 +267,6 @@
],
"TypeScript:lib/typingsInstaller.js": [
544,
669,
808,
832,
938,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,16 @@
318,
415,
465,
1040,
1212,
1278,
1576,
1652,
1999,
3042,
3286
],
"TypeScript:src/compiler/checker.ts": [
523,
564,
732,
856,
1161,
1394,
Expand All @@ -41,11 +38,9 @@
2570,
2632,
2772,
2810,
2878,
3072,
3168,
3223,
3307,
3931,
4046,
Expand All @@ -59,7 +54,6 @@
4910,
4985,
5200,
5309,
5341,
5458,
5665,
Expand All @@ -70,18 +64,15 @@
6146,
6172,
6359,
6730,
7020,
7125,
7181,
7313,
7388,
7486,
7968,
8060,
8253,
8481,
8510,
8639,
8754,
8817,
Expand All @@ -90,7 +81,6 @@
9095,
9127,
9239,
9354,
9492,
9566,
9728,
Expand Down Expand Up @@ -185,7 +175,6 @@
22282,
22391,
22621,
22669,
22870,
23151,
23213,
Expand All @@ -211,9 +200,7 @@
39
],
"TypeScript:src/compiler/core.ts": [
500,
546,
679,
858,
884,
1018,
Expand All @@ -223,9 +210,6 @@
],
"TypeScript:src/compiler/declarationEmitter.ts": [
216,
659,
998,
1229,
1260,
1373,
1413,
Expand Down Expand Up @@ -255,8 +239,6 @@
744
],
"TypeScript:src/compiler/parser.ts": [
53,
1278,
1854,
3072,
4015,
Expand Down Expand Up @@ -288,14 +270,12 @@
1708
],
"TypeScript:src/compiler/transformers/destructuring.ts": [
35,
257,
315
],
"TypeScript:src/compiler/transformers/es2015.ts": [
603,
916,
1030,
1815,
1992,
2257,
Expand All @@ -322,10 +302,8 @@
"TypeScript:src/compiler/utilities.ts": [
644,
965,
1219,
1407,
1681,
2654,
2785,
2837,
2870,
Expand Down Expand Up @@ -358,9 +336,6 @@
"TypeScript:src/harness/sourceMapRecorder.ts": [
64
],
"TypeScript:src/harness/typeWriter.ts": [
39
],
"TypeScript:src/server/builder.ts": [
333
],
Expand All @@ -374,7 +349,6 @@
1573
],
"TypeScript:src/server/project.ts": [
547,
680
],
"TypeScript:src/server/scriptVersionCache.ts": [
Expand Down Expand Up @@ -402,7 +376,6 @@
128,
282,
548,
643,
873
],
"TypeScript:src/services/codefixes/helpers.ts": [
Expand All @@ -421,9 +394,7 @@
348,
828,
931,
1031,
1066,
1147
1066
],
"TypeScript:src/services/documentHighlights.ts": [
57,
Expand Down Expand Up @@ -516,9 +487,7 @@
281
],
"TypeScript:src/services/utilities.ts": [
422,
646,
759,
933,
1217
]
Expand Down
Loading

0 comments on commit 51b0f0b

Please sign in to comment.