diff --git a/public/how-it-works.html b/public/how-it-works.html index c93e1db..bf55fe9 100644 --- a/public/how-it-works.html +++ b/public/how-it-works.html @@ -107,7 +107,7 @@ .term { margin: 24px 0 10px; padding: 18px 20px 20px; overflow-x: auto; border: 1px solid #262d37; border-radius: 16px; background: #0b0e13; color: #d6dbe5; font: 12.5px/1.6 var(--mono); scrollbar-width: thin; scrollbar-color: #3a434f transparent; } .term .ps { color: #ff9dbb; } .term .dim { color: #8a93a3; } -.term .head { color: #fff; font-weight: 700; } +.term .head { display: inline; height: auto; margin: 0; color: #fff; font-weight: 700; } .term .pa { color: #79c0ff; } .term .k0 { color: #3fb950; } .term .bad { color: #ff7b72; } .pre { margin: 0 0 20px; padding: 18px 22px; overflow-x: auto; background: var(--soft); border-radius: 16px; color: var(--body); font: 13.5px/1.6 var(--mono); } @@ -653,35 +653,42 @@

The plan

$ cribelo
 cribelo · 34 files changed vs origin/main (merge-base b2f83dc)
 
-Read 14 of 34 changed files, about 48 min.
-1035 of 1771 changed lines to read closely, 369 to glance at: 11 import hunks.
-Start with internal/analyzer/library_reach.go: +266 lines, new LibraryUses() complexity 17, +4 more, imported by 83 files.
-
-                                                           complexity  to read           glance    used by    commits 90d        clone  tests
-      ↳ library_reach.go, then what uses it
-   1  internal/analyzer/library_reach.go             new   ▮▮▮▯▯ 17    ▮▮▮▯▯ 155 of 266  ▮▮▯▯▯ 54  ▮▮▮▮▮ 83   ▮▮▯▯▯ 3                   ✓
-   2  internal/analyzer/library_conformance_test.go  test  ▮▮▮▯▯ 12    ▮▯▯▯▯ 38 of 144   ▮▮▯▯▯ 77  ▯▯▯▯▯      ▮▯▯▯▯ 1                   
-   3  internal/analyzer/library_reach_test.go        test  ▮▯▯▯▯ 4     ▮▮▯▯▯ 99 of 146   ▮▯▯▯▯ 30  ▯▯▯▯▯      ▮▯▯▯▯ 2                   
-   4  internal/engine/util.go                              ▮▮▯▯▯ 10    ▮▯▯▯▯ 27 of 32    ▮▯▯▯▯ 2   ▮▮▮▮▮ 111  ▮▮▮▯▯ 6, 3 fixes          ✗
-   5  internal/analyzer/file_dependency_analyzer.go        ▮▮▮▮▮ 44    ▮▮▯▯▯ 53 of 67    ▮▯▯▯▯ 3   ▮▮▮▮▮ 83   ▮▮▯▯▯ 4, 1 fix            ✓
-   6  internal/engine/php/deps/resolver.go           new   ▮▮▯▯▯ 9     ▮▯▯▯▯ 23 of 77    ▮▯▯▯▯ 27  ▮▯▯▯▯ 1    ▮▯▯▯▯ 1            84%    ✓
-   7  internal/engine/php/deps/resolver_test.go      test  ▮▯▯▯▯ 5     ▮▯▯▯▯ 37 of 57    ▮▯▯▯▯ 9   ▯▯▯▯▯      ▮▯▯▯▯ 1                   
-   8  internal/engine/java/deps/resolver.go                ▮▮▮▯▯ 11    ▮▯▯▯▯ 11 of 18    ▮▯▯▯▯ 3   ▮▯▯▯▯ 1    ▮▮▯▯▯ 3, 1 fix     100%   ✓
-      … 6 more
-
-Worth knowing  true by construction, not predicted
-  cmd/ast-metrics/main.go  main() was fixed 5 times in the past year
+Read 13 of 34 changed files, about 45 min.
+
+                                                           lines to read closely               lines to glance at
+   1  internal/analyzer/library_reach.go             new   30-35, 66-265                       16-26, 39-57
+   2  internal/analyzer/library_conformance_test.go  test  98-140                              25-93
+   3  internal/analyzer/library_reach_test.go        test  10-63, 85-144                       67-80
+   4  internal/engine/util.go                              85-112
+   5  internal/analyzer/file_dependency_analyzer.go        97-101, 122-127, 141, 152, +4 more  22-27
+   6  internal/engine/php/deps/resolver.go           new   25-43, 57-69                        15-22, 46-51, 75-76
+   7  internal/engine/php/deps/resolver_test.go      test  11-54
+   8  internal/engine/java/deps/resolver.go                46-48, 65-71                        line 61
+      … 5 more
+
+Why these files
+                                   complexity  used by    commits 90d        clone  test changed
+   1  library_reach.go             ▮▮▮▯▯ 17    ▮▮▮▮▮ 83   ▮▮▯▯▯ 3                   ✓
+   4  util.go                      ▮▮▯▯▯ 10    ▮▮▮▮▮ 111  ▮▮▮▯▯ 6, 3 fixes          ✗
+   5  file_dependency_analyzer.go  ▮▮▮▮▮ 44    ▮▮▮▮▮ 83   ▮▮▯▯▯ 4, 1 fix            ✓
+   6  php/deps/resolver.go         ▮▮▯▯▯ 9     ▮▯▯▯▯ 1    ▮▯▯▯▯ 1            84%    ✓
+   8  java/deps/resolver.go        ▮▮▮▯▯ 11    ▮▯▯▯▯ 1    ▮▮▯▯▯ 3, 1 fix     100%   ✓
+      … 3 more
+
+Totals  688 lines to read closely, 280 to glance at (20 and 60 lines a minute)
+Set aside in the whole change: 11 import hunks.
+
+Worth knowing  true by construction, not predicted
   internal/analyzer/aggregator.go  internal/analyzer depends on internal/engine/php/deps for the first time
   internal/engine/typescript/deps/resolver.go  internal/engine/typescript/deps depends on internal/engine/typescript/module for the first time
-  cmd/ast-metrics/main.go  38 of 38 changed lines not run by any test, by pr196-coverage.out
-  internal/analyzer/library_reach.go  15 of 161 changed lines not run by any test, by pr196-coverage.out
-  internal/command/who_uses_command.go  49 of 162 changed lines not run by any test, by pr196-coverage.out
-  +1 more, see cribelo explain <file>
+  internal/analyzer/library_reach.go  15 of 161 changed lines not run by any test, according to pr196-coverage.out
+  internal/command/who_uses_command.go  49 of 162 changed lines not run by any test, according to pr196-coverage.out
+  internal/engine/util.go  25 of 25 changed lines not run by any test, according to pr196-coverage.out
 
-Skip (20)
-  ranked lower 9 · tests only 7 · no measurable change 4    cribelo skip
+Skip (21)
+  10 ranked lower · 7 tests only · 4 no measurable change    cribelo skip
 
-

Each column is a measure you can check: cyclomatic complexity of the touched functions, lines to read closely out of lines changed, lines to glance at, files that import this one, commits and fix commits in the last ninety days, similarity with another function, a test file next to it.

+

The first table says where to read: for each file, the line ranges to read closely and the ones a glance is enough for. In the pull request comment, each range opens the diff on those lines. Under it, each column is a measure you can check: cyclomatic complexity of the touched functions, files that import this one, commits and fix commits in the last ninety days, similarity with another function, a test changed with the file.

A gate on what is measured

Nothing here fails a build on its own. In the Action, fail-over: 1h fails the job when reading the whole change would take more than an hour, every file counted, budget or not: the change is too large for one reviewer. fail-on: cycle, signature fails it when the change introduces an import cycle or changes an exported signature that other files call; any kind of fact can be named. The job says why in one line, such as "reading time 1 h 17, over the 1 h allowed". The score never closes a gate: a level is an estimate, a gate needs a measure.

diff --git a/public/index.html b/public/index.html index a5d33a8..e71454a 100644 --- a/public/index.html +++ b/public/index.html @@ -140,7 +140,7 @@ .out .gap { margin-top: 16px; } .out .fact { padding-left: 2ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .out .fact .pa { margin-right: 2ch; } -.tbl { min-height: 230px; margin: 18px -20px 0; padding: 0 20px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #3a434f transparent; } +.tbl { margin: 18px -20px 0; padding: 0 20px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #3a434f transparent; } .tbl table { border-collapse: collapse; white-space: nowrap; font-size: 12.5px; } .tbl th { padding: 0 0 2px 1.6ch; color: #8a93a3; font-weight: 400; text-align: left; } .tbl td { padding: 1px 0 1px 1.6ch; } @@ -148,11 +148,13 @@ .tbl td:nth-child(2) { padding-left: 2ch; } .tbl tr { transition: background .15s; } .tbl tbody tr.hot { background: rgba(255,255,255,.08); } -.tbl tr.grp td { padding: 6px 0 2px 3ch; color: #8a93a3; font-style: italic; text-align: left; } +.head + .tbl { margin-top: 0; } +.out .strong { color: #fff; } .k2 { color: #ff7b72; font-weight: 700; } .k1 { color: #d29922; } .k0 { color: #3fb950; } .pa { color: #79c0ff; } .nw { color: #58a6ff; font-weight: 700; } .tg { color: #8a93a3; } .b1 { color: #3fb950; } .b2 { color: #d29922; } .b3 { color: #f0883e; } .b4, .b5, .bad { color: #ff7b72; } .em { color: #3b4252; } .or { color: #f0883e; } -.more { min-height: 1.6em; margin-top: 2px; padding-left: 5ch; color: #8b949e; } +.more { margin-top: 2px; padding-left: 5ch; color: #8b949e; } +.more:empty { display: none; } .caption { margin-top: 44px; color: var(--muted); font-size: 14px; } .dark { background: var(--ink); color: var(--bg); padding: clamp(110px, 20vh, 220px) 0; } @@ -285,14 +287,19 @@

How long do you have?

cribelo · 34 files changed vs origin/main (merge-base b2f83dc)

Read 13 of 34 changed files, about 45 min.

-

1035 of 1771 changed lines to read closely, 369 to glance at: 11 import hunks.

-

Start with internal/analyzer/library_reach.go: +266 lines, new LibraryUses() complexity 17, +4 more, imported by 83 files.

+
+

Why these files

+
+

+
+

Totals  688 lines to read closely, 280 to glance at (20 and 60 lines a minute)

+

Set aside in the whole change: 11 import hunks.

Worth knowing  true by construction, not predicted

Skip (21)

-

  ranked lower 10 · tests only 7 · no measurable change 4    cribelo skip

+

  10 ranked lower · 7 tests only · 4 no measurable change    cribelo skip

@@ -358,13 +365,12 @@

On your repo in one click.