Skip to content

Commit

Permalink
add total complexity + sub-complexity metrics (#369)
Browse files Browse the repository at this point in the history
closes #218
  • Loading branch information
bartveneman authored Dec 29, 2023
1 parent e3b2e7b commit b043363
Show file tree
Hide file tree
Showing 14 changed files with 530 additions and 112 deletions.
29 changes: 29 additions & 0 deletions src/__fixtures__/bol-com-20231008.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"sourceLinesOfCode": 18136,
"linesOfCode": 29247,
"size": 543848,
"complexity": 47099,
"comments": {
"total": 0,
"size": 0
Expand Down Expand Up @@ -262,6 +263,16 @@
"totalUnique": 0,
"unique": {},
"uniquenessRatio": 0
},
"total": 1061,
"complexity": {
"min": 1,
"max": 1,
"mean": 1,
"mode": 1,
"median": 1,
"range": 0,
"sum": 1061
}
},
"rules": {
Expand Down Expand Up @@ -55076,6 +55087,15 @@
"total": 0,
"ratio": 0
}
},
"complexity": {
"min": 1,
"max": 1,
"mean": 1,
"mode": 1,
"median": 1,
"range": 0,
"sum": 10441
}
},
"properties": {
Expand Down Expand Up @@ -56558,6 +56578,15 @@
"uniquenessRatio": 1
}
}
},
"complexity": {
"min": 1,
"max": 2,
"mean": 1.0010535389330524,
"mode": 1,
"median": 1,
"range": 1,
"sum": 10452
}
}
}
29 changes: 29 additions & 0 deletions src/__fixtures__/bootstrap-5.3.2.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"sourceLinesOfCode": 8640,
"linesOfCode": 13899,
"size": 262482,
"complexity": 23488,
"comments": {
"total": 3,
"size": 225
Expand Down Expand Up @@ -149,6 +150,16 @@
"totalUnique": 0,
"unique": {},
"uniquenessRatio": 0
},
"total": 115,
"complexity": {
"min": 1,
"max": 1,
"mean": 1,
"mode": 1,
"median": 1,
"range": 0,
"sum": 115
}
},
"rules": {
Expand Down Expand Up @@ -25986,6 +25997,15 @@
"total": 0,
"ratio": 0
}
},
"complexity": {
"min": 1,
"max": 1,
"mean": 1,
"mode": 1,
"median": 1,
"range": 0,
"sum": 5547
}
},
"properties": {
Expand Down Expand Up @@ -30627,6 +30647,15 @@
"uniquenessRatio": 0.03333333333333333
}
}
},
"complexity": {
"min": 1,
"max": 2,
"mean": 1.0030216850337719,
"mode": 1,
"median": 1,
"range": 1,
"sum": 5643
}
}
}
29 changes: 29 additions & 0 deletions src/__fixtures__/cnn-20231008.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"sourceLinesOfCode": 10127,
"linesOfCode": 14690,
"size": 821224,
"complexity": 41021,
"comments": {
"total": 0,
"size": 0
Expand Down Expand Up @@ -160,6 +161,16 @@
"totalUnique": 0,
"unique": {},
"uniquenessRatio": 0
},
"total": 120,
"complexity": {
"min": 1,
"max": 1,
"mean": 1,
"mode": 1,
"median": 1,
"range": 0,
"sum": 120
}
},
"rules": {
Expand Down Expand Up @@ -31333,6 +31344,15 @@
"total": 0,
"ratio": 0
}
},
"complexity": {
"min": 1,
"max": 1,
"mean": 1,
"mode": 1,
"median": 1,
"range": 0,
"sum": 5959
}
},
"properties": {
Expand Down Expand Up @@ -33685,6 +33705,15 @@
"uniquenessRatio": 1
}
}
},
"complexity": {
"min": 1,
"max": 2,
"mean": 1.0008390669575433,
"mode": 1,
"median": 1,
"range": 1,
"sum": 5964
}
}
}
29 changes: 29 additions & 0 deletions src/__fixtures__/css-tricks-20231008.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"sourceLinesOfCode": 4292,
"linesOfCode": 6354,
"size": 115415,
"complexity": 13339,
"comments": {
"total": 2,
"size": 173
Expand Down Expand Up @@ -158,6 +159,16 @@
"totalUnique": 0,
"unique": {},
"uniquenessRatio": 0
},
"total": 77,
"complexity": {
"min": 1,
"max": 2,
"mean": 1.025974025974026,
"mode": 1,
"median": 1,
"range": 1,
"sum": 79
}
},
"rules": {
Expand Down Expand Up @@ -12596,6 +12607,15 @@
"total": 0,
"ratio": 0
}
},
"complexity": {
"min": 1,
"max": 1,
"mean": 1,
"mode": 1,
"median": 1,
"range": 0,
"sum": 2683
}
},
"properties": {
Expand Down Expand Up @@ -14847,6 +14867,15 @@
"uniquenessRatio": 0.3333333333333333
}
}
},
"complexity": {
"min": 1,
"max": 2,
"mean": 1.0067089079388745,
"mode": 1,
"median": 1,
"range": 1,
"sum": 2701
}
}
}
29 changes: 29 additions & 0 deletions src/__fixtures__/gazelle-20231008.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"sourceLinesOfCode": 29224,
"linesOfCode": 45124,
"size": 846671,
"complexity": 97705,
"comments": {
"total": 4,
"size": 1678
Expand Down Expand Up @@ -269,6 +270,16 @@
"totalUnique": 0,
"unique": {},
"uniquenessRatio": 0
},
"total": 931,
"complexity": {
"min": 1,
"max": 2,
"mean": 1.0139634801288937,
"mode": 1,
"median": 1,
"range": 1,
"sum": 944
}
},
"rules": {
Expand Down Expand Up @@ -87501,6 +87512,15 @@
"total": 0,
"ratio": 0
}
},
"complexity": {
"min": 1,
"max": 1,
"mean": 1,
"mode": 1,
"median": 1,
"range": 0,
"sum": 17586
}
},
"properties": {
Expand Down Expand Up @@ -90316,6 +90336,15 @@
"uniquenessRatio": 0.5
}
}
},
"complexity": {
"min": 1,
"max": 2,
"mean": 1.0304617662130615,
"mode": 1,
"median": 1,
"range": 1,
"sum": 18098
}
}
}
29 changes: 29 additions & 0 deletions src/__fixtures__/github-20231008.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"sourceLinesOfCode": 33278,
"linesOfCode": 51852,
"size": 1206900,
"complexity": 104774,
"comments": {
"total": 4,
"size": 528
Expand Down Expand Up @@ -296,6 +297,16 @@
"totalUnique": 0,
"unique": {},
"uniquenessRatio": 0
},
"total": 677,
"complexity": {
"min": 1,
"max": 2,
"mean": 1.0014771048744462,
"mode": 1,
"median": 1,
"range": 1,
"sum": 678
}
},
"rules": {
Expand Down Expand Up @@ -92207,6 +92218,15 @@
"total": 0,
"ratio": 0
}
},
"complexity": {
"min": 1,
"max": 1,
"mean": 1,
"mode": 1,
"median": 1,
"range": 0,
"sum": 21677
}
},
"properties": {
Expand Down Expand Up @@ -102091,6 +102111,15 @@
"uniquenessRatio": 1
}
}
},
"complexity": {
"min": 1,
"max": 2,
"mean": 1.00175118014314,
"mode": 1,
"median": 1,
"range": 1,
"sum": 26314
}
}
}
Loading

0 comments on commit b043363

Please sign in to comment.