Public report of antlr/antlr4, published 13 November 2026. It has the same score, grades and number of findings as the full report. The details of security findings (where they are in the code, which known vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.3). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey → Signed and filed in the standard's public register, 13 November 2026, 14:11 UTC · Survey ID cd_1549c03fd15741138dda5bf62abdc046

antlr/antlr4

Measured 13 November 2026, 14:10 UTC, at code version 45be27d

Code coverage is not measured: .NET and JavaScript/TypeScript suite (CouldNotMeasureNoCollector, CouldNotMeasureNoRunner).

Supply-chain provenance & signing is not measured: Supply-chain provenance is not scored (this pipeline releases no artifact), but its build steps or GitHub Actions workflows have integrity defects, or nothing watches its dependency set for published advisories.

CAI score 60out of 100 Adequate
CriticalWeakAdequateStrongExemplary
Up 2 since the last survey

The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.

A large codebase: 172,173 lines of product code in 1 project, tests not counted · Estimated rebuild effort: about 1.6 person-years · Weakest lens: Production Readiness, 55

Findings by how serious they are

51 critical 973 serious 128 minor

16 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.

This survey was produced by

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
13 November 2026, 14:10 UTC

A measurement, not a certificate. The Code Assurance Index records a number together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that implements it, and today the Canine Code Analyzer is the only one that does.

The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸

52of 52 dimensions measured by tools.
1140of 1152 findings point to an exact file and line, so you can open each one in the code. The other 12 concern the repository as a whole, such as missing documentation.
52dimensions across 6 lenses, read from 172,173 lines of product code in 1 project.
Chapters

Executive summary

antlr/antlr4 falls short of our standard for production because we found no automated security scanning of the code, its secrets or its dependencies. It scores 60 out of 100 and is rated Adequate, and 36 of its 51 critical findings are security problems.

Production Readiness, at 55, is the weakest lens, level with Code Health, and counts most in the score. The best first steps are fixing the password or key in the code and fixing the silenced warnings, each worth about 4 points. Raising Production Readiness to 70 would lift the score to about 63.

Eighteen pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Eleven known security holes in the packages the code depends on can be used by attackers, and three passwords or keys in the code's history and one in the code are open to anyone who can read the repository. Replacing each exposed password or key, pinning each tool to an exact version and updating the vulnerable packages would close these risks. Reading outside data into plain values would fix the place where outside data is turned straight into objects, and the two unsafe settings in infrastructure or container files need changing to safe values. The 11 sets of compiler warnings switched off in projects need turning back on in the build file.

The product code is 172,173 lines, about €230,000 to rebuild.

A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Production Readiness 55 · counts for 46%Code Health 55 · counts for 25%Security and Compliance 67 · counts for 14%Maturity 71 · counts for 8%Architecture 75 · counts for 4%Performance 100 · counts for 2%

If Production Readiness rose from 55 to 70, the lowest score rated Strong, the score would rise from 60 to about 63.

Code composition: what the lines of code are
Business logic 17%Supporting code 20%Tests 63%
New since the last survey: 218 findings

These 218 critical or serious findings weren't in the previous survey, on 24 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.

  • Code Duplication · Edited copy of a member (116 corresponding lines) runtime/CSharp/src/Atn/PredictionContext.cs
  • Code Duplication · Edited copy of a member (104 corresponding lines) runtime/CSharp/src/Atn/ParserATNSimulator.cs
  • Code Duplication · Edited copy of a member (132 corresponding lines) runtime/CSharp/src/Atn/ParserATNSimulator.cs
  • Code Duplication · Edited copy of a member (119 corresponding lines) runtime/CSharp/src/Atn/ParserATNSimulator.cs
  • Code Duplication · Edited copy of a member (48 corresponding lines) runtime/Go/antlr/v4/parser_atn_simulator.go
  • Code Duplication · Edited copy of a member (58 corresponding lines) runtime/CSharp/src/Atn/PredictionContext.cs
  • Code Duplication · Edited copy of a member (85 corresponding lines) runtime/CSharp/src/Atn/LexerATNSimulator.cs
  • Code Duplication · Edited copy of a member (62 corresponding lines) runtime/CSharp/src/Atn/PredictionContext.cs
  • Code Duplication · Edited copy of a member (75 corresponding lines) runtime/CSharp/src/Misc/IntervalSet.cs
  • Code Duplication · Edited copy of a member (37 corresponding lines) runtime/CSharp/src/Atn/ProfilingATNSimulator.cs
  • Code Duplication · Edited copy of a member (55 corresponding lines) runtime/CSharp/src/Atn/ParserATNSimulator.cs
  • Code Duplication · Edited copy of a member (51 corresponding lines) tool/src/org/antlr/v4/parse/ScopeParser.java
  • Code Duplication · Edited copy of a member (70 corresponding lines) runtime/CSharp/src/Atn/ParserATNSimulator.cs
  • Code Duplication · Edited copy of a member (47 corresponding lines) runtime/CSharp/src/Atn/ParserATNSimulator.cs
  • Code Duplication · Edited copy of a member (27 corresponding lines) tool/src/org/antlr/v4/codegen/model/ListenerFile.java
  • Code Duplication · Edited copy of a member (36 corresponding lines) runtime/CSharp/src/Atn/ATNDeserializer.cs
  • Code Duplication · Edited copy of a member (32 corresponding lines) tool/src/org/antlr/v4/automata/ParserATNFactory.java
  • Code Duplication · Edited copy of a member (40 corresponding lines) runtime/Swift/Sources/Antlr4/atn/ParserATNSimulator.swift
  • Code Duplication · Edited copy of a member (35 corresponding lines) runtime/Go/antlr/v4/parser_atn_simulator.go
  • Code Duplication · Edited copy of a member (41 corresponding lines) runtime/Dart/lib/src/atn/src/parser_atn_simulator.dart
  • Code Duplication · Edited copy of a member (41 corresponding lines) runtime/Go/antlr/v4/semantic_context.go
  • Code Duplication · Edited copy of a member (35 corresponding lines) runtime/CSharp/src/Atn/LexerATNSimulator.cs
  • Code Duplication · Edited copy of a member (31 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/misc/IntervalSet.java
  • Code Duplication · Edited copy of a member (28 corresponding lines) runtime/Python3/src/antlr4/atn/ParserATNSimulator.py
  • Code Duplication · Edited copy of a member (28 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/CodePointBuffer.java
  • Code Duplication · Edited copy of a member (67 corresponding lines) runtime/CSharp/src/Atn/LexerATNSimulator.cs
  • Code Duplication · Edited copies of one member (3 members, 41+ corresponding lines) runtime/CSharp/src/Atn/ParserATNSimulator.cs
  • Code Duplication · Edited copy of a member (36 corresponding lines) runtime/CSharp/src/Misc/IntervalSet.cs
  • Code Duplication · Edited copy of a member (22 corresponding lines) tool/src/org/antlr/v4/codegen/ParserFactory.java
  • Code Duplication · Edited copy of a member (20 corresponding lines) tool/src/org/antlr/v4/analysis/LeftRecursiveRuleAnalyzer.java
  • Code Duplication · Edited copy of a member (32 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/atn/SemanticContext.java
  • Code Duplication · Edited copies of one member (3 members, 34+ corresponding lines) runtime/Go/antlr/v4/jcollect.go
  • Code Duplication · Edited copy of a member (35 corresponding lines) runtime/Dart/lib/src/atn/src/semantic_context.dart
  • Code Duplication · Edited copy of a member (26 corresponding lines) runtime/Dart/lib/src/atn/src/semantic_context.dart
  • Code Duplication · Edited copy of a member (35 corresponding lines) runtime/CSharp/src/Atn/LexerATNSimulator.cs
  • Code Duplication · Edited copy of a member (37 corresponding lines) runtime/CSharp/src/Atn/SemanticContext.cs
  • Code Duplication · Edited copy of a member (15 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/tree/Trees.java
  • Code Duplication · Edited copy of a member (40 corresponding lines) runtime/CSharp/src/Atn/ParserATNSimulator.cs
  • Code Duplication · Edited copies of one member (3 members, 35+ corresponding lines) runtime/Swift/Sources/Antlr4/misc/BitSet.swift
  • Code Duplication · Edited copy of a member (37 corresponding lines) runtime/CSharp/src/Atn/ParserATNSimulator.cs
  • Code Duplication · Edited copy of a member (34 corresponding lines) runtime/Go/antlr/v4/semantic_context.go
  • Code Duplication · Edited copies of one member (3 members, 25+ corresponding lines) tool/src/org/antlr/v4/automata/LexerATNFactory.java
  • Code Duplication · Edited copy of a member (33 corresponding lines) runtime/Go/antlr/v4/dfa_serializer.go
  • Code Duplication · Edited copy of a member (16 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/atn/SemanticContext.java
  • Code Duplication · Edited copy of a member (27 corresponding lines) runtime/CSharp/src/Atn/SemanticContext.cs
  • Code Duplication · Edited copy of a member (21 corresponding lines) runtime/CSharp/src/Atn/LL1Analyzer.cs
  • Code Duplication · Edited copy of a member (24 corresponding lines) runtime/CSharp/src/Atn/PredictionContext.cs
  • Code Duplication · Edited copy of a member (32 corresponding lines) runtime/CSharp/src/Atn/ATNConfigSet.cs
  • Code Duplication · Edited copy of a member (28 corresponding lines) runtime/CSharp/src/Atn/ParserATNSimulator.cs
  • Code Duplication · Edited copy of a member (29 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/UnbufferedCharStream.java
  • Code Duplication · Edited copy of a member (34 corresponding lines) runtime/CSharp/src/Tree/Pattern/ParseTreePatternMatcher.cs
  • Code Duplication · Edited copy of a member (25 corresponding lines) runtime/Swift/Sources/Antlr4/atn/SemanticContext.swift
  • Code Duplication · Edited copy of a member (29 corresponding lines) runtime/CSharp/src/Atn/PredictionContext.cs
  • Code Duplication · Edited copy of a member (23 corresponding lines) runtime/CSharp/src/Atn/ParserATNSimulator.cs
  • Code Duplication · Edited copy of a member (19 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/misc/Array2DHashSet.java
  • Code Duplication · Edited copy of a member (14 corresponding lines) antlr4-maven-plugin/src/main/java/org/antlr/mojo/antlr4/Antlr4ErrorLog.java
  • Code Duplication · Edited copy of a member (18 corresponding lines) runtime/CSharp/src/Atn/ParserATNSimulator.cs
  • Code Duplication · Edited copy of a member (24 corresponding lines) runtime/Go/antlr/v4/utils.go
  • Code Duplication · Edited copy of a member (17 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/CommonToken.java
  • Code Duplication · Edited copy of a member (18 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/misc/Array2DHashSet.java
  • Code Duplication · Edited copies of one member (4 members, 26+ corresponding lines) runtime/Swift/Sources/Antlr4/misc/BitSet.swift
  • Code Duplication · Edited copies of one member (3 members, 27+ corresponding lines) runtime/Go/antlr/v4/jcollect.go
  • Code Duplication · Edited copy of a member (23 corresponding lines) runtime/Swift/Sources/Antlr4/atn/SemanticContext.swift
  • Code Duplication · Edited copy of a member (16 corresponding lines) tool/src/org/antlr/v4/gui/TreePostScriptGenerator.java
  • Code Duplication · Edited copy of a member (19 corresponding lines) runtime/Swift/Sources/Antlr4/BufferedTokenStream.swift
  • Code Duplication · Edited copy of a member (12 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/BufferedTokenStream.java
  • Code Duplication · Edited copy of a member (30 corresponding lines) runtime/Swift/Sources/Antlr4/atn/ATNConfig.swift
  • Code Duplication · Edited copy of a member (34 corresponding lines) runtime/CSharp/src/UnbufferedCharStream.cs
  • Code Duplication · Edited copy of a member (18 corresponding lines) runtime/CSharp/src/Misc/RuleDependencyChecker.cs
  • Code Duplication · Edited copy of a member (18 corresponding lines) runtime/CSharp/src/Atn/LexerActionExecutor.cs
  • Code Duplication · Edited copy of a member (22 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/ParserRuleContext.java
  • Code Duplication · Edited copies of one member (3 members, 21+ corresponding lines) runtime/Java/src/org/antlr/v4/runtime/CodePointCharStream.java
  • Code Duplication · Edited copy of a member (11 corresponding lines) tool/src/org/antlr/v4/codegen/ActionTranslator.java
  • Code Duplication · Edited copy of a member (23 corresponding lines) runtime/Swift/Sources/Antlr4/misc/BitSet.swift
  • Code Duplication · Edited copy of a member (22 corresponding lines) runtime/CSharp/src/BufferedTokenStream.cs
  • Code Duplication · Edited copies of one member (3 members, 10+ corresponding lines) runtime/Go/antlr/v4/parser_atn_simulator.go
  • Code Duplication · Edited copy of a member (17 corresponding lines) runtime/CSharp/src/Atn/ATNDeserializer.cs
  • Code Duplication · Edited copy of a member (28 corresponding lines) runtime/CSharp/src/Atn/PredictionMode.cs
  • Code Duplication · Edited copy of a member (17 corresponding lines) runtime/Python3/src/antlr4/atn/SemanticContext.py
  • Code Duplication · Edited copy of a member (24 corresponding lines) runtime/Python3/src/antlr4/atn/SemanticContext.py
  • Code Duplication · Edited copy of a member (18 corresponding lines) runtime/CSharp/src/Atn/ParserATNSimulator.cs
  • Code Duplication · Edited copy of a member (15 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/tree/xpath/XPathRuleElement.java
  • Code Duplication · Edited copy of a member (13 corresponding lines) tool/src/org/antlr/v4/codegen/model/ElementFrequenciesVisitor.java
  • Code Duplication · Edited copy of a member (20 corresponding lines) runtime/Dart/lib/src/atn/src/parser_atn_simulator.dart
  • Code Duplication · Edited copy of a member (16 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/BufferedTokenStream.java
  • Code Duplication · Edited copy of a member (18 corresponding lines) runtime/Python3/src/antlr4/ListTokenSource.py
  • Code Duplication · Edited copy of a member (12 corresponding lines) runtime/Swift/Sources/Antlr4/atn/LexerATNSimulator.swift
  • Code Duplication · Edited copies of one member (3 members, 7+ corresponding lines) runtime/Swift/Sources/Antlr4/atn/ParserATNSimulator.swift
  • Code Duplication · Edited copy of a member (13 corresponding lines) tool/src/org/antlr/v4/automata/LexerATNFactory.java
  • Code Duplication · Edited copy of a member (16 corresponding lines) runtime/Swift/Sources/Antlr4/Parser.swift
  • Code Duplication · Edited copy of a member (19 corresponding lines) runtime/Go/antlr/v4/common_token_stream.go
  • Code Duplication · Edited copy of a member (9 corresponding lines) runtime/Python3/src/antlr4/BufferedTokenStream.py
  • Code Duplication · Edited copy of a member (16 corresponding lines) runtime/CSharp/src/Atn/LexerATNSimulator.cs
  • Code Duplication · Edited copies of one member (3 members, 8+ corresponding lines) runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java
  • Code Duplication · Edited copy of a member (18 corresponding lines) runtime/CSharp/src/Atn/LexerATNSimulator.cs
  • Code Duplication · Edited copy of a member (13 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/misc/Array2DHashSet.java
  • Code Duplication · Edited copy of a member (12 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/misc/Pair.java
  • Code Duplication · Edited copy of a member (13 corresponding lines) runtime/Swift/Sources/Antlr4/DefaultErrorStrategy.swift
  • Code Duplication · Edited copies of one member (3 members, 12+ corresponding lines) runtime/Swift/Sources/Antlr4/DiagnosticErrorListener.swift
  • Code Duplication · Edited copy of a member (10 corresponding lines) tool/src/org/antlr/v4/codegen/model/decl/AltLabelStructDecl.java

We compare every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.

Fixed since the last survey: 7 findings

These 7 critical or serious findings were in the previous survey, on 24 October 2026, and are gone from this one.

  • Code Duplication · Duplicated block (22 lines × 2) runtime/Go/antlr/v4/parser_atn_simulator.go
  • Code Duplication · Duplicated block (15 lines × 2) runtime/Go/antlr/v4/jcollect.go
  • Code Duplication · Duplicated block (12 lines × 2) runtime/Go/antlr/v4/semantic_context.go
  • Code Duplication · Duplicated block (7 lines × 2) runtime/Swift/Sources/Antlr4/atn/ActionTransition.swift
  • Code Duplication · Duplicated block (12 lines × 2) runtime/Dart/lib/src/interval_set.dart
  • Cohesion (LCOM4) · Low cohesion: Parser (LCOM4 6) runtime/CSharp/src/Parser.cs
  • Secrets (history) · High secret: WD-SECRET-0005 REDACTED
Rebuild cost: about €230,000 · Estimate
Cost to rebuild€76,000 to €380,000, for 1,261 to 4,019 hours of work, about 1.6 person-years for 1 to 3 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.8 at a score of 60. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeLarge: 172,173 lines of product code
Comment linesThe estimate prices 161,593 lines. Comment lines count towards the size of 172,173 lines but aren't priced as work.
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty.

Top priorities

The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.

1
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED.
Raises the score by about 4 points · Low effort · REDACTED Scanning
2
Resolve the 3 FileScopedPragmaDisable finding(s) in Explicit Debt — start with ArrayPredictionContext.cs, EmptyPredictionContext.cs, SingletonPredictionContext.cs.
Raises the score by about 4 points · Low effort · Explicit Debt
3
Add a SAST step to CI running what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Raises the score by about 4 points · Medium effort · Security & performance tooling

Diagnosis: what the measurements show together

Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.

Where the investment is most exposed · Value at risk
This code would cost about €230,000 to build again, about 1.6 person-years of work. Its weakest lens is Production Readiness, at 55 (Adequate). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 4 points for low effort, because it clears the 1 REDACTED Scanning findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort

Architecture — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.

arch Antlr4 Antlr4

Architecture: which parts of the code depend on which

The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.

206 modules, with 292 dependencies between them. 3 loops run through 21 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 166 more are left out to keep it readable.

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 runtime.JavaScript.src.antlr4.action.LexerAction2 runtime.JavaScript.src.antlr4.state.ATNState3 runtime.JavaScript.src.antlr4.transition.Transition4 runtime.Python3.src.antlr4.InputStream5 runtime.Python3.src.antlr4.PredictionContext6 runtime.Python3.src.antlr4.Token7 runtime.Python3.src.antlr4.atn.ATNState8 Antlr4.Runtime.Misc9 org.antlr.v4.runtime.dfa10 org.antlr.v4.runtime.tree11 runtime.JavaScript.src.antlr4.state.DecisionState12 runtime.Python3.src.antlr4.atn.ATNConfig13 runtime.Python3.src.antlr4.tree.Tree14 Antlr4.Runtime.Atn15 Antlr4.Runtime.Tree16 org.antlr.v4.runtime.atn17 runtime.Python3.src.antlr4.RuleContext18 runtime.Python3.src.antlr4.atn.ATNConfigSet19 Antlr4.Runtime20 org.antlr.v4.runtime21 runtime.Python3.src.antlr4.ParserRuleContext22 runtime.Python3.src.antlr4.Recognizer23 runtime.Python3.src.antlr4.atn.ATN24 runtime.Python3.src.antlr4.dfa.DFAState25 org.antlr.v4.runtime.misc26 runtime.Python3.src.antlr4.atn.LexerATNSimulator27 runtime.Python3.src.antlr4.error.Errors28 org.antlr.v4.codegen.model.decl29 org.antlr.v4.misc30 org.antlr.v4.tool.ast31 runtime.Python3.src.antlr4.Lexer32 org.antlr.v4.analysis33 org.antlr.v4.codegen.model34 org.antlr.v4.parse35 runtime.Python3.src.antlr4.Parser36 org.antlr.v4.codegen37 runtime.Python3.src.antlr4.atn.ParserATNSimulator38 org.antlr.v4.tool39 org.antlr.v440 org.antlr.v4.automata
1 runtime.JavaScript.src.antlr4.action.LexerAction
2 runtime.JavaScript.src.antlr4.state.ATNState
3 runtime.JavaScript.src.antlr4.transition.Transition
4 runtime.Python3.src.antlr4.InputStream
5 runtime.Python3.src.antlr4.PredictionContext
6 runtime.Python3.src.antlr4.Token
7 runtime.Python3.src.antlr4.atn.ATNState
8 Antlr4.Runtime.Misc3
9 org.antlr.v4.runtime.dfa42
10 org.antlr.v4.runtime.tree113
11 runtime.JavaScript.src.antlr4.state.DecisionState1
12 runtime.Python3.src.antlr4.atn.ATNConfig22
13 runtime.Python3.src.antlr4.tree.Tree2
14 Antlr4.Runtime.Atn1147
15 Antlr4.Runtime.Tree28
16 org.antlr.v4.runtime.atn94521
17 runtime.Python3.src.antlr4.RuleContext2
18 runtime.Python3.src.antlr4.atn.ATNConfigSet1
19 Antlr4.Runtime121515
20 org.antlr.v4.runtime6161622
21 runtime.Python3.src.antlr4.ParserRuleContext121
22 runtime.Python3.src.antlr4.Recognizer11
23 runtime.Python3.src.antlr4.atn.ATN21
24 runtime.Python3.src.antlr4.dfa.DFAState1
25 org.antlr.v4.runtime.misc12
26 runtime.Python3.src.antlr4.atn.LexerATNSimulator1111111
27 runtime.Python3.src.antlr4.error.Errors211
28 org.antlr.v4.codegen.model.decl24184
29 org.antlr.v4.misc3
30 org.antlr.v4.tool.ast1113
31 runtime.Python3.src.antlr4.Lexer1112
32 org.antlr.v4.analysis32562
33 org.antlr.v4.codegen.model31012238559
34 org.antlr.v4.parse1172
35 runtime.Python3.src.antlr4.Parser11211111
36 org.antlr.v4.codegen3615571182
37 runtime.Python3.src.antlr4.atn.ParserATNSimulator1211111111
38 org.antlr.v4.tool37177223116
39 org.antlr.v4157
40 org.antlr.v4.automata1531316
Uses a module listed above itPart of a loopThe module itself
1 runtime.JavaScript.src.antlr4.action.LexerAction2 runtime.JavaScript.src.antlr4.state.ATNState3 runtime.JavaScript.src.antlr4.transition.Transition4 runtime.Python3.src.antlr4.InputStream5 runtime.Python3.src.antlr4.PredictionContext6 runtime.Python3.src.antlr4.Token7 runtime.Python3.src.antlr4.atn.ATNState8 Antlr4.Runtime.Misc9 org.antlr.v4.runtime.dfa10 org.antlr.v4.runtime.tree11 runtime.JavaScript.src.antlr4.state.DecisionState12 runtime.Python3.src.antlr4.atn.ATNConfig13 runtime.Python3.src.antlr4.tree.Tree14 Antlr4.Runtime.Atn15 Antlr4.Runtime.Tree16 org.antlr.v4.runtime.atn17 runtime.Python3.src.antlr4.RuleContext18 runtime.Python3.src.antlr4.atn.ATNConfigSet19 Antlr4.Runtime20 org.antlr.v4.runtime21 runtime.Python3.src.antlr4.ParserRuleContext22 runtime.Python3.src.antlr4.Recognizer23 runtime.Python3.src.antlr4.atn.ATN24 runtime.Python3.src.antlr4.dfa.DFAState25 org.antlr.v4.runtime.misc26 runtime.Python3.src.antlr4.atn.LexerATNSimulator27 runtime.Python3.src.antlr4.error.Errors28 org.antlr.v4.codegen.model.decl29 org.antlr.v4.misc30 org.antlr.v4.tool.ast31 runtime.Python3.src.antlr4.Lexer32 org.antlr.v4.analysis33 org.antlr.v4.codegen.model34 org.antlr.v4.parse35 runtime.Python3.src.antlr4.Parser36 org.antlr.v4.codegen37 runtime.Python3.src.antlr4.atn.ParserATNSimulator38 org.antlr.v4.tool39 org.antlr.v440 org.antlr.v4.automataruntime.JavaScript.src.antlr4.action.LexerAction1runtime.JavaScript.src.antlr4.state.ATNState2runtime.JavaScript.src.antlr4.transition.Transition3runtime.Python3.src.antlr4.InputStream4runtime.Python3.src.antlr4.PredictionContext5runtime.Python3.src.antlr4.Token6runtime.Python3.src.antlr4.atn.ATNState7Antlr4.Runtime.Misc8org.antlr.v4.runtime.dfa9org.antlr.v4.runtime.tree10runtime.JavaScript.src.antlr4.state.DecisionState11runtime.Python3.src.antlr4.atn.ATNConfig12runtime.Python3.src.antlr4.tree.Tree13Antlr4.Runtime.Atn14Antlr4.Runtime.Tree15org.antlr.v4.runtime.atn16runtime.Python3.src.antlr4.RuleContext17runtime.Python3.src.antlr4.atn.ATNConfigSet18Antlr4.Runtime19org.antlr.v4.runtime20runtime.Python3.src.antlr4.ParserRuleContext21runtime.Python3.src.antlr4.Recognizer22runtime.Python3.src.antlr4.atn.ATN23runtime.Python3.src.antlr4.dfa.DFAState24org.antlr.v4.runtime.misc25runtime.Python3.src.antlr4.atn.LexerATNSimulator26runtime.Python3.src.antlr4.error.Errors27org.antlr.v4.codegen.model.decl28org.antlr.v4.misc29org.antlr.v4.tool.ast30runtime.Python3.src.antlr4.Lexer31org.antlr.v4.analysis32org.antlr.v4.codegen.model33org.antlr.v4.parse34runtime.Python3.src.antlr4.Parser35org.antlr.v4.codegen36runtime.Python3.src.antlr4.atn.ParserATNSimulator37org.antlr.v4.tool38org.antlr.v439org.antlr.v4.automata403421131222114728945212112151561616221211121112111111121124184311131112325623101223855911721121111136155711821211111111371772231161571531316+166 more modules (most-connected shown)

At a glance — Code Health · 55% · Adequate · gated by R1 ·

At a glance — Architecture · 75% · Adequate · gated by AX2 ·

At a glance — Maturity · 71% · Adequate · gated by D34 ·

At a glance — Readiness · 55% · Adequate · gated by P3 ·

At a glance — Security · 67% · Adequate ·

At a glance — Performance · 100% · Exemplary ·

Security & Compliance — OWASP Top-10 mapping

Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).

OWASP categoryFindingsSeverity
A05:2025 — Injection29High / Critical
A03:2025 — Software Supply Chain Failures19High / Critical
A02:2025 — Security Misconfiguration6High / Critical
A07:2025 — Authentication Failures5High / Critical

Roadmap

Top priorities: Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED; Resolve the 116 No assertions finding(s) in Test Quality — start with TestToolSyntaxErrors.java (45), TestSymbolIssues.java (25), TestATNConstruction.java (22); Add a SAST step to CI running what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.

Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.

Do thisHelpsEffortDimension
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED.+4.3 ptsLowREDACTED Scanning
Resolve the 3 FileScopedPragmaDisable finding(s) in Explicit Debt — start with ArrayPredictionContext.cs, EmptyPredictionContext.cs, SingletonPredictionContext.cs.+3.9 ptsLowExplicit Debt
Add a SAST step to CI running what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.+4.1 ptsMediumSecurity & performance tooling
Resolve the 1 finding(s) in Type Safety.+4.0 ptsMediumType Safety
Resolve the 11 NoWarnInCsproj finding(s) in Explicit Debt — start with Test.csproj (6), Antlr4.csproj (5).+3.9 ptsMediumExplicit Debt
Resolve the 116 No assertions finding(s) in Test Quality — start with TestToolSyntaxErrors.java (45), TestSymbolIssues.java (25), TestATNConstruction.java (22).+4.2 ptsHighTest Quality
Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.+1.8 ptsMediumDeployment & Rollback
Resolve the 2 End-of-life runtime finding(s) in Platform End-of-Life — start with Test.csproj (2).+0.7 ptsLowPlatform End-of-Life

File quality

Per-file score 0–10 — a quality signature. Of 249 files carrying findings, judged against the Production bar: 2% slop · 62% mixed · 36% near-clean.

FileScoreBandWorst signal
REDACTED0.0SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED0.2SlopStatic Analysis (SAST): High: REDACTED
REDACTED1.9SlopIaC & Container Security: High IaC: REDACTED
runtime/CSharp/tests/issue-2693/Test.csproj3.7SlopExplicit Debt: NoWarnInCsproj
runtime/CSharp/tests/issue-3079/Test.csproj3.7SlopExplicit Debt: NoWarnInCsproj
REDACTED4.4MixedREDACTED Scanning: Leaked secret: REDACTED
runtime/CSharp/src/Antlr4.csproj5.4MixedExplicit Debt: NoWarnInCsproj
REDACTED5.7MixedStatic Analysis (SAST): High: REDACTED
runtime/CSharp/src/Atn/ArrayPredictionContext.cs5.8MixedExplicit Debt: FileScopedPragmaDisable
REDACTED5.8MixedSecrets (history): REDACTED: REDACTED
runtime/Java/src/org/antlr/v4/runtime/Parser.java5.9MixedCognitive Complexity: Parser.consume (cognitive 21)
runtime/CSharp/src/Atn/ATNDeserializer.cs6.0MixedExplicit Debt: TodoComment
runtime/CSharp/src/Atn/PredictionContext.cs6.0MixedExplicit Debt: TodoComment
runtime/CSharp/src/Misc/RuleDependencyChecker.cs6.0MixedExplicit Debt: DeadPreprocessorBranch
runtime/CSharp/src/Atn/ParserATNSimulator.cs6.0MixedExplicit Debt: CommentedOutCode
runtime/CSharp/src/Atn/LexerATNSimulator.cs6.0MixedExplicit Debt: TodoComment
runtime/CSharp/src/Parser.cs6.0MixedExplicit Debt: TodoComment
runtime/CSharp/src/Atn/ATNConfigSet.cs6.0MixedExplicit Debt: TodoComment
runtime/CSharp/src/Atn/ATNConfig.cs6.0MixedExplicit Debt: CommentedOutCode
REDACTED6.4MixedStatic Analysis (SAST): Medium: REDACTED

How the grades work

Every finding carries one of four grades. Three say how serious it is. The fourth says this survey could not settle it — and it is a grade, not a gap.

Critical — 51

A definite problem that already costs you something and drags the score down: a missing authorisation check, a dependency with a known exploit, a build that does not reproduce. Failure here tends to cause failures elsewhere.

Serious — 973

Likely wrong, but not failing yet. It degrades the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to carry for two years either.

Minor — 128

Recorded, with no effect on how the codebase functions. Present so the survey is complete, not because it needs doing.

Could not be resolved — 16

Something this survey could not settle from the outside, and which could be critical or serious. Either a control was required and no positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean result. These are excluded from the score rather than awarded a pass, so the number on the cover neither rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each one is named under Limitations.

Methodology & how to trust this report

This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 52 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.

Every figure here is one of two kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10.

What we checked — 52 dimensions across the health lenses
D1D2D3D4D5D6D10D13D14D15D16D17D19D21D24D28D29D30D31D34D35D43D44AX10AX2AX3AX4AX5AX6AX9GD1M1M2M3M4P1P10P3P4P6PF3R1R10R2R3R4R5R6R7R8R9X20

Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.

How to trust any code-health report — three questions
  1. Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 1140 of 1152 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

This report answers yes to all three. That's the bar to hold any assessment to.

Tools & methods

The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Canine Code Analyzer duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivy · checkovSecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3 · 3.2.533✓ deterministic

Every finding is locatable in findings.md. Run 01a1d53e-b548-7b19-af3c-506be0a60eed.

The exact command behind every deep-scan dimension — tool, version, invocation and retained raw output — is in Appendix B — Reproduction & audit trail.

Run transparency — what happened this run

What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.

  • D4 Code Duplication — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 65 duplicated block group(s) on this row were found in the languages this pass could tokenize, and they do NOT cover all of this repository's production source: .cpp (25,431 lines, 16% of production source) went unread, because no language model this pass could load exposed a clone-unit token stream for those file kinds. Duplication in that source is UNMEASURED — its absence from the count above is a gap in this analyzer's language coverage, not a finding that the code is free of duplication.
  • D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 783 test(s) behind this row are the ones the code-model census could read, and this repository also carries at least 27 test source file(s) (.swift, .py) that it cannot: it reads the test types the .java frontend declared, so a suite in any other language is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
  • D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT MEASURED: the JavaScript/TypeScript suite could not be re-run in the analyzer sandbox — the jasmine run in runtime/JavaScript/ produced no per-test report (Error: Cannot find module 'runtime/JavaScript/dist/antlr4.node.cjs'). This is OUR limitation, not a defect in the repo — it is excluded from the score.
  • D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the jasmine suite in runtime/JavaScript/ was NOT MEASURED: the jasmine run in runtime/JavaScript/ produced no per-test report (Error: Cannot find module 'runtime/JavaScript/dist/antlr4.node.cjs'). This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
  • D12 Dependency Hygiene — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `dotnet list package` did not return usable output (restore or query failed); no outdated/vulnerable/deprecated data to assess. The tool said: `dotnet list package` exited 1 with no output.
  • D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Swift Package.swift/Package.resolved, but the licence verdict published here was taken over its NuGet package dependencies. Nothing was read about its SwiftPM dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Maven POM, but the licence verdict published here was taken over its NuGet package dependencies. Nothing was read about its Maven dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D17 Explicit Debt — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The C# workspace loaded this repository's projects but reported a load failure, and the dead-code reference search is unreliable over a graph that did not load cleanly, so it was skipped. The other debt markers on this row were read; dead symbols were not, and their absence from the score is not a finding that the code has none. First load diagnostic: Failure: Cannot open project 'runtime/Cpp/runtime/antlr4cpp-vs2022.vcxproj' because the file extension '.vcxproj' is not associated with a language.
  • D17 Explicit Debt — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 39 deducted marker(s) and the 0.6/KLoC density on this row were taken over this repository's .NET projects ALONE: .java (45,438 lines, 28% of production source), .cpp (25,431 lines, 16% of production source) went unread, because every marker collector on this path is reached through a C# workspace. A read-only sweep of that source finds at least 53 task marker(s) (TODO/FIXME/HACK/XXX) across 33 file(s) that this score does not count — a floor, since only line comments are read there and D17's other eight marker kinds (suppressions, NoWarn, editorconfig severities, empty catches, commented-out code, Obsolete, dead code, preprocessor branches) need a compiler we do not have for that language. The debt in that source is UNMEASURED — its absence from the score above is a gap in this analyzer's language coverage, not a finding that the code carries none.
  • D18 Solution Shape — evaluation did not complete — Dimension evaluation failed — excluded from the score.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
  • D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
  • D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D26 Project Cohesion — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `Antlr4` (28476 LoC, 185 public types across 9 namespaces) is over its size bounds, and whether one unit is a coherent whole or a grab-bag is read from its type references: the parts of it that reach the rest only through its shared core. Those are read over the C#/VB code model, which this unit's source did not supply. Its size alone is no verdict on its cohesion, so none is published.
  • D27 Navigability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
  • D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `runtime/Swift/Sources/Antlr4/atn/PredictionContext.swift` produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via REDACTED (REDACTED). docker build failed (exit 1) — /sh -c apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install maven git -y && git clone https://github.com/antlr/antlr4.git && cd antlr4 && git checkout $ANTLR_VERSION && mvn clean --projects tool --also-make && mvn -DskipTests install --projects tool --also-make && mv ./tool/target/antlr4-*-complete.jar antlr4-tool.jar" did not complete successfully: exit code: 1; runtime evidence skipped.
  • IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X16 Unfloored truncation loop — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X25 Inert configuration knob — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X27 Collection changed while being enumerated — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X28 Index access outside its own emptiness guard — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X29 Per-element action decided by a fixed element — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X3 Exception handling — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.

Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.

Limitations & what we did not check

We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.

Per-dimension blind spots

For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
  • D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (REDACTED, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
  • M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

D1 · Cyclomatic Complexity6.7 / 10Adequate✓ Tool-verified

What it measures: How tangled the control flow is — methods with many branches are hard to test and change.

Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.

Maturity: Documented → Verified → Prevented · effective 6.7 / 10 · rule-coverage 100% · ceiling Prevented

128 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was ATNDeserializer.deserialize at 54.

LL1Analyzer._LOOK (cyclomatic 22) · ×5runtime/Java/src/org/antlr/v4/runtime/atn/LL1Analyzer.java:137
ParserATNSimulator.closure_ (cyclomatic 17) · ×5runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:1504
ParserATNSimulator.computeReachSet (cyclomatic 24) · ×4runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:747
ParseTreePatternMatcher.split (cyclomatic 21) · ×4runtime/Java/src/org/antlr/v4/runtime/tree/pattern/ParseTreePatternMatcher.java:412
LexerATNSimulator.closure (cyclomatic 18) · ×4runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java:403

+ 81 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 7 bodies over 30 down to 30 or less in Cyclomatic Complexity — start with ATNDeserializer.deserialize (cyclomatic 54), antlr.reduceToSingleOperationPerIndex (cyclomatic 40), GrammarTransformPipeline.integrateImportedGrammars (cyclomatic 39). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 7 together lifts Cyclomatic Complexity from 6.7 to about 7.3/10, projected with the scoring formula itself and assuming each lands exactly at 30; a cleaner split scores higher.

Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.

D2 · Cognitive Complexity5.0 / 10Adequate✓ Tool-verified

What it measures: How hard the code is for a person to follow, beyond raw branching.

Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.

Maturity: Documented → Verified → Prevented · effective 5.0 / 10 · rule-coverage 100% · ceiling Prevented

308 method(s) exceeded the cognitive complexity threshold of 15; the worst was GrammarTransformPipeline.integrateImportedGrammars at 125.

ParserATNSimulator.evalSemanticContext (cognitive 18) · ×6runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:1353
LexerATNSimulator.getReachableConfigSet (cognitive 19) · ×5runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java:317
LexerATNSimulator.execATN (cognitive 16) · ×4runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java:165
RuleContext.toString (cognitive 16) · ×4runtime/Java/src/org/antlr/v4/runtime/RuleContext.java:224
ParserATNSimulator.closure_ (cognitive 44) · ×3runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:1504

+ 228 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 9 bodies over 60 down to 60 or less in Cognitive Complexity — start with GrammarTransformPipeline.integrateImportedGrammars (cognitive 125), ATNDeserializer.deserialize (cognitive 125), CodeGenPipeline.process (cognitive 85). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 9 together lifts Cognitive Complexity from 5.0 to about 6.1/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.

D3 · God Classes8.5 / 10Strong✓ Tool-verified

What it measures: Over-large classes that try to do too much ("god classes").

Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.

Maturity: Documented → Verified → Prevented · effective 8.5 / 10 · rule-coverage 100% · ceiling Prevented

61 god class(es) detected.

TooManyMethods: Grammar · ×38tool/src/org/antlr/v4/tool/Grammar.java:52
FileTooLong: src/parser_atn_simulator.dart · ×12runtime/Dart/lib/src/atn/src/parser_atn_simulator.dart
ClassTooLong: ParserATNSimulator · ×8runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:250
MethodTooLong: ATNDeserializer.deserialize · ×3runtime/Java/src/org/antlr/v4/runtime/atn/ATNDeserializer.java:51

What to do

  1. Resolve the 38 TooManyMethods finding(s) in God Classes — start with Grammar.java, Parser.java, Parser.swift. — One of this dimension's main actionable groups (38 warning-level).
  2. Resolve the 12 FileTooLong finding(s) in God Classes — start with parser_atn_simulator.dart, ParserATNSimulator.java, ParserATNSimulator.cs. — One of this dimension's main actionable groups (12 warning-level).
  3. Resolve the 8 ClassTooLong finding(s) in God Classes — start with ParserATNSimulator.java, parser_atn_simulator.go, Grammar.java. — One of this dimension's main actionable groups (8 warning-level).

Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.

D4 · Code Duplication9.8 / 10Stronggated by 269 serious findings✓ Tool-verified

What it measures: Copy-pasted code that should be shared instead.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.

Maturity: Documented → Verified → Prevented · effective 9.8 / 10 · rule-coverage 100% · ceiling Verified

65 duplicated block group(s) detected. A further 204 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 2 of the 269 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population. Measured on part of this repository only: .cpp (16% of production source) was not exposed to the token comparison, so duplication there is unmeasured and is not in this count.

Edited copy of a member (6 corresponding lines) · ×13runtime/Java/src/org/antlr/v4/runtime/atn/ATNConfigSet.java:56
Edited copy of a member (11 corresponding lines) · ×12tool/src/org/antlr/v4/codegen/ActionTranslator.java:263
Edited copy of a member (8 corresponding lines) · ×12runtime/Python3/src/antlr4/error/ErrorStrategy.py:309
Edited copy of a member (16 corresponding lines) · ×11runtime/Java/src/org/antlr/v4/runtime/atn/SemanticContext.java:215
Edited copy of a member (18 corresponding lines) · ×10runtime/CSharp/src/Atn/ParserATNSimulator.cs:988

+ 90 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 13 Edited copy of a member (6 corresponding lines) finding(s) in Code Duplication — start with Target.java (4), ATNConfigSet.java, utils.go. — One of this dimension's main actionable groups (13 warning-level).
  2. Resolve the 12 Edited copy of a member (11 corresponding lines) finding(s) in Code Duplication — start with ActionTranslator.java, GrammarAST.java, CodePointBuffer.java. — One of this dimension's main actionable groups (12 warning-level).
  3. Resolve the 12 Edited copy of a member (8 corresponding lines) finding(s) in Code Duplication — start with ErrorStrategy.py, lexer_action.dart, Alternative.java. — One of this dimension's main actionable groups (12 warning-level).

Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.

D5 · Coupling10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.

Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.

Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

1 projects, 0 dependency cycle(s), 0 unstable depended-on project(s).

✓ On the Gold path — maintain.

Detailed fixes: d5_recommendation.md.

D6 · Cohesion (LCOM4)9.9 / 10Stronggated by 2 serious findings✓ Tool-verified

What it measures: Whether a class's methods are focused on a single responsibility.

Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.

Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.

Maturity: Documented → Verified → Prevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Verified

2 of 174 classes have LCOM4 above 3.

Low cohesion: Parser (LCOM4 8) · ×2runtime/Java/src/org/antlr/v4/runtime/Parser.java:38

What to do

  1. Resolve the 2 Low cohesion finding(s) in Cohesion (LCOM4) — start with Parser.java, Recognizer.cs. — One of this dimension's main actionable groups (2 warning-level).

Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.

D10 · Test Quality7.8 / 10Strong✓ Tool-verified

What it measures: Whether the tests truly assert behaviour rather than just running the code.

Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.

Maturity: Documented → Verified → Prevented · effective 7.8 / 10 · rule-coverage 100% · ceiling Prevented

5 skipped (5 with a documented reason), 116 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 783 tests. Measured on the .java suite only — at least 27 test source file(s) (.swift, .py) went unread, so its test quality is unmeasured and is not in these counts.

No assertions: processWhenDependencyRemoved · ×116antlr4-maven-plugin/src/test/java/org/antlr/mojo/antlr4/Antlr4MojoTest.java:316
Skipped (documented): test_aex_bfx · ×5tool-testsuite/test/org/antlr/v4/test/tool/TestGraphNodes.java:396

What to do

  1. Resolve the 116 No assertions finding(s) in Test Quality — start with TestToolSyntaxErrors.java (45), TestSymbolIssues.java (25), TestATNConstruction.java (22). — One of this dimension's main actionable groups (116 warning-level).

Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.

D13 · REDACTED Scanning5.0 / 10Adequate✓ Tool-verified

What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.

Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.

Maturity: Documented → Verified → Prevented · effective 5.0 / 10 · rule-coverage 100% · ceiling Prevented

1 secret(s) detected.

REDACTED

What to do

  1. Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).

Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.

D14 · License Compliance10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether the licenses of third-party packages are compatible with your policy.

Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 of 85 packages use a banned license. ★ DEPTH: this repository's MSBuild projects declare 1 direct `PackageReference`(s), and 83 further package(s) were reached beyond them by closing the graph over nuget.org's own nuspec dependency graph — so a banned licence pulled in only by a dependency's OWN dependencies is inside this verdict. A package whose licence nuget.org could not be asked for is not graded, and version ranges are taken at their lower bound, so this is the closure as that graph states it rather than a restored consumer's exact resolution. ★ COVERAGE OF THIS VERDICT: it grades this repository's NuGet package dependencies and nothing else. The repository also declares a Swift Package.swift/Package.resolved and a Maven POM, and the licences of those dependency graphs were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots10.0 / 10Exemplary✓ Tool-verified

What it measures: Files that change often and are also complex — the riskiest hotspots.

Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No churn × complexity hotspots in the window.

✓ On the Gold path — maintain.

Detailed fixes: d15_recommendation.md.

D16 · Bus Factor9.7 / 10Exemplary✓ Tool-verified

What it measures: Whether knowledge is concentrated in too few people (the "bus factor").

Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.

Maturity: Documented → Verified → Prevented · effective 9.7 / 10 · rule-coverage 100% · ceiling Documented

1 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is runtime/CSharp/src/IVocabulary.cs. Counted over 30 of the 179 production source files in this repository: 83 are under the ~2,400-byte size floor this dimension measures over, and the remaining 66 have no attributable history left to measure.

Off-boarding risk: anonymized user #1

✓ On the Gold path — maintain.

Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.

D17 · Explicit Debt8.9 / 10Adequategated by 14 critical findings✓ Tool-verified

What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.

Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.

Maturity: Documented → Verified → Prevented · effective 8.9 / 10 · rule-coverage 100% · ceiling Prevented

39 deducted debt markers + unmeasured dead symbols across 28476 LoC in the .NET projects (0.6/KLoC) → score 8.9. Dead code not measured: the solution did not load cleanly, so the reference search was skipped. Measured on the .NET source only: .java, .cpp (44% of production source) was not read, and carries at least 53 uncounted task marker(s) in 33 file(s).

NoWarnInCsproj · ×11runtime/CSharp/src/Antlr4.csproj:8
FileScopedPragmaDisable · ×3runtime/CSharp/src/Atn/ArrayPredictionContext.cs:13
TodoComment · ×15runtime/CSharp/src/Atn/ATNConfigSet.cs:35
CommentedOutCode · ×6runtime/CSharp/src/AntlrInputStream.cs:280
DeadPreprocessorBranch · ×4runtime/CSharp/src/Misc/RuleDependencyChecker.cs:234

What to do

  1. Resolve the 11 NoWarnInCsproj finding(s) in Explicit Debt — start with Test.csproj (6), Antlr4.csproj (5). — One of this dimension's main actionable groups (11 issue-level).
  2. Resolve the 3 FileScopedPragmaDisable finding(s) in Explicit Debt — start with ArrayPredictionContext.cs, EmptyPredictionContext.cs, SingletonPredictionContext.cs. — One of this dimension's main actionable groups (3 issue-level).
  3. Resolve the 15 TodoComment finding(s) in Explicit Debt — start with ParserATNSimulator.cs (3), ATNConfigSet.cs (2), ATNDeserializer.cs. — One of this dimension's main actionable groups (15 warning-level).

Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.

D19 · Documentation Quality6.7 / 10Adequate✓ Tool-verified

What it measures: Whether the project's documentation is clear, complete, and useful.

Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.

Maturity: Documented → Verified → Prevented · effective 6.7 / 10 · rule-coverage 100% · ceiling Documented

0 of 1 documentation facets pass in full; short on: F2 example. 57 document(s) read across 3 unit(s).

Documentation: no build, run or usage exampleruntime/JavaScript/README.md:1

What to do

  1. Resolve the 1 Documentation finding(s) in Documentation Quality — start with README.md. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d19_recommendation.md · top locations in Appendix A, every location in findings.md.

D21 · Naming Consistency7.1 / 10Strong✓ Tool-verified

What it measures: Whether names — types, methods, variables — are clear and consistent.

Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.

Maturity: Documented → Verified → Prevented · effective 7.1 / 10 · rule-coverage 100% · ceiling Verified

1 naming inconsistencies among 35 declarations measured against a convention their peers follow.

`InitERROR` spells `ERROR` where 44 names in the project spell it `Error`runtime/CSharp/src/Atn/ATNSimulator.cs:22

What to do

  1. Resolve the 1 `InitERROR` spells `ERROR` where 44 names in the project spell it… finding(s) in Naming Consistency — start with ATNSimulator.cs. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d21_recommendation.md · top locations in Appendix A, every location in findings.md.

D24 · Comment Value9.1 8.8 / 10Strong✓ Tool-verified

What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).

Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.

Maturity: Documented → Verified → Prevented · effective 8.8 / 10 · rule-coverage 97% · ceiling Documented

6 of 629 judged comments only repeat the code they sit on (1.0 %). 30 comment(s) in another language or script were not judged.

redundant comment · ×6runtime/CSharp/src/DefaultErrorStrategy.cs:559
doc comments repeat the names · ×2runtime/CSharp/src/Atn/ATNDeserializer.cs:467

What to do

  1. Resolve the 6 redundant comment finding(s) in Comment Value — start with DefaultErrorStrategy.cs (2), DefaultErrorStrategy.js (2), BufferedTokenStream.js. — One of this dimension's main actionable groups (6 recommendation-level).

Detailed fixes: d24_recommendation.md · top locations in Appendix A, every location in findings.md.

D28 · Secrets (history)7.0 / 10Adequategated by 3 critical findings✓ Tool-verified

What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.

Method: REDACTED scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.

Maturity: Documented → Verified → Prevented · effective 7.0 / 10 · rule-coverage 100% · ceiling Documented

3 finding(s): 0 critical, 3 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 2 REDACTED finding(s) in Secrets (history) — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
  2. Resolve the 1 High secret finding(s) in Secrets (history) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  3. Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.

D29 · Static Analysis (SAST)5.0 / 10Adequate✓ Tool-verified

What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.

Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.

Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).

Maturity: Documented → Verified → Prevented · effective 5.0 / 10 · rule-coverage 100% · ceiling Documented

29 finding(s): 0 critical, 19 high, 10 medium, 0 low. 18 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 6 file(s) — `runtime/Cpp/runtime/src/DefaultErrorStrategy.h` (line 24, line 28, line 40, …), `runtime/Cpp/runtime/src/Parser.h` (line 26, line 29, line 32, …), `runtime/Cpp/runtime/src/Vocabulary.h` (line 19, line 174), `runtime/Cpp/runtime/src/atn/ATNConfig.h` (lines 31–34, line 95, line 96, …), `runtime/Cpp/runtime/src/atn/ArrayPredictionContext.h` (line 20, lines 36–38, line 50), … (+1 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 1 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

+ 2 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 6 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (6). — One of this dimension's main actionable groups (6 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  3. No action in Static Analysis (SAST) — all 18 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (18 issue-level, 0 of them charged here).

Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.

D30 · Dependency Vulnerabilities1.8 / 10Critical✓ Tool-verified

What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.

Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

Maturity: Documented → Verified → Prevented · effective 1.8 / 10 · rule-coverage 100% · ceiling Documented

19 finding(s): 0 critical, 11 high, 7 medium, 1 low.

REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 10 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (9), REDACTED. — One of this dimension's main actionable groups (10 issue-level).
  2. Resolve the 7 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (6), REDACTED. — One of this dimension's main actionable groups (7 warning-level).
  3. Resolve the 1 High vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).

Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.

D31 · IaC & Container Security8.9 / 10Adequategated by 2 critical findings✓ Tool-verified

What it measures: Whether Dockerfiles / Terraform / Kubernetes config follow security best practices.

Method: IaC/container misconfiguration scan via trivy config (REDACTED/Terraform/K8s/Helm/CloudFormation); severity rules to 0-10 moderate normalizer. NotApplicable without manifests. Exhaustive, deterministic.

Maturity: Documented → Verified → Prevented · effective 8.9 / 10 · rule-coverage 100% · ceiling Documented

6 finding(s): 0 critical, 2 high, 4 medium, 0 low.

REDACTED
REDACTED

What to do

  1. Resolve the 2 High IaC finding(s) in IaC & Container Security — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
  2. Resolve the 4 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (4). — One of this dimension's main actionable groups (4 warning-level).

Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.

D34 · Knowledge Freshness1.0 / 10Critical✓ Tool-verified

What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.

Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.

Maturity: Documented → Verified → Prevented · effective 1.0 / 10 · rule-coverage 100% · ceiling Documented

86 of 96 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is runtime/CSharp/src/Parser.cs. Counted over 96 of the 179 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned file · ×83runtime/CSharp/src/Misc/IntervalSet.cs:1
Most significant orphaned file · ×3runtime/CSharp/src/Parser.cs:1
Concentrated knowledge decay

What to do

  1. Resolve the 83 Orphaned file finding(s) in Knowledge Freshness — start with IntervalSet.cs, TokenStreamRewriter.cs, ParseTreePatternMatcher.cs. — One of this dimension's main actionable groups (83 recommendation-level).
  2. Resolve the 3 Most significant orphaned file finding(s) in Knowledge Freshness — start with Parser.cs, DefaultErrorStrategy.cs, PredictionMode.cs. — One of this dimension's main actionable groups (3 recommendation-level).
  3. Resolve the 1 Concentrated knowledge decay finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.

D35 · Change Coupling10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.

Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No strong hidden change-coupling between production files.

✓ On the Gold path — maintain.

Detailed fixes: d35_recommendation.md.

D43 · Malicious Dependencies10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No dependency in any ecosystem this repository declares is published as malicious.

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life6.0 / 10Adequate✓ Tool-verified

What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.

Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.

Maturity: Documented → Verified → Prevented · effective 6.0 / 10 · rule-coverage 100% · ceiling Documented

1 end-of-life runtime(s) and 0 end-of-life framework(s), read from 4 platform declaration(s) and 35 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.

End-of-life runtime: .NET net5.0 · ×2runtime/CSharp/tests/issue-2693/Test.csproj:4

What to do

  1. Resolve the 2 End-of-life runtime finding(s) in Platform End-of-Life — start with Test.csproj (2). — One of this dimension's main actionable groups (2 warning-level).

Detailed fixes: d44_recommendation.md · top locations in Appendix A, every location in findings.md.

Frontend & cross-cutting dimensions

R = React/JS · M = Maturity · P = Readiness.

AX10 · Code composition10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does.

Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.

Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.

AX2 · Stateful singletons1.0 / 10Critical✓ Tool-verified

Other · Architecture — Whether singleton services avoid mutable shared instance state that concurrent callers would race on.

Method: Roslyn scan: singleton field mutations unguarded by lock or Interlocked, per type; syntax-based guard detection. Deterministic, traceable per field.

  • `ParserRuleContext` keeps one instance of itself in the static `EMPTY`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_start, _stop, children; e.g. `_start` at line 136). — runtime/CSharp/src/ParserRuleContext.cs:35
  • `ATNDeserializationOptions` keeps one instance of itself in the static `defaultOptions`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (readOnly, verifyATN, generateRuleBypassTransitions, optimize; e.g. `readOnly` at line 63). — runtime/CSharp/src/Atn/ATNDeserializationOptions.cs:12
  • `TerminalNodeImpl` is not registered, but the singleton `ParserRuleContext` creates it and keeps it in `children`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_parent; e.g. `_parent` at line 46). — runtime/CSharp/src/Tree/TerminalNodeImpl.cs:9
  • `ATNConfigSet` is not registered, but the singleton `DFAState` creates it and keeps it in `configSet`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (hasSemanticContext, dipsIntoOuterContext, cachedHashCode, readOnly, configLookup; e.g. `hasSemanticContext` at line 100). — runtime/CSharp/src/Atn/ATNConfigSet.cs:14

What to do

  • Keep singletons stateless or back their state with thread-safe types (Concurrent*/Immutable*); otherwise concurrent callers race.
AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).

Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.

  • The namespaces Antlr4.Runtime ↔ Antlr4.Runtime.Atn ↔ Antlr4.Runtime.Dfa ↔ Antlr4.Runtime.Misc ↔ Antlr4.Runtime.Tree ↔ Antlr4.Runtime.Tree.Pattern depend on each other. The lightest dependency in the cycle is Antlr4.Runtime → Antlr4.Runtime.Tree.Pattern (Antlr4.Runtime.Parser → Antlr4.Runtime.Tree.Pattern.ParseTreePattern, 1 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface. — runtime/CSharp/src/Parser.cs:14

What to do

  • Break namespace cycles inside a project by moving the shared type to a namespace both sides can use, or by inverting the back edge behind an interface.
AX4 · Dependency direction10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.

Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.

AX5 · Architecture & structure10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.

Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.

AX6 · Interface segregation9.9 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').

Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.

  • `ATNFactory` declares 26 abstract methods: `action`, `action`, `alt`, `block`, `charSetLiteral`, `createATN`, `epsilon`, `label`, `lexerAltCommands`, `lexerCallCommand`, `lexerCommand`, `listLabel`, `newState`, `optional`, `plus`, `range`, `rule`, `ruleRef`, `sempred`, `set`, `setCurrentOuterAlt`, `setCurrentRuleName`, `star`, `stringLiteral`, `tokenRef`, `wildcard`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. Those 26 declarations carry 25 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 25 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — tool/src/org/antlr/v4/automata/ATNFactory.java:19
  • `OutputModelFactory` declares 35 abstract methods: `action`, `alternative`, `epsilon`, `finishAlternative`, `getChoiceBlock`, `getCodeBlockLevel`, `getComplexChoiceBlock`, `getComplexEBNFBlock`, `getController`, `getCurrentBlock`, `getCurrentOuterMostAlt`, `getCurrentOuterMostAlternativeBlock`, `getCurrentRuleFunction`, `getEBNFBlock`, `getGenerator`, `getGrammar`, `getLL1ChoiceBlock`, `getLL1EBNFBlock`, `getLL1Test`, `getRoot`, `getTreeLevel`, `lexer`, `lexerFile`, `needsImplicitLabel`, `parser`, `parserFile`, `rule`, `rulePostamble`, `ruleRef`, `sempred`, `set`, `setController`, `stringRef`, `tokenRef`, `wildcard`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — tool/src/org/antlr/v4/codegen/OutputModelFactory.java:31

What to do

  • Split fat interfaces into focused role-interfaces so clients depend only on what they use.
AX9 · CQS / query purity10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.

Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.

Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.

GD1 · Unfinished & placeholder code10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Unreviewed-generation residue: shipped members still throwing NotImplementedException, and placeholder string literals left in non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.

Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.

M1 · Documentation (README)8.7 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.

Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.

What to do

  • Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
M2 · Architecture documentation5.0 / 10Adequate✓ Tool-verified

Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.

Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.

  • No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.

What to do

  • Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.

Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.

M4 · Documentation accuracy8.0 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.

Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.

  • doc/javascript-target.md names Node.js 14, but the repository declares engines `>=16`. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — doc/javascript-target.md:18

What to do

  • Reconcile the README with reality: doc/javascript-target.md names Node.js 14, but the repository declares engines `>=16`.
P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether an automated pipeline builds and tests every change.

Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.

P10 · Library API & versioning9.9 / 10Exemplary✓ Tool-verified

Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.

Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.

  • 2 public types in `Antlr4.Runtime.Tree` are marked as implementation by their own namespace, folder or name: `ErrorNodeImpl` (runtime/CSharp/src/Tree/ErrorNodeImpl.cs:22, name ends in `Impl`), `TerminalNodeImpl` (runtime/CSharp/src/Tree/TerminalNodeImpl.cs:9, name ends in `Impl`). While they are public, every consumer of the library can bind to them, so changing them is a breaking change for those consumers. — runtime/CSharp/src/Tree/ErrorNodeImpl.cs:22

What to do

  • Hide `Antlr4.Runtime.Tree` (`ErrorNodeImpl`, `TerminalNodeImpl`) (C#: `internal`, with `[InternalsVisibleTo]` for the sibling assemblies and tests that need them): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
P3 · Security & performance tooling0.0 / 10Critical✓ Tool-verified

Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).

Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.

  • No static application security testing detected. For this repository's stack, add spotbugs with find-sec-bugs (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 1 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner. — REDACTED:10
  • `runtime/CSharp/tests/issue-2693/Test.csproj` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — runtime/CSharp/tests/issue-2693/Test.csproj:18

What to do

  • Add a SAST step to CI running what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
  • Enable Dependabot/Renovate or a dependency-review gate.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback5.0 / 10Adequate✓ Tool-verified

Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.

Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.

What to do

  • Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
P6 · Release Hygiene8.0 / 10Strong✓ Tool-verified

Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.

Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.

  • The changelog this check read carries 1 versioned entry, against a bar of 3. Counted as either the distinct `x.y.z` versions it names (a link's target is not counted) or its version-shaped section headings (`## [1.2.0]`, `## V14.x.x`, `## Updates in 8.0.x`), whichever is the larger — so a log sectioned by minor series counts its sections, not its individual patch numbers. Entries recorded somewhere this check does not read — release notes generated at tag time from a generator config it did not recognise, or a log kept outside the repository — are not counted here, and this row is about what is re-findable in the tree rather than about how often you release.

What to do

  • Keep the changelog current — add a versioned entry (Keep-a-Changelog ## [x.y.z]) for each release so the history isn't a stub.
PF3 · Async & latency hygiene10.0 / 10Exemplary✓ Tool-verified

Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.

Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

R1 · Type Safety0.1 / 10Critical✓ Tool-verified

React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.

Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.

  • 2 typed · 146 plain JS — the untyped files are runtime/JavaScript/spec/BitSetSpec.js, runtime/JavaScript/spec/HashMapSpec.js, runtime/JavaScript/spec/HashSetSpec.js, runtime/JavaScript/spec/IntervalSetSpec.js, runtime/JavaScript/spec/helpers/Reporter.js, runtime/JavaScript/spec/imports/NodeCommonJSImportSpec.cjs (+140 more).
R10 · Code Duplication9.0 / 10Exemplary✓ Tool-verified

React / JS · Code Health — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.

Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Deterministic.

  • runtime/JavaScript/src/antlr4/misc/HashMap.js:8 · runtime/JavaScript/src/antlr4/misc/HashSet.js:9 — the two spans are one implementation copied and then locally edited — 327 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — runtime/JavaScript/src/antlr4/misc/HashMap.js:8
  • runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:1423 · runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:1458 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:1423
  • runtime/JavaScript/src/antlr4/action/LexerChannelAction.js:14 · runtime/JavaScript/src/antlr4/action/LexerTypeAction.js:13 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — runtime/JavaScript/src/antlr4/action/LexerChannelAction.js:14
  • runtime/JavaScript/src/antlr4/action/LexerModeAction.js:12 · runtime/JavaScript/src/antlr4/action/LexerPushModeAction.js:12 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — runtime/JavaScript/src/antlr4/action/LexerModeAction.js:12
  • runtime/JavaScript/src/antlr4/atn/SemanticContext.js:94 · runtime/JavaScript/src/antlr4/atn/SemanticContext.js:197 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — runtime/JavaScript/src/antlr4/atn/SemanticContext.js:94
  • runtime/JavaScript/src/antlr4/atn/SemanticContext.js:129 · runtime/JavaScript/src/antlr4/atn/SemanticContext.js:230 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — runtime/JavaScript/src/antlr4/atn/SemanticContext.js:129
  • runtime/JavaScript/src/antlr4/Recognizer.js:97 · runtime/JavaScript/src/antlr4/error/DefaultErrorStrategy.js:542 — the two spans are one implementation copied and then locally edited — 73 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — runtime/JavaScript/src/antlr4/Recognizer.js:97
  • runtime/JavaScript/src/antlr4/atn/PrecedencePredicate.js:27 · runtime/JavaScript/src/antlr4/atn/Predicate.js:18 — the two spans are one implementation copied and then locally edited — 63 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — runtime/JavaScript/src/antlr4/atn/PrecedencePredicate.js:27
  • runtime/JavaScript/src/antlr4/BufferedTokenStream.js:276 · runtime/JavaScript/src/antlr4/BufferedTokenStream.js:297 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — runtime/JavaScript/src/antlr4/BufferedTokenStream.js:276
  • runtime/JavaScript/src/antlr4/Parser.js:98 · runtime/JavaScript/src/antlr4/Parser.js:132 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — runtime/JavaScript/src/antlr4/Parser.js:98
  • runtime/JavaScript/src/antlr4/TokenStreamRewriter.js:217 · runtime/JavaScript/src/antlr4/TokenStreamRewriter.js:265 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — runtime/JavaScript/src/antlr4/TokenStreamRewriter.js:217
  • runtime/JavaScript/src/antlr4/misc/IntervalSet.js:186 · runtime/JavaScript/src/antlr4/misc/IntervalSet.js:207 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — runtime/JavaScript/src/antlr4/misc/IntervalSet.js:186
  • runtime/JavaScript/src/antlr4/transition/ActionTransition.js:8 · runtime/JavaScript/src/antlr4/transition/PredicateTransition.js:10 — the two spans are one implementation copied and then locally edited — 55 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — runtime/JavaScript/src/antlr4/transition/ActionTransition.js:8
  • runtime/JavaScript/src/antlr4/BufferedTokenStream.js:160 · runtime/JavaScript/src/antlr4/BufferedTokenStream.js:361 — the two spans are one implementation copied and then locally edited — 71 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — runtime/JavaScript/src/antlr4/BufferedTokenStream.js:160
  • runtime/JavaScript/src/antlr4/Parser.js:508 · runtime/JavaScript/src/antlr4/atn/ATN.js:132 — the two spans are one implementation copied and then locally edited — 90 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — runtime/JavaScript/src/antlr4/Parser.js:508
  • runtime/JavaScript/src/antlr4/atn/ATNConfig.js:84 · runtime/JavaScript/src/antlr4/atn/ATNConfig.js:109 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — runtime/JavaScript/src/antlr4/atn/ATNConfig.js:84
  • runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:1698 · runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:1709 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:1698
  • runtime/JavaScript/src/antlr4/atn/PredictionMode.js:436 · runtime/JavaScript/src/antlr4/atn/PredictionMode.js:543 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — runtime/JavaScript/src/antlr4/atn/PredictionMode.js:436
  • runtime/JavaScript/src/antlr4/atn/SemanticContext.js:162 · runtime/JavaScript/src/antlr4/atn/SemanticContext.js:261 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — runtime/JavaScript/src/antlr4/atn/SemanticContext.js:162
  • runtime/JavaScript/src/antlr4/context/ParserRuleContext.js:156 · runtime/JavaScript/src/antlr4/context/ParserRuleContext.js:177 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — runtime/JavaScript/src/antlr4/context/ParserRuleContext.js:156
  • runtime/JavaScript/src/antlr4/action/LexerChannelAction.js:29 · runtime/JavaScript/src/antlr4/action/LexerCustomAction.js:44 · runtime/JavaScript/src/antlr4/action/LexerIndexedCustomAction.js:48 · runtime/JavaScript/src/antlr4/action/LexerModeAction.js:27 · +3 more site(s) not listed — the 7 copies are spread across 7 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — runtime/JavaScript/src/antlr4/action/LexerChannelAction.js:29
  • runtime/JavaScript/src/antlr4/atn/SemanticContext.js:189 · runtime/JavaScript/src/antlr4/atn/SemanticContext.js:288 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — runtime/JavaScript/src/antlr4/atn/SemanticContext.js:189
  • runtime/JavaScript/src/antlr4/error/ErrorListener.js:12 · runtime/JavaScript/src/antlr4/error/ProxyErrorListener.js:17 — the two spans are one implementation copied and then locally edited — 65 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — runtime/JavaScript/src/antlr4/error/ErrorListener.js:12
  • runtime/JavaScript/src/antlr4/atn/LexerATNSimulator.js:289 · runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:735 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — runtime/JavaScript/src/antlr4/atn/LexerATNSimulator.js:289
  • runtime/JavaScript/src/antlr4/utils/stringHashCode.js:34 · runtime/JavaScript/src/antlr4/utils/stringHashCode.js:55 — the two spans are one implementation copied and then locally edited — 119 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — runtime/JavaScript/src/antlr4/utils/stringHashCode.js:34

What to do

  • Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
R2 · Cyclomatic Complexity6.5 / 10Adequate✓ Tool-verified

React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.

Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.

  • reduceToSingleOperationPerIndex has cyclomatic complexity 31 and cognitive complexity 58; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — runtime/JavaScript/src/antlr4/TokenStreamRewriter.js:215
  • mergeArrays has cyclomatic complexity 30 and cognitive complexity 50; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — runtime/JavaScript/src/antlr4/context/PredictionContextUtils.js:131
  • computeReachSet has cyclomatic complexity 26 and cognitive complexity 45; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:698
  • execATN has cyclomatic complexity 22 and cognitive complexity 54; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:395
  • _LOOK has cyclomatic complexity 22 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — runtime/JavaScript/src/antlr4/atn/LL1Analyzer.js:113
  • canDropLoopEntryEdgeInLeftRecursiveRule has cyclomatic complexity 19 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:1316
  • closure has cyclomatic complexity 18 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — runtime/JavaScript/src/antlr4/atn/LexerATNSimulator.js:354
  • mergeSingletons has cyclomatic complexity 18 and cognitive complexity 32; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — runtime/JavaScript/src/antlr4/context/PredictionContextUtils.js:292
  • closure_ has cyclomatic complexity 17 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:1260
  • readEdges has cyclomatic complexity 17 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — runtime/JavaScript/src/antlr4/atn/ATNDeserializer.js:242
  • verifyATN has cyclomatic complexity 17 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — runtime/JavaScript/src/antlr4/atn/ATNDeserializer.js:463
  • getEpsilonTarget has cyclomatic complexity 15 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — runtime/JavaScript/src/antlr4/atn/LexerATNSimulator.js:409
  • execATNWithFullContext has cyclomatic complexity 14 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:589
  • getText has cyclomatic complexity 14 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — runtime/JavaScript/src/antlr4/TokenStreamRewriter.js:144
  • nextToken has cyclomatic complexity 13 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — runtime/JavaScript/src/antlr4/Lexer.js:91
  • getCachedPredictionContext has cyclomatic complexity 13 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — runtime/JavaScript/src/antlr4/context/PredictionContextUtils.js:33
  • toString has cyclomatic complexity 12 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — runtime/JavaScript/src/antlr4/context/RuleContext.js:135
  • sync has cyclomatic complexity 12 and cognitive complexity 9; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — runtime/JavaScript/src/antlr4/error/DefaultErrorStrategy.js:197
  • closureCheckingStopState has cyclomatic complexity 11 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:1211
  • applyPrecedenceFilter has cyclomatic complexity 11 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:946
  • getNodeText has cyclomatic complexity 11 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — runtime/JavaScript/src/antlr4/tree/Trees.js:44
  • readStates has cyclomatic complexity 11 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — runtime/JavaScript/src/antlr4/atn/ATNDeserializer.js:136
  • removeRange has cyclomatic complexity 11 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — runtime/JavaScript/src/antlr4/misc/IntervalSet.js:105
  • getText has cyclomatic complexity 11 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — runtime/JavaScript/src/antlr4/BufferedTokenStream.js:347
R3 · Large Files7.6 / 10Strong✓ Tool-verified

React / JS · Code Health — How many source files exceed the large-file threshold.

Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.

  • runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js has 1656 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:1
  • runtime/JavaScript/src/antlr4/error/DefaultErrorStrategy.js has 669 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — runtime/JavaScript/src/antlr4/error/DefaultErrorStrategy.js:1
  • runtime/JavaScript/src/antlr4/atn/LexerATNSimulator.js has 600 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — runtime/JavaScript/src/antlr4/atn/LexerATNSimulator.js:1
  • runtime/JavaScript/src/antlr4/Parser.js has 590 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — runtime/JavaScript/src/antlr4/Parser.js:1
  • runtime/JavaScript/src/antlr4/atn/ATNDeserializer.js has 556 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — runtime/JavaScript/src/antlr4/atn/ATNDeserializer.js:1
  • runtime/JavaScript/spec/rewriter/TokenStreamRewriterSpec.js has 549 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — runtime/JavaScript/spec/rewriter/TokenStreamRewriterSpec.js:1
  • runtime/JavaScript/src/antlr4/atn/PredictionMode.js has 544 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — runtime/JavaScript/src/antlr4/atn/PredictionMode.js:1
  • runtime/JavaScript/src/antlr4/context/PredictionContextUtils.js has 431 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — runtime/JavaScript/src/antlr4/context/PredictionContextUtils.js:1
  • runtime/JavaScript/src/antlr4/TokenStreamRewriter.js has 405 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — runtime/JavaScript/src/antlr4/TokenStreamRewriter.js:1

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R4 · Test Coverage9.8 / 10Exemplary✓ Tool-verified

React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.

Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.

  • No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×3) — runtime/JavaScript/src/antlr4/context/InterpreterRuleContext.js:1, runtime/JavaScript/src/antlr4/utils/titleCase.js:1, runtime/JavaScript/src/antlr4/TokenSource.js:1

What to do

  • Add tests that import the unreached modules (directly or through their public entry).
R5 · Dependency Freshness8.6 / 10Strong✓ Tool-verified

React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).

Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.

R6 · Tooling10.0 / 10Exemplary✓ Tool-verified

React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.

Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.

R7 · Dead Code9.9 / 10Exemplary✓ Tool-verified

React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).

Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.

  • Unreachable from the 5 application, 66 tooling and 12 test entry point(s) detected in this repo. Gate removals on `npm run build` — an undetected custom entry would make these reachable.
  • no import path from any entry point (5 application, 66 tooling, 12 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×2) — runtime/JavaScript/src/antlr4/context/InterpreterRuleContext.js, runtime/JavaScript/src/antlr4/utils/titleCase.js
  • Nothing imports this binding — it is safe to review for removal. — runtime/JavaScript/src/antlr4/TokenSource.js:5

What to do

  • Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
R8 · Dependency Hygiene8.5 / 10Strong✓ Tool-verified

React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.

Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.

  • Declared in runtime/JavaScript/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. (×3)

What to do

  • Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
R9 · Circular Imports10.0 / 10Exemplary✓ Tool-verified

React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.

Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.

X20 · Mistyped argument guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether an argument guard throws the exception its own condition describes — a guard that rejects a value for being EMPTY and reports it as `ArgumentNullException` tells the caller a parameter was null when it provably was not.

Method: Roslyn syntax: `throw new ArgumentNullException(nameof(p))` statements controlled by an `if`, whose condition is read for a test that is true of a NON-null `p` — an emptiness test that dereferences it (`p.Count == 0`, `!p.Any()`) or a BCL predicate documented true of the empty value (`string.IsNullOrEmpty(p)`). Deterministic, provable per finding. Advisory.

Reference — by lens

The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.

LensScoreRatingImpact
Code Health55%Adequate — gated by R1Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture75%Adequate — gated by AX2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity71%Adequate — gated by D34Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness55%Adequate — gated by P3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security67%AdequateAcceptable, with room to improve.
Performance100%ExemplaryStrongest area.
Unscored — 3 check(s) recorded observations but carry no score

These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.

  • SC1 Supply-chain hygiene — 3 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X10 Duplicated predicate — 11 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 control(s) we could not find positive evidence for

These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.

  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 74 check(s) not relevant to this codebase

These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.

  • AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
  • AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
  • AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
  • AX1 Captive dependencies — no DI registrations detected
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — docker build failed (exit 1) — /sh -c apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install maven git -y && git clone https://github.com/antlr/antlr4.git && cd antlr4 && git checkout $ANTLR_VERSION && mvn clean --projects tool --also-make && mvn -DskipTests install --projects tool --also-make && mv ./tool/target/antlr4-*-complete.jar antlr4-tool.jar" did not complete successfully: exit code: 1; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • C1 Data Protection — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • C2 Access Controls — No access-control surface detected in the analyzed source — no web/app surface to authorize (no HTTP API or web-UI project) and no authorization code at all (no [Authorize]/policies, no imperative guard methods). Access control is therefore N/A here — this is a library/CLI, which is authorized by its CALLER, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
  • C3 Audit Trail — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • C4 Data Retention — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • C5 Data-Subject Rights — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • D11 Test Reliability — Test reliability not measured — JavaScript/TypeScript suite did not run
  • D12 Dependency Hygiene — Dependency hygiene not measured
  • D18 Solution Shape — Dimension evaluation failed
  • D20 ADR Quality — N/A — ADRs are expected on deployable products with a user-facing host, not consumed libraries; no ADR log is required here.
  • D22 Internal API Consistency — API consistency is measured on C# only; the exposed Swift surface was not measured.
  • D23 Boundary Type-Coupling — single shared-core project — no cross-context coupling to assess
  • D25 ADR Conformance — no ADRs to check
  • D26 Project Cohesion — D26 could not read how the parts of this repository's one project reference each other, so its cohesion was not measured. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D27 Navigability — D27 reads resolved call sites in the languages it reads only — this repository's production source is .cpp, .dart, .go, .py, .swift, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D32 Data Compliance (PII/GDPR) — 1 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D36 Supply-chain Provenance & Signing — The CI pipeline publishes no artifact — no package publish, container push or release with files to download. Supply-chain provenance, signing and an SBOM describe a PUBLISHED artifact for the people who obtain it, so there is nothing to attest here; a deployment of the service itself publishes nothing for anyone else to verify. Add them to the release pipeline when this repo starts publishing artifacts (a package, a container image, or a release with downloadable files). Build integrity and workflow-token hygiene are reported below: they describe what the CI runs and the token it runs with, neither of which is affected by whether the pipeline ships an artifact.
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D7 Architectural Integrity — no checkable ADRs and no dependency cycles — architectural integrity not assessed
  • D8 Code Coverage — Coverage NOT MEASURED: the .NET half could not be measured — the repository wires up no coverage collector for `--collect:"XPlat Code Coverage"` to use; the JavaScript/TypeScript half could not be measured — runtime/JavaScript/ runs jasmine, which the coverage collector does not drive yet, so no lcov was produced — a gap in the analyzer, not something this repository is missing. This repository's production source spans both ecosystems, and no partial figure is published as if it were the whole: coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan.
  • DM1 Domain Modelling — applicable but not scored (1 of 2 signals for this style — below the bar we score at): 30 value object(s)
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, which this analysis does not build from source alone for this language. Reported as guidance rather than measured
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • IC1 Incompleteness & stubs — IC1 reached only 16% of this repository's production lines — java (46,232 lines), swift (20,582 lines), dart (15,847 lines), go (13,163 lines), cpp (12,752 lines), c (12,679 lines), javascript (11,924 lines), python (10,632 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P2 Observability — This repo is a library, not a deployed service — it has no process to operate, so production observability (structured logging, tracing/metrics, health checks) is N/A. A library may log via an injected ILogger, but the absence of operational telemetry is not a defect here. If it grows a host (web API, worker), the dimension reactivates.
  • P7 Outbound HTTP resilience — not applicable — this isn't a service/API/worker
  • P8 Schema migrations — no EF Core usage detected
  • P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found by the two searches this check runs — a BenchmarkDotNet package reference in any project file (loaded, or on disk), and a script whose name contains `benchmark` that this repository's CI runs. Neither can see a suite in another ecosystem's idiom, so this is not a verdict that the repository has none. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted, and nothing is asked of a repository that has none.
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
  • S1 Web-Security Posture — No web surface detected in the analyzed source — no HTTP API or web-UI project (no controllers/minimal-API endpoints, no Razor/Blazor views) and no web middleware (HTTPS redirection, HSTS, security headers, cookies). Transport security, security headers, secure cookies, CSRF/input-validation and middleware-order controls are therefore N/A here — this is a library/CLI/worker, not a web app. Crypto hygiene was still checked and found nothing to flag. If this codebase becomes web-facing, the dimension reactivates automatically.
  • X1 Async correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X12 Unreachable branch — X12 reached only 16% of this repository's production lines — java (46,232 lines), swift (20,582 lines), dart (15,847 lines), go (13,163 lines), cpp (12,752 lines), c (12,679 lines), javascript (11,924 lines), python (10,632 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X16 Unfloored truncation loop — X16 reached only 16% of this repository's production lines — java (46,232 lines), swift (20,582 lines), dart (15,847 lines), go (13,163 lines), cpp (12,752 lines), c (12,679 lines), javascript (11,924 lines), python (10,632 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X2 Cancellation propagation — no async method does work a token could cancel
  • X21 Side-effecting pattern guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X25 Inert configuration knob — X25 reached only 16% of this repository's production lines — java (46,232 lines), swift (20,582 lines), dart (15,847 lines), go (13,163 lines), cpp (12,752 lines), c (12,679 lines), javascript (11,924 lines), python (10,632 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X27 Collection changed while being enumerated — X27 reached only 16% of this repository's production lines — java (46,232 lines), swift (20,582 lines), dart (15,847 lines), go (13,163 lines), cpp (12,752 lines), c (12,679 lines), javascript (11,924 lines), python (10,632 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X28 Index access outside its own emptiness guard — X28 reached only 16% of this repository's production lines — java (46,232 lines), swift (20,582 lines), dart (15,847 lines), go (13,163 lines), cpp (12,752 lines), c (12,679 lines), javascript (11,924 lines), python (10,632 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X29 Per-element action decided by a fixed element — X29 reached only 16% of this repository's production lines — java (46,232 lines), swift (20,582 lines), dart (15,847 lines), go (13,163 lines), cpp (12,752 lines), c (12,679 lines), javascript (11,924 lines), python (10,632 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X3 Exception handling — X3 reached only 16% of this repository's production lines — java (46,232 lines), swift (20,582 lines), dart (15,847 lines), go (13,163 lines), cpp (12,752 lines), c (12,679 lines), javascript (11,924 lines), python (10,632 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X30 Support guard that admits what it rejects — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X32 Type resolved by simple name across every loaded assembly — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X4 Structured logging — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X5 Nullable reference types — no NRT-eligible projects
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.

Critical — 51 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D17 · Explicit Debt · NoWarnInCsproj · ×11
  • NoWarnInCsproj runtime/CSharp/src/Antlr4.csproj:8 — CS1591 — this project generates an XML documentation file as a build output, so its documentation is something it PUBLISHES to whoever consumes the assembly, and this entry switches off a rule whose only job is to report that documentation missing or malformed. The two decisions sit in the same file and the quiet one wins: the documentation this project ships has holes exactly where the rule would have pointed, no build says so, and the people who meet the gap are downstream — in their editor, at the moment they are trying to use the member. Write the documentation the rule is asking for and drop the code from the list; where only some elements genuinely cannot carry it, narrow the suppression to those sites and give each one its reason, so the rest of the API stays covered. If the documentation was never meant to be consumed, the honest fix is the other line — stop generating the file, so the project no longer publishes something it is choosing not to check.
  • NoWarnInCsproj runtime/CSharp/src/Antlr4.csproj:8 — CS1574 — this project generates an XML documentation file as a build output, so its documentation is something it PUBLISHES to whoever consumes the assembly, and this entry switches off a rule whose only job is to report that documentation missing or malformed. The two decisions sit in the same file and the quiet one wins: the documentation this project ships has holes exactly where the rule would have pointed, no build says so, and the people who meet the gap are downstream — in their editor, at the moment they are trying to use the member. Write the documentation the rule is asking for and drop the code from the list; where only some elements genuinely cannot carry it, narrow the suppression to those sites and give each one its reason, so the rest of the API stays covered. If the documentation was never meant to be consumed, the honest fix is the other line — stop generating the file, so the project no longer publishes something it is choosing not to check.
  • NoWarnInCsproj runtime/CSharp/src/Antlr4.csproj:8 — CS1580 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
  • NoWarnInCsproj runtime/CSharp/src/Antlr4.csproj:8 — CS1570 — this project generates an XML documentation file as a build output, so its documentation is something it PUBLISHES to whoever consumes the assembly, and this entry switches off a rule whose only job is to report that documentation missing or malformed. The two decisions sit in the same file and the quiet one wins: the documentation this project ships has holes exactly where the rule would have pointed, no build says so, and the people who meet the gap are downstream — in their editor, at the moment they are trying to use the member. Write the documentation the rule is asking for and drop the code from the list; where only some elements genuinely cannot carry it, narrow the suppression to those sites and give each one its reason, so the rest of the API stays covered. If the documentation was never meant to be consumed, the honest fix is the other line — stop generating the file, so the project no longer publishes something it is choosing not to check.
  • NoWarnInCsproj runtime/CSharp/src/Antlr4.csproj:8 — NU5048 — this warning is switched off for the WHOLE project, including builds years from now. It is raised by the build itself — the packaging, restore or SDK step — about the project as a whole, not by the compiler or an analyzer at a line of code, so there is no call site to narrow it to and no per-site directive that could carry a reason: this element is the only place the decision can be recorded. Say WHY here, in a comment on the entry, or fix what the rule is reporting and drop the code from the list.
  • NoWarnInCsproj runtime/CSharp/tests/issue-2693/Test.csproj:25 — 1701 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
  • NoWarnInCsproj runtime/CSharp/tests/issue-3079/Test.csproj:25 — 1701 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
  • NoWarnInCsproj runtime/CSharp/tests/issue-2693/Test.csproj:25 — 1702 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
  • NoWarnInCsproj runtime/CSharp/tests/issue-3079/Test.csproj:25 — 1702 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
  • NoWarnInCsproj runtime/CSharp/tests/issue-2693/Test.csproj:25 — 3021 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
  • NoWarnInCsproj runtime/CSharp/tests/issue-3079/Test.csproj:25 — 3021 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
D30 · Dependency Vulnerabilities · High CVE · ×10
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D17 · Explicit Debt · FileScopedPragmaDisable · ×3
  • FileScopedPragmaDisable runtime/CSharp/src/Atn/ArrayPredictionContext.cs:13 — #pragma warning disable 0659 // 'class' overrides Object.Equals(object o) but does not override Object.GetHashCode() — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
  • FileScopedPragmaDisable runtime/CSharp/src/Atn/EmptyPredictionContext.cs:12 — #pragma warning disable 0659 // 'class' overrides Object.Equals(object o) but does not override Object.GetHashCode() — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
  • FileScopedPragmaDisable runtime/CSharp/src/Atn/SingletonPredictionContext.cs:9 — #pragma warning disable 0659 // 'class' overrides Object.Equals(object o) but does not override Object.GetHashCode() — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
D28 · Secrets (history) · REDACTED · ×2
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · High IaC · ×2
  • REDACTED
  • REDACTED
AX3 · Project dependency cycles · Namespace dependency cycle · ×1
  • Namespace dependency cycle runtime/CSharp/src/Parser.cs:14 — The namespaces Antlr4.Runtime ↔ Antlr4.Runtime.Atn ↔ Antlr4.Runtime.Dfa ↔ Antlr4.Runtime.Misc ↔ Antlr4.Runtime.Tree ↔ Antlr4.Runtime.Tree.Pattern depend on each other. The lightest dependency in the cycle is Antlr4.Runtime → Antlr4.Runtime.Tree.Pattern (Antlr4.Runtime.Parser → Antlr4.Runtime.Tree.Pattern.ParseTreePattern, 1 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface.
D13 · REDACTED Scanning · Leaked secret · ×1
  • REDACTED
D28 · Secrets (history) · High secret · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · High vulnerability · ×1
  • REDACTED
Serious — 973 finding(s)
D10 · Test Quality · No assertions · ×116
  • No assertions: processWhenDependencyRemoved antlr4-maven-plugin/src/test/java/org/antlr/mojo/antlr4/Antlr4MojoTest.java:316 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testA tool-testsuite/test/org/antlr/v4/test/tool/TestATNConstruction.java:34 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testAB tool-testsuite/test/org/antlr/v4/test/tool/TestATNConstruction.java:45 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testABorCD tool-testsuite/test/org/antlr/v4/test/tool/TestATNConstruction.java:263 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testAOptional tool-testsuite/test/org/antlr/v4/test/tool/TestATNConstruction.java:326 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testAStar tool-testsuite/test/org/antlr/v4/test/tool/TestATNConstruction.java:473 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testAorB tool-testsuite/test/org/antlr/v4/test/tool/TestATNConstruction.java:57 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testAorBoptional tool-testsuite/test/org/antlr/v4/test/tool/TestATNConstruction.java:339 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testAorBorEmptyPlus tool-testsuite/test/org/antlr/v4/test/tool/TestATNConstruction.java:440 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testAorBplus tool-testsuite/test/org/antlr/v4/test/tool/TestATNConstruction.java:422 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testAorBstar tool-testsuite/test/org/antlr/v4/test/tool/TestATNConstruction.java:512 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testAorBthenC tool-testsuite/test/org/antlr/v4/test/tool/TestATNConstruction.java:368 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testAorEpsilon tool-testsuite/test/org/antlr/v4/test/tool/TestATNConstruction.java:312 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testAplus tool-testsuite/test/org/antlr/v4/test/tool/TestATNConstruction.java:380 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testEmptyOrEmpty tool-testsuite/test/org/antlr/v4/test/tool/TestATNConstruction.java:459 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testFollow tool-testsuite/test/org/antlr/v4/test/tool/TestATNConstruction.java:298 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testForRepeatedTransitionsToStopState tool-testsuite/test/org/antlr/v4/test/tool/TestATNConstruction.java:588 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testNestedAstar tool-testsuite/test/org/antlr/v4/test/tool/TestATNConstruction.java:489 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testPredicatedAorB tool-testsuite/test/org/antlr/v4/test/tool/TestATNConstruction.java:531 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testSetAorB tool-testsuite/test/org/antlr/v4/test/tool/TestATNConstruction.java:72 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testSetAorBoptional tool-testsuite/test/org/antlr/v4/test/tool/TestATNConstruction.java:355 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testStringLiteralInParser tool-testsuite/test/org/antlr/v4/test/tool/TestATNConstruction.java:251 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testbA tool-testsuite/test/org/antlr/v4/test/tool/TestATNConstruction.java:279 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testEmptyActions tool-testsuite/test/org/antlr/v4/test/tool/TestActionTranslation.java:219 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testBadInlineActions tool-testsuite/test/org/antlr/v4/test/tool/TestAttributeChecks.java:221 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • + 91 more in this group — see findings.md.
D3 · God Classes · TooManyMethods · ×38
  • TooManyMethods: Grammar tool/src/org/antlr/v4/tool/Grammar.java:52 — TooManyMethods — 85 methods. The bar is 30 methods; this is 55 over it, 2.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Parser runtime/Java/src/org/antlr/v4/runtime/Parser.java:38 — TooManyMethods — 62 methods. The bar is 30 methods; this is 32 over it, 2.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Parser runtime/Swift/Sources/Antlr4/Parser.swift:28 — TooManyMethods — 60 methods. The bar is 30 methods; this is 30 over it, 2.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: TreeViewer tool/src/org/antlr/v4/gui/TreeViewer.java:53 — TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Parser runtime/Dart/lib/src/parser.dart:24 — TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ParserATNSimulator runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:250 — TooManyMethods — 48 methods. The bar is 30 methods; this is 18 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ParserATNSimulator runtime/Swift/Sources/Antlr4/atn/ParserATNSimulator.swift:238 — TooManyMethods — 47 methods. The bar is 30 methods; this is 17 over it, 1.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: BaseParser runtime/Go/antlr/v4/parser.go:35 — TooManyMethods — 46 methods. The bar is 30 methods; this is 16 over it, 1.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ParserATNSimulator runtime/CSharp/src/Atn/ParserATNSimulator.cs — TooManyMethods — 751 significant lines (blank, comment-only and punctuation-only lines excluded), 45 methods. The bar is 30 methods; this is 15 over it, 1.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ParserATNSimulator runtime/Go/antlr/v4/parser_atn_simulator.go:35 — TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ParserATNFactory tool/src/org/antlr/v4/automata/ParserATNFactory.java:74 — TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ParserATNSimulator runtime/Dart/lib/src/atn/src/parser_atn_simulator.dart:33 — TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Parser runtime/Python3/src/antlr4/Parser.py:47 — TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ParserATNSimulator runtime/Python3/src/antlr4/atn/ParserATNSimulator.py:257 — TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: BasicSemanticChecks tool/src/org/antlr/v4/semantics/BasicSemanticChecks.java:60 — TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ParserATNSimulator runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:261 — TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Lexer runtime/Java/src/org/antlr/v4/runtime/Lexer.java:22 — TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Lexer runtime/Swift/Sources/Antlr4/Lexer.swift:17 — TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Parser runtime/JavaScript/src/antlr4/Parser.js:15 — TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: IntervalSet runtime/Java/src/org/antlr/v4/runtime/misc/IntervalSet.java:32 — TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: BitSet runtime/Swift/Sources/Antlr4/misc/BitSet.swift:44 — TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Tool tool/src/org/antlr/v4/Tool.java:62 — TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: TokenStreamRewriter runtime/Java/src/org/antlr/v4/runtime/TokenStreamRewriter.java:91 — TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: IntervalSet runtime/CSharp/src/Misc/IntervalSet.cs — TooManyMethods — 384 significant lines (blank, comment-only and punctuation-only lines excluded), 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Parser runtime/CSharp/src/Parser.cs — TooManyMethods — 379 significant lines (blank, comment-only and punctuation-only lines excluded), 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • + 13 more in this group — see findings.md.
D17 · Explicit Debt · TodoComment · ×15
  • TodoComment runtime/CSharp/src/Atn/ATNConfigSet.cs:35 — // TODO: these fields make me pretty uncomfortable but nice to pack up info together, saves recomputation — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment runtime/CSharp/src/Atn/ATNConfigSet.cs:36 — // TODO: can we track conflicts as they are added to save scanning configs later? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment runtime/CSharp/src/Atn/ATNDeserializer.cs:804 — // TODO: not yet implemented — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment runtime/CSharp/src/Atn/LexerATNConfig.cs:23 — // TODO — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment runtime/CSharp/src/Atn/LexerATNSimulator.cs:537 — // TODO: if the entry rule is invoked recursively, some — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment runtime/CSharp/src/Atn/ParserATNSimulator.cs:1281 — // // Optimize away p||p and p&&p TODO: optimize() was a no-op — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment runtime/CSharp/src/Atn/ParserATNSimulator.cs:1517 — /* TODO: If we are doing predicates, there is no point in pursuing — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment runtime/CSharp/src/Atn/ParserATNSimulator.cs:1660 — // TODO: can remove? only care when we add to set per middle of this method — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment runtime/CSharp/src/Atn/PredictionContext.cs:330 — // TODO: track whether this is possible above during merge sort for speed — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment runtime/CSharp/src/Atn/ProfilingATNSimulator.cs:144 — // TODO: does not handle delayed errors per getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule() — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment runtime/CSharp/src/Atn/SetTransition.cs:21 — // TODO (sam): should we really allow null here? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment runtime/CSharp/src/Dfa/DFAState.cs:142 — // TODO (sam): what to do when configs==null? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment runtime/CSharp/src/Lexer.cs:634 — // TODO: Do we lose character or line position information? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment runtime/CSharp/src/Parser.cs:973 — // TODO: useful in parser? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment runtime/CSharp/src/Tree/Xpath/XPath.cs:90 — // TODO: check for invalid token/rule names, bad syntax — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×13
  • Edited copy of a member (6 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/atn/ATNConfigSet.java:56 — runtime/Java/src/org/antlr/v4/runtime/atn/ATNConfigSet.java:56-62 | runtime/Java/src/org/antlr/v4/runtime/atn/PredictionMode.java:112-117 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) runtime/Go/antlr/v4/utils.go:233 — runtime/Go/antlr/v4/utils.go:233-242 | runtime/Go/antlr/v4/error_strategy.go:509-514 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) tool/src/org/antlr/v4/codegen/Target.java:465 — tool/src/org/antlr/v4/codegen/Target.java:465-470 | tool/src/org/antlr/v4/codegen/target/CppTarget.java:91-96 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) tool/src/org/antlr/v4/codegen/Target.java:475 — tool/src/org/antlr/v4/codegen/Target.java:475-480 | tool/src/org/antlr/v4/codegen/target/CppTarget.java:99-104 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) tool/src/org/antlr/v4/codegen/Target.java:485 — tool/src/org/antlr/v4/codegen/Target.java:485-490 | tool/src/org/antlr/v4/codegen/target/CppTarget.java:107-112 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) tool/src/org/antlr/v4/codegen/Target.java:495 — tool/src/org/antlr/v4/codegen/Target.java:495-500 | tool/src/org/antlr/v4/codegen/target/CppTarget.java:115-120 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/misc/Pair.java:35 — runtime/Java/src/org/antlr/v4/runtime/misc/Pair.java:35-40 | runtime/Java/src/org/antlr/v4/runtime/misc/Triple.java:36-42 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) runtime/Dart/lib/src/atn/src/lexer_atn_simulator.dart:130 — runtime/Dart/lib/src/atn/src/lexer_atn_simulator.dart:130-135 | runtime/Dart/lib/src/atn/src/parser_atn_simulator.dart:314-319 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) runtime/CSharp/src/Atn/LexerATNSimulator.cs:107 — runtime/CSharp/src/Atn/LexerATNSimulator.cs:107-112 | runtime/CSharp/src/Atn/ParserATNSimulator.cs:297-302 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) runtime/Swift/Sources/Antlr4/atn/ATNConfig.swift:129 — runtime/Swift/Sources/Antlr4/atn/ATNConfig.swift:129-134 | runtime/Swift/Sources/Antlr4/atn/LexerATNConfig.swift:75-82 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) antlr4-maven-plugin/src/main/java/org/antlr/mojo/antlr4/Antlr4ErrorLog.java:48 — antlr4-maven-plugin/src/main/java/org/antlr/mojo/antlr4/Antlr4ErrorLog.java:48-53 | tool/src/org/antlr/v4/tool/DefaultToolListener.java:19-24 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) runtime/Swift/Sources/Antlr4/atn/LexerModeAction.swift:75 — runtime/Swift/Sources/Antlr4/atn/LexerModeAction.swift:75-81 | runtime/Swift/Sources/Antlr4/atn/LexerPushModeAction.swift:76-81 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) runtime/Swift/Sources/Antlr4/tree/pattern/TagChunk.swift:99 — runtime/Swift/Sources/Antlr4/tree/pattern/TagChunk.swift:99-104 | runtime/Swift/Sources/Antlr4/tree/pattern/TextChunk.swift:48-53 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D3 · God Classes · FileTooLong · ×12
  • FileTooLong: src/parser_atn_simulator.dart runtime/Dart/lib/src/atn/src/parser_atn_simulator.dart — FileTooLong — 1009 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 509 over it, 2.02× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: atn/ParserATNSimulator.java runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java — FileTooLong — 776 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: ParserATNSimulator (250-2189). The bar is 500 significant lines; this is 276 over it, 1.55× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: Atn/ParserATNSimulator.cs runtime/CSharp/src/Atn/ParserATNSimulator.cs — FileTooLong — 757 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 257 over it, 1.51× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: v4/parser_atn_simulator.go runtime/Go/antlr/v4/parser_atn_simulator.go — FileTooLong — 757 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: ParserATNSimulator (44 blocks, 35-1666). The bar is 500 significant lines; this is 257 over it, 1.51× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: atn/ParserATNSimulator.js runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js — FileTooLong — 723 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 223 over it, 1.45× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: atn/ParserATNSimulator.swift runtime/Swift/Sources/Antlr4/atn/ParserATNSimulator.swift — FileTooLong — 697 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 197 over it, 1.39× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: atn/ParserATNSimulator.py runtime/Python3/src/antlr4/atn/ParserATNSimulator.py — FileTooLong — 695 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 195 over it, 1.39× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: tool/Grammar.java tool/src/org/antlr/v4/tool/Grammar.java — FileTooLong — 681 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: Grammar (52-1367). The bar is 500 significant lines; this is 181 over it, 1.36× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: Atn/ATNDeserializer.cs runtime/CSharp/src/Atn/ATNDeserializer.cs — FileTooLong — 598 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 98 over it, 1.20× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: v4/Tool.java tool/src/org/antlr/v4/Tool.java — FileTooLong — 582 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: Tool (62-969). The bar is 500 significant lines; this is 82 over it, 1.16× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: automata/LexerATNFactory.java tool/src/org/antlr/v4/automata/LexerATNFactory.java — FileTooLong — 549 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: LexerATNFactory (38-817). The bar is 500 significant lines; this is 49 over it, 1.10× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: gui/TreeViewer.java tool/src/org/antlr/v4/gui/TreeViewer.java — FileTooLong — 536 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: TreeViewer (53-862). The bar is 500 significant lines; this is 36 over it, 1.07× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×12
  • Edited copy of a member (11 corresponding lines) tool/src/org/antlr/v4/codegen/ActionTranslator.java:263 — tool/src/org/antlr/v4/codegen/ActionTranslator.java:263-273 | tool/src/org/antlr/v4/codegen/ActionTranslator.java:275-285 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) tool/src/org/antlr/v4/tool/ast/GrammarAST.java:161 — tool/src/org/antlr/v4/tool/ast/GrammarAST.java:161-171 | tool/src/org/antlr/v4/tool/ast/GrammarAST.java:174-184 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/CodePointBuffer.java:353 — runtime/Java/src/org/antlr/v4/runtime/CodePointBuffer.java:353-363 | runtime/Java/src/org/antlr/v4/runtime/CodePointBuffer.java:365-375 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) tool/src/org/antlr/v4/tool/GrammarTransformPipeline.java:76 — tool/src/org/antlr/v4/tool/GrammarTransformPipeline.java:76-89 | tool/src/org/antlr/v4/tool/GrammarTransformPipeline.java:97-107 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) runtime/Go/antlr/v4/error_strategy.go:272 — runtime/Go/antlr/v4/error_strategy.go:272-283 | runtime/Go/antlr/v4/error_strategy.go:297-307 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) runtime/CSharp/src/Atn/ParserATNSimulator.cs:2018 — runtime/CSharp/src/Atn/ParserATNSimulator.cs:2018-2029 | runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:1889-1899 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/misc/Utils.java:35 — runtime/Java/src/org/antlr/v4/runtime/misc/Utils.java:35-45 | tool/src/org/antlr/v4/misc/Utils.java:41-51 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) runtime/Python3/src/antlr4/Parser.py:121 — runtime/Python3/src/antlr4/Parser.py:121-131 | runtime/Python3/src/antlr4/Parser.py:150-161 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) runtime/CSharp/src/DefaultErrorStrategy.cs:428 — runtime/CSharp/src/DefaultErrorStrategy.cs:428-439 | runtime/CSharp/src/DefaultErrorStrategy.cs:467-477 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) runtime/CSharp/src/Misc/IntervalSet.cs:793 — runtime/CSharp/src/Misc/IntervalSet.cs:793-805 | runtime/Java/src/org/antlr/v4/runtime/misc/IntervalSet.java:612-622 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/misc/Array2DHashSet.java:44 — runtime/Java/src/org/antlr/v4/runtime/misc/Array2DHashSet.java:44-54 | runtime/Java/src/org/antlr/v4/runtime/misc/FlexibleHashMap.java:59-69 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java:733 — runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java:733-743 | runtime/Java/src/org/antlr/v4/runtime/tree/xpath/XPathLexer.java:140-150 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×12
  • Edited copy of a member (8 corresponding lines) runtime/Python3/src/antlr4/error/ErrorStrategy.py:309 — runtime/Python3/src/antlr4/error/ErrorStrategy.py:309-318 | runtime/Python3/src/antlr4/error/ErrorStrategy.py:337-344 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) runtime/Dart/lib/src/atn/src/lexer_action.dart:187 — runtime/Dart/lib/src/atn/src/lexer_action.dart:187-194 | runtime/Dart/lib/src/atn/src/semantic_context.dart:120-128 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) tool/src/org/antlr/v4/tool/Alternative.java:131 — tool/src/org/antlr/v4/tool/Alternative.java:131-138 | tool/src/org/antlr/v4/tool/Rule.java:296-303 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) tool/src/org/antlr/v4/automata/ParserATNFactory.java:205 — tool/src/org/antlr/v4/automata/ParserATNFactory.java:205-212 | tool/src/org/antlr/v4/automata/LexerATNFactory.java:350-358 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) runtime/Python3/src/antlr4/Utils.py:9 — runtime/Python3/src/antlr4/Utils.py:9-18 | runtime/Python3/src/antlr4/atn/SemanticContext.py:236-243 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) runtime/Swift/Sources/Antlr4/atn/LexerATNSimulator.swift:87 — runtime/Swift/Sources/Antlr4/atn/LexerATNSimulator.swift:87-94 | runtime/Swift/Sources/Antlr4/atn/ParserATNSimulator.swift:287-297 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) tool/src/org/antlr/v4/tool/GrammarSemanticsMessage.java:19 — tool/src/org/antlr/v4/tool/GrammarSemanticsMessage.java:19-26 | tool/src/org/antlr/v4/tool/GrammarSyntaxMessage.java:21-29 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) runtime/CSharp/src/Atn/ParseInfo.cs:164 — runtime/CSharp/src/Atn/ParseInfo.cs:164-172 | runtime/Java/src/org/antlr/v4/runtime/atn/ParseInfo.java:146-153 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) runtime/Go/antlr/v4/dfa_serializer.go:115 — runtime/Go/antlr/v4/dfa_serializer.go:115-122 | runtime/Go/antlr/v4/lexer_atn_simulator.go:641-653 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) runtime/CSharp/src/Atn/DecisionEventInfo.cs:68 — runtime/CSharp/src/Atn/DecisionEventInfo.cs:68-75 | runtime/Java/src/org/antlr/v4/runtime/atn/DecisionEventInfo.java:67-74 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/tree/pattern/RuleTagToken.java:59 — runtime/Java/src/org/antlr/v4/runtime/tree/pattern/RuleTagToken.java:59-67 | runtime/Java/src/org/antlr/v4/runtime/tree/pattern/TagChunk.java:59-66 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) runtime/CSharp/src/UnbufferedCharStream.cs:191 — runtime/CSharp/src/UnbufferedCharStream.cs:191-198 | runtime/CSharp/src/UnbufferedTokenStream.cs:225-232 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×11
  • Edited copy of a member (16 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/atn/SemanticContext.java:215 — runtime/Java/src/org/antlr/v4/runtime/atn/SemanticContext.java:215-230 | runtime/Java/src/org/antlr/v4/runtime/atn/SemanticContext.java:312-327 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) tool/src/org/antlr/v4/gui/TreePostScriptGenerator.java:91 — tool/src/org/antlr/v4/gui/TreePostScriptGenerator.java:91-106 | tool/src/org/antlr/v4/gui/TreeViewer.java:251-266 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/BufferedTokenStream.java:365 — runtime/Java/src/org/antlr/v4/runtime/BufferedTokenStream.java:365-380 | runtime/Java/src/org/antlr/v4/runtime/BufferedTokenStream.java:394-413 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) runtime/Swift/Sources/Antlr4/Parser.swift:178 — runtime/Swift/Sources/Antlr4/Parser.swift:178-193 | runtime/Swift/Sources/Antlr4/Parser.swift:213-229 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) runtime/CSharp/src/Atn/LexerATNSimulator.cs:285 — runtime/CSharp/src/Atn/LexerATNSimulator.cs:285-302 | runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java:296-311 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) runtime/CSharp/src/Tree/Xpath/XPathRuleElement.cs:24 — runtime/CSharp/src/Tree/Xpath/XPathRuleElement.cs:24-39 | runtime/CSharp/src/Tree/Xpath/XPathTokenElement.cs:23-38 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/ParserRuleContext.java:211 — runtime/Java/src/org/antlr/v4/runtime/ParserRuleContext.java:211-226 | runtime/Java/src/org/antlr/v4/runtime/ParserRuleContext.java:228-248 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) runtime/Swift/Sources/Antlr4/ParserRuleContext.swift:165 — runtime/Swift/Sources/Antlr4/ParserRuleContext.swift:165-180 | runtime/Swift/Sources/Antlr4/ParserRuleContext.swift:182-200 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/UnbufferedCharStream.java:252 — runtime/Java/src/org/antlr/v4/runtime/UnbufferedCharStream.java:252-267 | runtime/Java/src/org/antlr/v4/runtime/UnbufferedTokenStream.java:217-235 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) runtime/CSharp/src/Atn/SemanticContext.cs:403 — runtime/CSharp/src/Atn/SemanticContext.cs:403-418 | runtime/CSharp/src/Atn/SemanticContext.cs:421-440 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/atn/ArrayPredictionContext.java:64 — runtime/Java/src/org/antlr/v4/runtime/atn/ArrayPredictionContext.java:64-79 | runtime/Java/src/org/antlr/v4/runtime/atn/SingletonPredictionContext.java:46-61 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×10
  • Edited copy of a member (18 corresponding lines) runtime/CSharp/src/Atn/ParserATNSimulator.cs:988 — runtime/CSharp/src/Atn/ParserATNSimulator.cs:988-1007 | runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:930-947 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/misc/Array2DHashSet.java:394 — runtime/Java/src/org/antlr/v4/runtime/misc/Array2DHashSet.java:394-411 | runtime/Java/src/org/antlr/v4/runtime/misc/FlexibleHashMap.java:222-239 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) runtime/CSharp/src/Misc/RuleDependencyChecker.cs:409 — runtime/CSharp/src/Misc/RuleDependencyChecker.cs:409-426 | runtime/CSharp/src/Misc/RuleDependencyChecker.cs:429-446 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) runtime/CSharp/src/Atn/LexerActionExecutor.cs:147 — runtime/CSharp/src/Atn/LexerActionExecutor.cs:147-165 | runtime/Java/src/org/antlr/v4/runtime/atn/LexerActionExecutor.java:106-123 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) runtime/CSharp/src/Atn/ParserATNSimulator.cs:1367 — runtime/CSharp/src/Atn/ParserATNSimulator.cs:1367-1387 | runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:1285-1302 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) runtime/Python3/src/antlr4/ListTokenSource.py:55 — runtime/Python3/src/antlr4/ListTokenSource.py:55-72 | runtime/Python3/src/antlr4/ListTokenSource.py:100-118 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) runtime/CSharp/src/Atn/LexerATNSimulator.cs:673 — runtime/CSharp/src/Atn/LexerATNSimulator.cs:673-694 | runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java:643-660 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) runtime/Dart/lib/src/parser_rule_context.dart:156 — runtime/Dart/lib/src/parser_rule_context.dart:156-176 | runtime/Dart/lib/src/parser_rule_context.dart:178-195 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/UnbufferedCharStream.java:121 — runtime/Java/src/org/antlr/v4/runtime/UnbufferedCharStream.java:121-138 | runtime/Java/src/org/antlr/v4/runtime/UnbufferedTokenStream.java:137-155 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) runtime/Swift/Sources/Antlr4/UnbufferedCharStream.swift:88 — runtime/Swift/Sources/Antlr4/UnbufferedCharStream.swift:88-105 | runtime/Swift/Sources/Antlr4/UnbufferedTokenStream.swift:124-143 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×10
  • Duplicated block (5 lines × 2) runtime/CSharp/src/Atn/ATNConfig.cs:198 — runtime/CSharp/src/Atn/ATNConfig.cs:198-202 | runtime/CSharp/src/Atn/LexerATNConfig.cs:78-82 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `runtime/CSharp/src/Atn/LexerATNConfig.cs:83` calls `Update` and `runtime/CSharp/src/Atn/ATNConfig.cs:203` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) runtime/Java/src/org/antlr/v4/runtime/atn/ATNConfig.java:181 — runtime/Java/src/org/antlr/v4/runtime/atn/ATNConfig.java:181-185 | runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNConfig.java:74-78 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNConfig.java:79` calls `update` and `runtime/Java/src/org/antlr/v4/runtime/atn/ATNConfig.java:186` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:2127 — runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:2127-2131 | runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:2136-2140 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) tool/src/org/antlr/v4/codegen/model/ElementFrequenciesVisitor.java:217 — tool/src/org/antlr/v4/codegen/model/ElementFrequenciesVisitor.java:217-221 | tool/src/org/antlr/v4/codegen/model/ElementFrequenciesVisitor.java:260-264 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) runtime/CSharp/src/Atn/LexerATNSimulator.cs:108 — runtime/CSharp/src/Atn/LexerATNSimulator.cs:108-112 | runtime/CSharp/src/Atn/ParserATNSimulator.cs:298-302 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (5 lines × 2) runtime/CSharp/src/Atn/LexerModeAction.cs:100 — runtime/CSharp/src/Atn/LexerModeAction.cs:100-104 | runtime/CSharp/src/Atn/LexerPushModeAction.cs:99-103 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (5 lines × 2) runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java:132 — runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java:132-136 | runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:307-311 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) tool/src/org/antlr/v4/codegen/model/RuleFunction.java:300 — tool/src/org/antlr/v4/codegen/model/RuleFunction.java:300-304 | tool/src/org/antlr/v4/codegen/model/decl/CodeBlock.java:36-40 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) runtime/Java/src/org/antlr/v4/runtime/RuleContext.java:218 — runtime/Java/src/org/antlr/v4/runtime/RuleContext.java:218-222 | runtime/Java/src/org/antlr/v4/runtime/tree/Trees.java:39-43 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `recog` to `Recognizer<?,?>` in one and `Parser` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (5 lines × 2) runtime/Go/antlr/v4/parser_atn_simulator.go:1629 — runtime/Go/antlr/v4/parser_atn_simulator.go:1629-1633 | runtime/Go/antlr/v4/parser_atn_simulator.go:1641-1645 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `runtime/Go/antlr/v4/parser_atn_simulator.go:1629` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D3 · God Classes · ClassTooLong · ×8
  • ClassTooLong: ParserATNSimulator runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:250 — ClassTooLong — 764 significant lines (blank, comment-only and punctuation-only lines excluded), 48 methods. The bar is 400 significant lines; this is 364 over it, 1.91× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ParserATNSimulator runtime/Go/antlr/v4/parser_atn_simulator.go:35 — ClassTooLong — 726 significant lines (blank, comment-only and punctuation-only lines excluded), 43 methods, 44 blocks, lines 35-1666. The bar is 400 significant lines; this is 326 over it, 1.82× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Grammar tool/src/org/antlr/v4/tool/Grammar.java:52 — ClassTooLong — 639 significant lines (blank, comment-only and punctuation-only lines excluded), 85 methods. The bar is 400 significant lines; this is 239 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ATNDeserializer runtime/CSharp/src/Atn/ATNDeserializer.cs — ClassTooLong — 591 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 191 over it, 1.48× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Tool tool/src/org/antlr/v4/Tool.java:62 — ClassTooLong — 530 significant lines (blank, comment-only and punctuation-only lines excluded), 39 methods. The bar is 400 significant lines; this is 130 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: LexerATNFactory tool/src/org/antlr/v4/automata/LexerATNFactory.java:38 — ClassTooLong — 521 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods. The bar is 400 significant lines; this is 121 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: TreeViewer tool/src/org/antlr/v4/gui/TreeViewer.java:53 — ClassTooLong — 493 significant lines (blank, comment-only and punctuation-only lines excluded), 52 methods. The bar is 400 significant lines; this is 93 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ParserATNFactory tool/src/org/antlr/v4/automata/ParserATNFactory.java:74 — ClassTooLong — 405 significant lines (blank, comment-only and punctuation-only lines excluded), 43 methods. The bar is 400 significant lines; this is 5 over it, 1.01× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×8
  • Edited copy of a member (19 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/misc/Array2DHashSet.java:413 — runtime/Java/src/org/antlr/v4/runtime/misc/Array2DHashSet.java:413-431 | runtime/Java/src/org/antlr/v4/runtime/misc/FlexibleHashMap.java:241-259 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) runtime/Swift/Sources/Antlr4/BufferedTokenStream.swift:375 — runtime/Swift/Sources/Antlr4/BufferedTokenStream.swift:375-393 | runtime/Swift/Sources/Antlr4/BufferedTokenStream.swift:400-419 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) runtime/Go/antlr/v4/common_token_stream.go:243 — runtime/Go/antlr/v4/common_token_stream.go:243-263 | runtime/Go/antlr/v4/common_token_stream.go:268-286 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) runtime/CSharp/src/BufferedTokenStream.cs:233 — runtime/CSharp/src/BufferedTokenStream.cs:233-253 | runtime/Java/src/org/antlr/v4/runtime/BufferedTokenStream.java:163-181 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) runtime/Go/antlr/v4/comparators.go:57 — runtime/Go/antlr/v4/comparators.go:57-75 | runtime/Go/antlr/v4/comparators.go:126-144 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) runtime/CSharp/src/Atn/ParserATNSimulator.cs:630 — runtime/CSharp/src/Atn/ParserATNSimulator.cs:630-649 | runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:601-619 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) runtime/Swift/Sources/Antlr4/BufferedTokenStream.swift:319 — runtime/Swift/Sources/Antlr4/BufferedTokenStream.swift:319-338 | runtime/Swift/Sources/Antlr4/BufferedTokenStream.swift:350-368 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) runtime/CSharp/src/Parser.cs:237 — runtime/CSharp/src/Parser.cs:237-255 | runtime/CSharp/src/Parser.cs:288-306 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×8
  • Edited copy of a member (7 corresponding lines) runtime/CSharp/src/Atn/LL1Analyzer.cs:104 — runtime/CSharp/src/Atn/LL1Analyzer.cs:104-110 | runtime/Java/src/org/antlr/v4/runtime/atn/LL1Analyzer.java:98-105 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) runtime/CSharp/src/Atn/ATNConfigSet.cs:405 — runtime/CSharp/src/Atn/ATNConfigSet.cs:405-411 | runtime/Java/src/org/antlr/v4/runtime/atn/ATNConfigSet.java:47-53 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) runtime/CSharp/src/Atn/ATNConfig.cs:73 — runtime/CSharp/src/Atn/ATNConfig.cs:73-79 | runtime/Java/src/org/antlr/v4/runtime/atn/ATNConfig.java:70-76 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) runtime/CSharp/src/Atn/ATNConfigSet.cs:71 — runtime/CSharp/src/Atn/ATNConfigSet.cs:71-77 | runtime/Java/src/org/antlr/v4/runtime/atn/ATNConfigSet.java:111-118 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) runtime/Swift/Sources/Antlr4/atn/LexerATNSimulator.swift:381 — runtime/Swift/Sources/Antlr4/atn/LexerATNSimulator.swift:381-387 | runtime/Swift/Sources/Antlr4/atn/ParserATNSimulator.swift:1099-1106 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) runtime/CSharp/src/Atn/ATNConfig.cs:125 — runtime/CSharp/src/Atn/ATNConfig.cs:125-131 | runtime/Java/src/org/antlr/v4/runtime/atn/ATNConfig.java:121-127 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/DiagnosticErrorListener.java:141 — runtime/Java/src/org/antlr/v4/runtime/DiagnosticErrorListener.java:141-152 | runtime/Java/src/org/antlr/v4/runtime/atn/PredictionMode.java:529-535 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) runtime/Go/antlr/v4/atn_config_set.go:59 — runtime/Go/antlr/v4/atn_config_set.go:59-65 | runtime/Go/antlr/v4/diagnostic_error_listener.go:100-110 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×8
  • Duplicated block (6 lines × 2) tool/src/org/antlr/v4/tool/GrammarTransformPipeline.java:306 — tool/src/org/antlr/v4/tool/GrammarTransformPipeline.java:306-311 | tool/src/org/antlr/v4/tool/GrammarTransformPipeline.java:328-333 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `tool/src/org/antlr/v4/tool/GrammarTransformPipeline.java:306` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) runtime/Java/src/org/antlr/v4/runtime/UnbufferedCharStream.java:146 — runtime/Java/src/org/antlr/v4/runtime/UnbufferedCharStream.java:146-151 | runtime/Java/src/org/antlr/v4/runtime/UnbufferedTokenStream.java:161-166 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) runtime/Java/src/org/antlr/v4/runtime/atn/LexerModeAction.java:69 — runtime/Java/src/org/antlr/v4/runtime/atn/LexerModeAction.java:69-74 | runtime/Java/src/org/antlr/v4/runtime/atn/LexerPushModeAction.java:69-74 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) tool/src/org/antlr/v4/tool/Alternative.java:117 — tool/src/org/antlr/v4/tool/Alternative.java:117-122 | tool/src/org/antlr/v4/tool/Rule.java:276-281 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) tool/src/org/antlr/v4/tool/Alternative.java:109 — tool/src/org/antlr/v4/tool/Alternative.java:109-114 | tool/src/org/antlr/v4/tool/Rule.java:268-273 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) runtime/Go/antlr/v4/semantic_context.go:271 — runtime/Go/antlr/v4/semantic_context.go:271-277 | runtime/Go/antlr/v4/semantic_context.go:418-423 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `runtime/Go/antlr/v4/semantic_context.go:271` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) REDACTED:223 — REDACTED:223-228 | REDACTED:238-243 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:244` calls `WriteString`, `Itoa` and `REDACTED:229` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) runtime/Swift/Sources/Antlr4/atn/LexerATNSimulator.swift:131 — runtime/Swift/Sources/Antlr4/atn/LexerATNSimulator.swift:131-136 | runtime/Swift/Sources/Antlr4/atn/ParserATNSimulator.swift:303-308 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D30 · Dependency Vulnerabilities · Medium CVE · ×7
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×7
  • Edited copy of a member (13 corresponding lines) tool/src/org/antlr/v4/codegen/model/ElementFrequenciesVisitor.java:216 — tool/src/org/antlr/v4/codegen/model/ElementFrequenciesVisitor.java:216-228 | tool/src/org/antlr/v4/codegen/model/ElementFrequenciesVisitor.java:259-271 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) tool/src/org/antlr/v4/automata/LexerATNFactory.java:399 — tool/src/org/antlr/v4/automata/LexerATNFactory.java:399-411 | tool/src/org/antlr/v4/misc/EscapeSequenceParsing.java:58-70 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/misc/Array2DHashSet.java:118 — runtime/Java/src/org/antlr/v4/runtime/misc/Array2DHashSet.java:118-130 | runtime/Java/src/org/antlr/v4/runtime/misc/FlexibleHashMap.java:165-177 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) runtime/Swift/Sources/Antlr4/DefaultErrorStrategy.swift:345 — runtime/Swift/Sources/Antlr4/DefaultErrorStrategy.swift:345-357 | runtime/Swift/Sources/Antlr4/DefaultErrorStrategy.swift:376-388 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) runtime/CSharp/src/Misc/IntervalSet.cs:741 — runtime/CSharp/src/Misc/IntervalSet.cs:741-755 | runtime/Java/src/org/antlr/v4/runtime/misc/IntervalSet.java:569-581 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) runtime/CSharp/src/Misc/IntervalSet.cs:237 — runtime/CSharp/src/Misc/IntervalSet.cs:237-254 | runtime/CSharp/src/Misc/IntervalSet.cs:257-269 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) runtime/CSharp/src/Atn/LexerATNSimulator.cs:230 — runtime/CSharp/src/Atn/LexerATNSimulator.cs:230-243 | runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java:245-257 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×7
  • Edited copy of a member (5 corresponding lines) runtime/Python3/src/antlr4/atn/ParserATNSimulator.py:1625 — runtime/Python3/src/antlr4/atn/ParserATNSimulator.py:1625-1629 | runtime/Python3/src/antlr4/atn/ParserATNSimulator.py:1632-1636 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) runtime/Swift/Sources/Antlr4/Parser.swift:38 — runtime/Swift/Sources/Antlr4/Parser.swift:38-42 | runtime/Swift/Sources/Antlr4/Parser.swift:51-55 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) runtime/Swift/Sources/Antlr4/tree/pattern/ParseTreePatternMatcher.swift:129 — runtime/Swift/Sources/Antlr4/tree/pattern/ParseTreePatternMatcher.swift:129-133 | runtime/Swift/Sources/Antlr4/tree/pattern/ParseTreePatternMatcher.swift:151-155 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) runtime/CSharp/src/RuleContext.cs:284 — runtime/CSharp/src/RuleContext.cs:284-288 | runtime/CSharp/src/Tree/Trees.cs:38-42 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) tool/src/org/antlr/v4/codegen/Target.java:456 — tool/src/org/antlr/v4/codegen/Target.java:456-460 | tool/src/org/antlr/v4/codegen/target/CppTarget.java:84-88 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) tool/src/org/antlr/v4/tool/Alternative.java:124 — tool/src/org/antlr/v4/tool/Alternative.java:124-128 | tool/src/org/antlr/v4/tool/Rule.java:305-309 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) runtime/CSharp/src/Atn/ATNConfigSet.cs:359 — runtime/CSharp/src/Atn/ATNConfigSet.cs:359-363 | runtime/CSharp/src/Sharpen/SequenceEqualityComparer.cs:36-43 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D17 · Explicit Debt · CommentedOutCode · ×6
  • CommentedOutCode runtime/CSharp/src/AntlrInputStream.cs:280 — 3 consecutive commented-code lines
  • CommentedOutCode runtime/CSharp/src/Atn/ArrayPredictionContext.cs:69 — 3 consecutive commented-code lines
  • CommentedOutCode runtime/CSharp/src/Atn/ParserATNSimulator.cs:286 — 3 consecutive commented-code lines
  • CommentedOutCode runtime/CSharp/src/Atn/ParserATNSimulator.cs:1282 — 3 consecutive commented-code lines
  • CommentedOutCode runtime/CSharp/src/Atn/ATNConfig.cs:215 — 4 consecutive commented-code lines
  • CommentedOutCode runtime/CSharp/src/ParserRuleContext.cs:208 — 4 consecutive commented-code lines
D2 · Cognitive Complexity · ParserATNSimulator.evalSemanticContext (cognitive 18) · ×6
  • ParserATNSimulator.evalSemanticContext (cognitive 18) runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:1353 — ParserATNSimulator.evalSemanticContext has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ParserATNSimulator.evalSemanticContext (cognitive 18) runtime/Python3/src/antlr4/atn/ParserATNSimulator.py:1069 — ParserATNSimulator.evalSemanticContext has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ParserATNSimulator.evalSemanticContext (cognitive 18) runtime/Go/antlr/v4/parser_atn_simulator.go:961 — ParserATNSimulator.evalSemanticContext has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ParserATNSimulator.evalSemanticContext (cognitive 18) runtime/Swift/Sources/Antlr4/atn/ParserATNSimulator.swift:1243 — ParserATNSimulator.evalSemanticContext has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ParserATNSimulator.evalSemanticContext (cognitive 18) runtime/Dart/lib/src/atn/src/parser_atn_simulator.dart:1392 — ParserATNSimulator.evalSemanticContext has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ParserATNSimulator.evalSemanticContext (cognitive 18) runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:1171 — ParserATNSimulator.evalSemanticContext has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×6
  • Edited copy of a member (14 corresponding lines) antlr4-maven-plugin/src/main/java/org/antlr/mojo/antlr4/Antlr4ErrorLog.java:63 — antlr4-maven-plugin/src/main/java/org/antlr/mojo/antlr4/Antlr4ErrorLog.java:63-76 | antlr4-maven-plugin/src/main/java/org/antlr/mojo/antlr4/Antlr4ErrorLog.java:86-99 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) runtime/Swift/Sources/Antlr4/atn/SemanticContext.swift:366 — runtime/Swift/Sources/Antlr4/atn/SemanticContext.swift:366-379 | runtime/Swift/Sources/Antlr4/atn/SemanticContext.swift:385-401 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) tool/src/org/antlr/v4/semantics/BasicSemanticChecks.java:555 — tool/src/org/antlr/v4/semantics/BasicSemanticChecks.java:555-568 | tool/src/org/antlr/v4/semantics/BasicSemanticChecks.java:570-583 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) runtime/Go/antlr/v4/semantic_context.go:240 — runtime/Go/antlr/v4/semantic_context.go:240-254 | runtime/Go/antlr/v4/semantic_context.go:390-403 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/DefaultErrorStrategy.java:365 — runtime/Java/src/org/antlr/v4/runtime/DefaultErrorStrategy.java:365-378 | runtime/Java/src/org/antlr/v4/runtime/DefaultErrorStrategy.java:397-410 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) runtime/CSharp/src/Atn/PredictionMode.cs:811 — runtime/CSharp/src/Atn/PredictionMode.cs:811-824 | runtime/CSharp/src/Atn/PredictionMode.cs:843-856 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×6
  • Edited copy of a member (17 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/CommonToken.java:264 — runtime/Java/src/org/antlr/v4/runtime/CommonToken.java:264-283 | tool/src/org/antlr/v4/parse/GrammarToken.java:57-73 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) runtime/CSharp/src/Atn/ATNDeserializer.cs:200 — runtime/CSharp/src/Atn/ATNDeserializer.cs:200-217 | runtime/CSharp/src/Atn/ATNDeserializer.cs:327-343 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) runtime/Python3/src/antlr4/atn/SemanticContext.py:167 — runtime/Python3/src/antlr4/atn/SemanticContext.py:167-183 | runtime/Python3/src/antlr4/atn/SemanticContext.py:253-270 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) runtime/CSharp/src/Dfa/ArrayEdgeMap.cs:144 — runtime/CSharp/src/Dfa/ArrayEdgeMap.cs:144-163 | runtime/CSharp/src/Dfa/SparseEdgeMap.cs:185-201 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/Parser.java:198 — runtime/Java/src/org/antlr/v4/runtime/Parser.java:198-216 | runtime/Java/src/org/antlr/v4/runtime/Parser.java:236-252 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) scripts/deploy_to_website.py:22 — scripts/deploy_to_website.py:22-38 | scripts/update_antlr_version.py:44-60 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×6
  • Edited copy of a member (10 corresponding lines) tool/src/org/antlr/v4/codegen/model/decl/AltLabelStructDecl.java:32 — tool/src/org/antlr/v4/codegen/model/decl/AltLabelStructDecl.java:32-41 | tool/src/org/antlr/v4/codegen/model/decl/StructDecl.java:59-71 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) runtime/Dart/lib/src/atn/src/atn_config.dart:143 — runtime/Dart/lib/src/atn/src/atn_config.dart:143-152 | runtime/Dart/lib/src/atn/src/atn_config.dart:215-227 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) runtime/Dart/lib/src/atn/src/lexer_atn_simulator.dart:403 — runtime/Dart/lib/src/atn/src/lexer_atn_simulator.dart:403-412 | runtime/Dart/lib/src/atn/src/parser_atn_simulator.dart:969-982 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) runtime/CSharp/src/Atn/LexerATNSimulator.cs:385 — runtime/CSharp/src/Atn/LexerATNSimulator.cs:385-395 | runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java:382-391 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/atn/SemanticContext.java:402 — runtime/Java/src/org/antlr/v4/runtime/atn/SemanticContext.java:402-411 | runtime/Java/src/org/antlr/v4/runtime/atn/SemanticContext.java:417-427 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/misc/LogManager.java:58 — runtime/Java/src/org/antlr/v4/runtime/misc/LogManager.java:58-67 | tool/src/org/antlr/v4/gui/Trees.java:84-94 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D1 · Cyclomatic Complexity · LL1Analyzer._LOOK (cyclomatic 22) · ×5
  • LL1Analyzer._LOOK (cyclomatic 22) runtime/Java/src/org/antlr/v4/runtime/atn/LL1Analyzer.java:137 — LL1Analyzer._LOOK has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • LL1Analyzer._LOOK (cyclomatic 22) runtime/Python3/src/antlr4/LL1Analyzer.py:110 — LL1Analyzer._LOOK has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • LL1Analyzer._LOOK (cyclomatic 22) runtime/Swift/Sources/Antlr4/atn/LL1Analyzer.swift:131 — LL1Analyzer._LOOK has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • LL1Analyzer._LOOK (cyclomatic 22) runtime/Dart/lib/src/ll1_analyzer.dart:97 — LL1Analyzer._LOOK has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • LL1Analyzer._LOOK (cyclomatic 22) runtime/JavaScript/src/antlr4/atn/LL1Analyzer.js:113 — LL1Analyzer._LOOK has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ParserATNSimulator.closure_ (cyclomatic 17) · ×5
  • ParserATNSimulator.closure_ (cyclomatic 17) runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:1504 — ParserATNSimulator.closure_ has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ParserATNSimulator.closure_ (cyclomatic 17) runtime/Python3/src/antlr4/atn/ParserATNSimulator.py:1145 — ParserATNSimulator.closure_ has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ParserATNSimulator.closure_ (cyclomatic 17) runtime/Swift/Sources/Antlr4/atn/ParserATNSimulator.swift:1394 — ParserATNSimulator.closure_ has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ParserATNSimulator.closure_ (cyclomatic 17) runtime/Dart/lib/src/atn/src/parser_atn_simulator.dart:1579 — ParserATNSimulator.closure_ has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ParserATNSimulator.closure_ (cyclomatic 17) runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:1260 — ParserATNSimulator.closure_ has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D2 · Cognitive Complexity · LexerATNSimulator.getReachableConfigSet (cognitive 19) · ×5
  • LexerATNSimulator.getReachableConfigSet (cognitive 19) runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java:317 — LexerATNSimulator.getReachableConfigSet has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LexerATNSimulator.getReachableConfigSet (cognitive 19) runtime/Python3/src/antlr4/atn/LexerATNSimulator.py:259 — LexerATNSimulator.getReachableConfigSet has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LexerATNSimulator.getReachableConfigSet (cognitive 19) runtime/Go/antlr/v4/lexer_atn_simulator.go:274 — LexerATNSimulator.getReachableConfigSet has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LexerATNSimulator.getReachableConfigSet (cognitive 19) runtime/Dart/lib/src/atn/src/lexer_atn_simulator.dart:318 — LexerATNSimulator.getReachableConfigSet has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LexerATNSimulator.getReachableConfigSet (cognitive 19) runtime/JavaScript/src/antlr4/atn/LexerATNSimulator.js:277 — LexerATNSimulator.getReachableConfigSet has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×5
  • Edited copy of a member (15 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/tree/Trees.java:48 — runtime/Java/src/org/antlr/v4/runtime/tree/Trees.java:48-62 | tool/src/org/antlr/v4/gui/Trees.java:107-122 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/tree/xpath/XPathRuleElement.java:26 — runtime/Java/src/org/antlr/v4/runtime/tree/xpath/XPathRuleElement.java:26-40 | runtime/Java/src/org/antlr/v4/runtime/tree/xpath/XPathTokenElement.java:26-40 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) runtime/CSharp/src/Dfa/DFA.cs:40 — runtime/CSharp/src/Dfa/DFA.cs:40-54 | runtime/Java/src/org/antlr/v4/runtime/dfa/DFA.java:49-66 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) runtime/Go/antlr/v4/parser.go:146 — runtime/Go/antlr/v4/parser.go:146-167 | runtime/Go/antlr/v4/parser.go:185-199 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) runtime/Dart/lib/src/prediction_context.dart:758 — runtime/Dart/lib/src/prediction_context.dart:758-772 | runtime/Dart/lib/src/prediction_context.dart:867-881 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×5
  • Edited copy of a member (12 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/BufferedTokenStream.java:192 — runtime/Java/src/org/antlr/v4/runtime/BufferedTokenStream.java:192-203 | runtime/Java/src/org/antlr/v4/runtime/BufferedTokenStream.java:448-462 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) runtime/Swift/Sources/Antlr4/atn/LexerATNSimulator.swift:390 — runtime/Swift/Sources/Antlr4/atn/LexerATNSimulator.swift:390-401 | runtime/Swift/Sources/Antlr4/atn/ParserATNSimulator.swift:923-935 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/misc/Pair.java:21 — runtime/Java/src/org/antlr/v4/runtime/misc/Pair.java:21-32 | runtime/Java/src/org/antlr/v4/runtime/misc/Triple.java:21-33 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) tool/src/org/antlr/v4/analysis/LeftRecursiveRuleAnalyzer.java:155 — tool/src/org/antlr/v4/analysis/LeftRecursiveRuleAnalyzer.java:155-170 | tool/src/org/antlr/v4/analysis/LeftRecursiveRuleAnalyzer.java:195-206 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/atn/PredictionMode.java:546 — runtime/Java/src/org/antlr/v4/runtime/atn/PredictionMode.java:546-557 | runtime/Java/src/org/antlr/v4/runtime/atn/PredictionMode.java:567-578 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×5
  • Edited copy of a member (9 corresponding lines) runtime/Python3/src/antlr4/BufferedTokenStream.py:230 — runtime/Python3/src/antlr4/BufferedTokenStream.py:230-238 | runtime/Python3/src/antlr4/BufferedTokenStream.py:245-255 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) runtime/CSharp/src/Atn/ATNConfig.cs:197 — runtime/CSharp/src/Atn/ATNConfig.cs:197-205 | runtime/CSharp/src/Atn/LexerATNConfig.cs:77-87 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/atn/ATNConfig.java:180 — runtime/Java/src/org/antlr/v4/runtime/atn/ATNConfig.java:180-188 | runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNConfig.java:73-83 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) runtime/CSharp/src/Atn/ParseInfo.cs:50 — runtime/CSharp/src/Atn/ParseInfo.cs:50-59 | runtime/Java/src/org/antlr/v4/runtime/atn/ParseInfo.java:46-54 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) runtime/Python3/src/antlr4/Recognizer.py:53 — runtime/Python3/src/antlr4/Recognizer.py:53-62 | runtime/Python3/src/antlr4/Recognizer.py:69-77 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×5
  • Duplicated block (7 lines × 2) runtime/CSharp/src/Atn/ParserATNSimulator.cs:1957 — runtime/CSharp/src/Atn/ParserATNSimulator.cs:1957-1963 | runtime/CSharp/src/Atn/ParserATNSimulator.cs:2008-2014 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `runtime/CSharp/src/Atn/ParserATNSimulator.cs:1957` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (7 lines × 2) tool/src/org/antlr/v4/tool/DOTGenerator.java:72 — tool/src/org/antlr/v4/tool/DOTGenerator.java:72-78 | tool/src/org/antlr/v4/tool/DOTGenerator.java:81-87 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `tool/src/org/antlr/v4/tool/DOTGenerator.java:72` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) runtime/CSharp/src/UnbufferedCharStream.cs:192 — runtime/CSharp/src/UnbufferedCharStream.cs:192-198 | runtime/CSharp/src/UnbufferedTokenStream.cs:226-232 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (7 lines × 2) runtime/Python3/src/antlr4/error/DiagnosticErrorListener.py:57 — runtime/Python3/src/antlr4/error/DiagnosticErrorListener.py:57-63 | runtime/Python3/src/antlr4/error/DiagnosticErrorListener.py:67-73 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) runtime/Swift/Sources/Antlr4/atn/ActionTransition.swift:19 — runtime/Swift/Sources/Antlr4/atn/ActionTransition.swift:19-25 | runtime/Swift/Sources/Antlr4/atn/PredicateTransition.swift:23-29 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `runtime/Swift/Sources/Antlr4/atn/ActionTransition.swift:15` calls `init` and `runtime/Swift/Sources/Antlr4/atn/PredicateTransition.swift:20` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×5
  • Duplicated block (9 lines × 2) runtime/Java/src/org/antlr/v4/runtime/misc/Array2DHashSet.java:423 — runtime/Java/src/org/antlr/v4/runtime/misc/Array2DHashSet.java:423-431 | runtime/Java/src/org/antlr/v4/runtime/misc/FlexibleHashMap.java:251-259 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `runtime/Java/src/org/antlr/v4/runtime/misc/Array2DHashSet.java:423` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (9 lines × 2) runtime/Java/src/org/antlr/v4/runtime/tree/Trees.java:54 — runtime/Java/src/org/antlr/v4/runtime/tree/Trees.java:54-62 | tool/src/org/antlr/v4/gui/Trees.java:114-122 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `runtime/Java/src/org/antlr/v4/runtime/tree/Trees.java:54` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (9 lines × 2) tool/src/org/antlr/v4/semantics/ActionSniffer.java:42 — tool/src/org/antlr/v4/semantics/ActionSniffer.java:42-50 | tool/src/org/antlr/v4/semantics/AttributeChecks.java:77-85 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) runtime/Java/src/org/antlr/v4/runtime/UnbufferedCharStream.java:238 — runtime/Java/src/org/antlr/v4/runtime/UnbufferedCharStream.java:238-246 | runtime/Java/src/org/antlr/v4/runtime/UnbufferedTokenStream.java:206-214 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) runtime/Swift/Sources/Antlr4/UnbufferedCharStream.swift:186 — runtime/Swift/Sources/Antlr4/UnbufferedCharStream.swift:186-194 | runtime/Swift/Sources/Antlr4/UnbufferedTokenStream.swift:197-205 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×5
  • Duplicated block (12 lines × 2) runtime/Go/antlr/v4/semantic_context.go:210 — runtime/Go/antlr/v4/semantic_context.go:210-221 | runtime/Go/antlr/v4/semantic_context.go:359-370 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `runtime/Go/antlr/v4/semantic_context.go:210` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) runtime/Swift/Sources/Antlr4/misc/BitSet.swift:706 — runtime/Swift/Sources/Antlr4/misc/BitSet.swift:706-717 | runtime/Swift/Sources/Antlr4/misc/BitSet.swift:748-759 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `runtime/Swift/Sources/Antlr4/misc/BitSet.swift:706` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) runtime/Dart/lib/src/atn/src/semantic_context.dart:222 — runtime/Dart/lib/src/atn/src/semantic_context.dart:222-233 | runtime/Dart/lib/src/atn/src/semantic_context.dart:326-337 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `runtime/Dart/lib/src/atn/src/semantic_context.dart:222` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) runtime/Dart/lib/src/interval_set.dart:607 — runtime/Dart/lib/src/interval_set.dart:607-618 | runtime/Dart/lib/src/interval_set.dart:621-632 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) scripts/deploy_to_website.py:22 — scripts/deploy_to_website.py:22-33 | scripts/update_antlr_version.py:44-55 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
R10 · Code Duplication · Duplicated block (10 lines × 2 locations) · ×5
  • Duplicated block (10 lines × 2 locations) runtime/JavaScript/src/antlr4/atn/ATNConfig.js:84 — runtime/JavaScript/src/antlr4/atn/ATNConfig.js:84 · runtime/JavaScript/src/antlr4/atn/ATNConfig.js:109 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (10 lines × 2 locations) runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:1698 — runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:1698 · runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:1709 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2 locations) runtime/JavaScript/src/antlr4/atn/PredictionMode.js:436 — runtime/JavaScript/src/antlr4/atn/PredictionMode.js:436 · runtime/JavaScript/src/antlr4/atn/PredictionMode.js:543 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (10 lines × 2 locations) runtime/JavaScript/src/antlr4/atn/SemanticContext.js:162 — runtime/JavaScript/src/antlr4/atn/SemanticContext.js:162 · runtime/JavaScript/src/antlr4/atn/SemanticContext.js:261 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (10 lines × 2 locations) runtime/JavaScript/src/antlr4/context/ParserRuleContext.js:156 — runtime/JavaScript/src/antlr4/context/ParserRuleContext.js:156 · runtime/JavaScript/src/antlr4/context/ParserRuleContext.js:177 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
AX2 · Stateful singletons · Stateful shared instance · ×4
  • Stateful shared instance: ParserRuleContext runtime/CSharp/src/ParserRuleContext.cs:35 — `ParserRuleContext` keeps one instance of itself in the static `EMPTY`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_start, _stop, children; e.g. `_start` at line 136).
  • Stateful shared instance: ATNDeserializationOptions runtime/CSharp/src/Atn/ATNDeserializationOptions.cs:12 — `ATNDeserializationOptions` keeps one instance of itself in the static `defaultOptions`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (readOnly, verifyATN, generateRuleBypassTransitions, optimize; e.g. `readOnly` at line 63).
  • Stateful shared instance: TerminalNodeImpl runtime/CSharp/src/Tree/TerminalNodeImpl.cs:9 — `TerminalNodeImpl` is not registered, but the singleton `ParserRuleContext` creates it and keeps it in `children`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_parent; e.g. `_parent` at line 46).
  • Stateful shared instance: ATNConfigSet runtime/CSharp/src/Atn/ATNConfigSet.cs:14 — `ATNConfigSet` is not registered, but the singleton `DFAState` creates it and keeps it in `configSet`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (hasSemanticContext, dipsIntoOuterContext, cachedHashCode, readOnly, configLookup; e.g. `hasSemanticContext` at line 100).
D1 · Cyclomatic Complexity · ParserATNSimulator.computeReachSet (cyclomatic 24) · ×4
  • ParserATNSimulator.computeReachSet (cyclomatic 24) runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:747 — ParserATNSimulator.computeReachSet has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ParserATNSimulator.computeReachSet (cyclomatic 24) runtime/Python3/src/antlr4/atn/ParserATNSimulator.py:661 — ParserATNSimulator.computeReachSet has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ParserATNSimulator.computeReachSet (cyclomatic 24) runtime/Go/antlr/v4/parser_atn_simulator.go:526 — ParserATNSimulator.computeReachSet has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ParserATNSimulator.computeReachSet (cyclomatic 24) runtime/Swift/Sources/Antlr4/atn/ParserATNSimulator.swift:754 — ParserATNSimulator.computeReachSet has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ParseTreePatternMatcher.split (cyclomatic 21) · ×4
  • ParseTreePatternMatcher.split (cyclomatic 21) runtime/Java/src/org/antlr/v4/runtime/tree/pattern/ParseTreePatternMatcher.java:412 — ParseTreePatternMatcher.split has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ParseTreePatternMatcher.split (cyclomatic 21) runtime/Python3/src/antlr4/tree/ParseTreePatternMatcher.py:306 — ParseTreePatternMatcher.split has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ParseTreePatternMatcher.split (cyclomatic 21) runtime/Swift/Sources/Antlr4/tree/pattern/ParseTreePatternMatcher.swift:351 — ParseTreePatternMatcher.split has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ParseTreePatternMatcher.split (cyclomatic 21) runtime/Dart/lib/src/tree/src/pattern/parse_tree_match.dart:509 — ParseTreePatternMatcher.split has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LexerATNSimulator.closure (cyclomatic 18) · ×4
  • LexerATNSimulator.closure (cyclomatic 18) runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java:403 — LexerATNSimulator.closure has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • LexerATNSimulator.closure (cyclomatic 18) runtime/Python3/src/antlr4/atn/LexerATNSimulator.py:320 — LexerATNSimulator.closure has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • LexerATNSimulator.closure (cyclomatic 18) runtime/Go/antlr/v4/lexer_atn_simulator.go:349 — LexerATNSimulator.closure has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • LexerATNSimulator.closure (cyclomatic 18) runtime/JavaScript/src/antlr4/atn/LexerATNSimulator.js:354 — LexerATNSimulator.closure has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D17 · Explicit Debt · DeadPreprocessorBranch · ×4
  • DeadPreprocessorBranch runtime/CSharp/src/Misc/RuleDependencyChecker.cs:234 — #if false — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
  • DeadPreprocessorBranch runtime/CSharp/src/Misc/RuleDependencyChecker.cs:243 — #if false — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
  • DeadPreprocessorBranch runtime/CSharp/src/Misc/RuleDependencyChecker.cs:254 — #if false — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
  • DeadPreprocessorBranch runtime/CSharp/src/Misc/RuleDependencyChecker.cs:262 — #if false — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
D2 · Cognitive Complexity · LexerATNSimulator.execATN (cognitive 16) · ×4
  • LexerATNSimulator.execATN (cognitive 16) runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java:165 — LexerATNSimulator.execATN has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LexerATNSimulator.execATN (cognitive 16) runtime/Python3/src/antlr4/atn/LexerATNSimulator.py:137 — LexerATNSimulator.execATN has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LexerATNSimulator.execATN (cognitive 16) runtime/Go/antlr/v4/lexer_atn_simulator.go:141 — LexerATNSimulator.execATN has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LexerATNSimulator.execATN (cognitive 16) runtime/JavaScript/src/antlr4/atn/LexerATNSimulator.js:136 — LexerATNSimulator.execATN has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RuleContext.toString (cognitive 16) · ×4
  • RuleContext.toString (cognitive 16) runtime/Java/src/org/antlr/v4/runtime/RuleContext.java:224 — RuleContext.toString has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 4, ternaries 1 (3 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • RuleContext.toString (cognitive 16) runtime/Python3/src/antlr4/RuleContext.py:208 — RuleContext.toString has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 4, ternaries 1 (3 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • RuleContext.toString (cognitive 16) runtime/Swift/Sources/Antlr4/RuleContext.swift:206 — RuleContext.toString has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 4, ternaries 1 (3 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • RuleContext.toString (cognitive 16) runtime/Dart/lib/src/rule_context.dart:169 — RuleContext.toString has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 4, ternaries 1 (3 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D31 · IaC & Container Security · Medium IaC · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (35 corresponding lines) · ×4
  • Edited copy of a member (35 corresponding lines) runtime/Go/antlr/v4/parser_atn_simulator.go:1318 — runtime/Go/antlr/v4/parser_atn_simulator.go:1318-1352 | runtime/Go/antlr/v4/parser_atn_simulator.go:1355-1389 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) runtime/CSharp/src/Atn/LexerATNSimulator.cs:309 — runtime/CSharp/src/Atn/LexerATNSimulator.cs:309-350 | runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java:317-351 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) runtime/Dart/lib/src/atn/src/semantic_context.dart:271 — runtime/Dart/lib/src/atn/src/semantic_context.dart:271-305 | runtime/Dart/lib/src/atn/src/semantic_context.dart:375-409 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) runtime/CSharp/src/Atn/LexerATNSimulator.cs:703 — runtime/CSharp/src/Atn/LexerATNSimulator.cs:703-740 | runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java:668-702 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (28 corresponding lines) · ×4
  • Edited copy of a member (28 corresponding lines) runtime/Python3/src/antlr4/atn/ParserATNSimulator.py:1387 — runtime/Python3/src/antlr4/atn/ParserATNSimulator.py:1387-1414 | runtime/Python3/src/antlr4/atn/ParserATNSimulator.py:1417-1444 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/CodePointBuffer.java:243 — runtime/Java/src/org/antlr/v4/runtime/CodePointBuffer.java:243-276 | runtime/Java/src/org/antlr/v4/runtime/CodePointBuffer.java:278-305 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) runtime/CSharp/src/Atn/ParserATNSimulator.cs:2202 — runtime/CSharp/src/Atn/ParserATNSimulator.cs:2202-2235 | runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:2055-2082 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) runtime/CSharp/src/Atn/PredictionMode.cs:244 — runtime/CSharp/src/Atn/PredictionMode.cs:244-271 | runtime/Java/src/org/antlr/v4/runtime/atn/PredictionMode.java:212-245 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (23 corresponding lines) · ×4
  • Edited copy of a member (23 corresponding lines) runtime/CSharp/src/Atn/ParserATNSimulator.cs:955 — runtime/CSharp/src/Atn/ParserATNSimulator.cs:955-982 | runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:902-924 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) runtime/Swift/Sources/Antlr4/atn/SemanticContext.swift:241 — runtime/Swift/Sources/Antlr4/atn/SemanticContext.swift:241-266 | runtime/Swift/Sources/Antlr4/atn/SemanticContext.swift:335-357 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) runtime/Swift/Sources/Antlr4/misc/BitSet.swift:872 — runtime/Swift/Sources/Antlr4/misc/BitSet.swift:872-897 | runtime/Swift/Sources/Antlr4/misc/BitSet.swift:912-934 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) tool/src/org/antlr/v4/gui/TreeLayoutAdaptor.java:25 — tool/src/org/antlr/v4/gui/TreeLayoutAdaptor.java:25-47 | tool/src/org/antlr/v4/gui/TreeLayoutAdaptor.java:60-82 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×4
  • Duplicated block (11 lines × 2) runtime/Java/src/org/antlr/v4/runtime/misc/IntervalSet.java:585 — runtime/Java/src/org/antlr/v4/runtime/misc/IntervalSet.java:585-595 | runtime/Java/src/org/antlr/v4/runtime/misc/IntervalSet.java:600-610 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `runtime/Java/src/org/antlr/v4/runtime/misc/IntervalSet.java:585` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (11 lines × 2) tool/src/org/antlr/v4/semantics/AttributeChecks.java:172 — tool/src/org/antlr/v4/semantics/AttributeChecks.java:172-182 | tool/src/org/antlr/v4/semantics/AttributeChecks.java:186-196 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) tool/src/org/antlr/v4/tool/LeftRecursiveRule.java:123 — tool/src/org/antlr/v4/tool/LeftRecursiveRule.java:123-133 | tool/src/org/antlr/v4/tool/LeftRecursiveRule.java:137-147 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `tool/src/org/antlr/v4/tool/LeftRecursiveRule.java:123` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) tool/src/org/antlr/v4/parse/ScopeParser.java:283 — tool/src/org/antlr/v4/parse/ScopeParser.java:283-293 | tool/src/org/antlr/v4/parse/ScopeParser.java:294-304 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×4
  • Duplicated block (8 lines × 2) runtime/Java/src/org/antlr/v4/runtime/LexerInterpreter.java:52 — runtime/Java/src/org/antlr/v4/runtime/LexerInterpreter.java:52-59 | runtime/Java/src/org/antlr/v4/runtime/ParserInterpreter.java:102-109 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) runtime/Java/src/org/antlr/v4/runtime/misc/InterpreterDataReader.java:64 — runtime/Java/src/org/antlr/v4/runtime/misc/InterpreterDataReader.java:64-71 | runtime/Java/src/org/antlr/v4/runtime/misc/InterpreterDataReader.java:73-80 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `runtime/Java/src/org/antlr/v4/runtime/misc/InterpreterDataReader.java:82` calls `VocabularyImpl`, `toArray` and `runtime/Java/src/org/antlr/v4/runtime/misc/InterpreterDataReader.java:73` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) tool/src/org/antlr/v4/codegen/model/decl/AltLabelStructDecl.java:34 — tool/src/org/antlr/v4/codegen/model/decl/AltLabelStructDecl.java:34-41 | tool/src/org/antlr/v4/codegen/model/decl/StructDecl.java:63-70 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `tool/src/org/antlr/v4/codegen/model/decl/AltLabelStructDecl.java:34` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `tool/src/org/antlr/v4/codegen/model/decl/StructDecl.java:61` calls `hasAltSpecificContexts` and `tool/src/org/antlr/v4/codegen/model/decl/AltLabelStructDecl.java:33` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) tool/src/org/antlr/v4/semantics/ActionSniffer.java:33 — tool/src/org/antlr/v4/semantics/ActionSniffer.java:33-40 | tool/src/org/antlr/v4/semantics/AttributeChecks.java:36-43 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
R10 · Code Duplication · Duplicated block (12 lines × 2 locations) · ×4
  • Duplicated block (12 lines × 2 locations) runtime/JavaScript/src/antlr4/BufferedTokenStream.js:276 — runtime/JavaScript/src/antlr4/BufferedTokenStream.js:276 · runtime/JavaScript/src/antlr4/BufferedTokenStream.js:297 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (12 lines × 2 locations) runtime/JavaScript/src/antlr4/Parser.js:98 — runtime/JavaScript/src/antlr4/Parser.js:98 · runtime/JavaScript/src/antlr4/Parser.js:132 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2 locations) runtime/JavaScript/src/antlr4/TokenStreamRewriter.js:217 — runtime/JavaScript/src/antlr4/TokenStreamRewriter.js:217 · runtime/JavaScript/src/antlr4/TokenStreamRewriter.js:265 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (12 lines × 2 locations) runtime/JavaScript/src/antlr4/misc/IntervalSet.js:186 — runtime/JavaScript/src/antlr4/misc/IntervalSet.js:186 · runtime/JavaScript/src/antlr4/misc/IntervalSet.js:207 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
D1 · Cyclomatic Complexity · ParserATNSimulator.execATN (cyclomatic 22) · ×3
  • ParserATNSimulator.execATN (cyclomatic 22) runtime/Go/antlr/v4/parser_atn_simulator.go:214 — ParserATNSimulator.execATN has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ParserATNSimulator.execATN (cyclomatic 22) runtime/Swift/Sources/Antlr4/atn/ParserATNSimulator.swift:423 — ParserATNSimulator.execATN has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ParserATNSimulator.execATN (cyclomatic 22) runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:395 — ParserATNSimulator.execATN has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ParserATNSimulator.execATN (cyclomatic 21) · ×3
  • ParserATNSimulator.execATN (cyclomatic 21) runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:413 — ParserATNSimulator.execATN has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ParserATNSimulator.execATN (cyclomatic 21) runtime/Python3/src/antlr4/atn/ParserATNSimulator.py:386 — ParserATNSimulator.execATN has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ParserATNSimulator.execATN (cyclomatic 21) runtime/Dart/lib/src/atn/src/parser_atn_simulator.dart:401 — ParserATNSimulator.execATN has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ATNDeserializer.readEdges (cyclomatic 17) · ×3
  • ATNDeserializer.readEdges (cyclomatic 17) runtime/Python3/src/antlr4/atn/ATNDeserializer.py:137 — ATNDeserializer.readEdges has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ATNDeserializer.readEdges (cyclomatic 17) runtime/Go/antlr/v4/atn_deserializer.go:230 — ATNDeserializer.readEdges has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ATNDeserializer.readEdges (cyclomatic 17) runtime/JavaScript/src/antlr4/atn/ATNDeserializer.js:242 — ATNDeserializer.readEdges has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ATNDeserializer.verifyATN (cyclomatic 17) · ×3
  • ATNDeserializer.verifyATN (cyclomatic 17) runtime/Python3/src/antlr4/atn/ATNDeserializer.py:311 — ATNDeserializer.verifyATN has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ATNDeserializer.verifyATN (cyclomatic 17) runtime/Go/antlr/v4/atn_deserializer.go:471 — ATNDeserializer.verifyATN has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function taking that case's concrete type, so the dispatch reads one line per case. These arms are selected by TYPE rather than by value, so there is no key a lookup table could be built on; where you own the matched types, giving them one shared interface method and calling that is the form a table would have taken, and where you do not, keep the cases — they stay explicit and reviewable.
  • ATNDeserializer.verifyATN (cyclomatic 17) runtime/JavaScript/src/antlr4/atn/ATNDeserializer.js:463 — ATNDeserializer.verifyATN has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ATNDeserializer.verifyATN (cyclomatic 16) · ×3
  • ATNDeserializer.verifyATN (cyclomatic 16) runtime/Java/src/org/antlr/v4/runtime/atn/ATNDeserializer.java:409 — ATNDeserializer.verifyATN has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ATNDeserializer.verifyATN (cyclomatic 16) runtime/Swift/Sources/Antlr4/atn/ATNDeserializer.swift:423 — ATNDeserializer.verifyATN has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ATNDeserializer.verifyATN (cyclomatic 16) runtime/Dart/lib/src/atn/src/atn_deserializer.dart:450 — ATNDeserializer.verifyATN has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D2 · Cognitive Complexity · ParserATNSimulator.closure_ (cognitive 44) · ×3
  • ParserATNSimulator.closure_ (cognitive 44) runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:1504 — ParserATNSimulator.closure_ has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (39 pts), boolean chains 4, loops 1 (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • ParserATNSimulator.closure_ (cognitive 44) runtime/Dart/lib/src/atn/src/parser_atn_simulator.dart:1579 — ParserATNSimulator.closure_ has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (39 pts), boolean chains 4, loops 1 (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • ParserATNSimulator.closure_ (cognitive 44) runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:1260 — ParserATNSimulator.closure_ has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (39 pts), boolean chains 4, loops 1 (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · LexerATNSimulator.closure (cognitive 33) · ×3
  • LexerATNSimulator.closure (cognitive 33) runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java:403 — LexerATNSimulator.closure has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LexerATNSimulator.closure (cognitive 33) runtime/Python3/src/antlr4/atn/LexerATNSimulator.py:320 — LexerATNSimulator.closure has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LexerATNSimulator.closure (cognitive 33) runtime/JavaScript/src/antlr4/atn/LexerATNSimulator.js:354 — LexerATNSimulator.closure has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ATNDeserializer.verifyATN (cognitive 28) · ×3
  • ATNDeserializer.verifyATN (cognitive 28) runtime/Java/src/org/antlr/v4/runtime/atn/ATNDeserializer.java:409 — ATNDeserializer.verifyATN has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (24 pts), boolean chains 3, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ATNDeserializer.verifyATN (cognitive 28) runtime/Python3/src/antlr4/atn/ATNDeserializer.py:311 — ATNDeserializer.verifyATN has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (24 pts), boolean chains 3, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ATNDeserializer.verifyATN (cognitive 28) runtime/Dart/lib/src/atn/src/atn_deserializer.dart:450 — ATNDeserializer.verifyATN has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (24 pts), boolean chains 3, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PredictionContext.toDOTString (cognitive 28) · ×3
  • PredictionContext.toDOTString (cognitive 28) runtime/Java/src/org/antlr/v4/runtime/atn/PredictionContext.java:487 — PredictionContext.toDOTString has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 4 (6 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • PredictionContext.toDOTString (cognitive 28) runtime/Swift/Sources/Antlr4/atn/PredictionContext.swift:486 — PredictionContext.toDOTString has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 4 (6 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • PredictionContext.toDOTString (cognitive 28) runtime/Dart/lib/src/prediction_context.dart:474 — PredictionContext.toDOTString has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 4 (6 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserATNSimulator.execATNWithFullContext (cognitive 25) · ×3
  • ParserATNSimulator.execATNWithFullContext (cognitive 25) runtime/Go/antlr/v4/parser_atn_simulator.go:418 — ParserATNSimulator.execATNWithFullContext has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 2, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ParserATNSimulator.execATNWithFullContext (cognitive 25) runtime/Dart/lib/src/atn/src/parser_atn_simulator.dart:670 — ParserATNSimulator.execATNWithFullContext has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 2, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ParserATNSimulator.execATNWithFullContext (cognitive 25) runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:589 — ParserATNSimulator.execATNWithFullContext has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ATNDeserializer.generateRuleBypassTransition (cognitive 19) · ×3
  • ATNDeserializer.generateRuleBypassTransition (cognitive 19) runtime/Python3/src/antlr4/atn/ATNDeserializer.py:213 — ATNDeserializer.generateRuleBypassTransition has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ATNDeserializer.generateRuleBypassTransition (cognitive 19) runtime/Go/antlr/v4/atn_deserializer.go:341 — ATNDeserializer.generateRuleBypassTransition has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ATNDeserializer.generateRuleBypassTransition (cognitive 19) runtime/JavaScript/src/antlr4/atn/ATNDeserializer.js:348 — ATNDeserializer.generateRuleBypassTransition has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IntervalSet.add (cognitive 18) · ×3
  • IntervalSet.add (cognitive 18) runtime/Java/src/org/antlr/v4/runtime/misc/IntervalSet.java:108 — IntervalSet.add has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • IntervalSet.add (cognitive 18) runtime/Swift/Sources/Antlr4/misc/IntervalSet.swift:104 — IntervalSet.add has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • IntervalSet.add (cognitive 18) runtime/Dart/lib/src/interval_set.dart:225 — IntervalSet.add has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserATNSimulator.applyPrecedenceFilter (cognitive 17) · ×3
  • ParserATNSimulator.applyPrecedenceFilter (cognitive 17) runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:1112 — ParserATNSimulator.applyPrecedenceFilter has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ParserATNSimulator.applyPrecedenceFilter (cognitive 17) runtime/Go/antlr/v4/parser_atn_simulator.go:754 — ParserATNSimulator.applyPrecedenceFilter has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ParserATNSimulator.applyPrecedenceFilter (cognitive 17) runtime/Dart/lib/src/atn/src/parser_atn_simulator.dart:1087 — ParserATNSimulator.applyPrecedenceFilter has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserInterpreter.parse (cognitive 17) · ×3
  • ParserInterpreter.parse (cognitive 17) runtime/Python3/src/antlr4/ParserInterpreter.py:61 — ParserInterpreter.parse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 1 (3 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ParserInterpreter.parse (cognitive 17) runtime/Swift/Sources/Antlr4/ParserInterpreter.swift:120 — ParserInterpreter.parse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 1 (3 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ParserInterpreter.parse (cognitive 17) runtime/Dart/lib/src/parser_interpreter.dart:117 — ParserInterpreter.parse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 1 (3 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D3 · God Classes · MethodTooLong · ×3
  • MethodTooLong: ATNDeserializer.deserialize runtime/Java/src/org/antlr/v4/runtime/atn/ATNDeserializer.java:51 — MethodTooLong — deserialize runs 174 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 74 over it, 1.74× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: UnicodeDataTemplateController.addTR35ExtendedPictographicPropertyCodesToCodePointRanges tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java:227 — MethodTooLong — addTR35ExtendedPictographicPropertyCodesToCodePointRanges runs 138 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 38 over it, 1.38× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ATNDeserializer.deserialize runtime/Swift/Sources/Antlr4/atn/ATNDeserializer.swift:18 — MethodTooLong — deserialize runs 115 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 15 over it, 1.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication · Edited copy of a member (37 corresponding lines) · ×3
  • Edited copy of a member (37 corresponding lines) runtime/CSharp/src/Atn/ProfilingATNSimulator.cs:55 — runtime/CSharp/src/Atn/ProfilingATNSimulator.cs:55-96 | runtime/Java/src/org/antlr/v4/runtime/atn/ProfilingATNSimulator.java:56-92 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (37 corresponding lines) runtime/CSharp/src/Atn/SemanticContext.cs:240 — runtime/CSharp/src/Atn/SemanticContext.cs:240-276 | runtime/CSharp/src/Atn/SemanticContext.cs:358-394 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (37 corresponding lines) runtime/CSharp/src/Atn/ParserATNSimulator.cs:1867 — runtime/CSharp/src/Atn/ParserATNSimulator.cs:1867-1906 | runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:1750-1786 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (32 corresponding lines) · ×3
  • Edited copy of a member (32 corresponding lines) tool/src/org/antlr/v4/automata/ParserATNFactory.java:550 — tool/src/org/antlr/v4/automata/ParserATNFactory.java:550-581 | tool/src/org/antlr/v4/automata/ParserATNFactory.java:600-632 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/atn/SemanticContext.java:266 — runtime/Java/src/org/antlr/v4/runtime/atn/SemanticContext.java:266-297 | runtime/Java/src/org/antlr/v4/runtime/atn/SemanticContext.java:363-394 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) runtime/CSharp/src/Atn/ATNConfigSet.cs:95 — runtime/CSharp/src/Atn/ATNConfigSet.cs:95-129 | runtime/Java/src/org/antlr/v4/runtime/atn/ATNConfigSet.java:138-169 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×3
  • Edited copy of a member (22 corresponding lines) tool/src/org/antlr/v4/codegen/ParserFactory.java:114 — tool/src/org/antlr/v4/codegen/ParserFactory.java:114-142 | tool/src/org/antlr/v4/codegen/ParserFactory.java:153-174 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/ParserRuleContext.java:250 — runtime/Java/src/org/antlr/v4/runtime/ParserRuleContext.java:250-274 | runtime/Java/src/org/antlr/v4/runtime/ParserRuleContext.java:280-301 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) runtime/CSharp/src/BufferedTokenStream.cs:267 — runtime/CSharp/src/BufferedTokenStream.cs:267-288 | runtime/CSharp/src/BufferedTokenStream.cs:644-667 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×3
  • Edited copy of a member (20 corresponding lines) tool/src/org/antlr/v4/analysis/LeftRecursiveRuleAnalyzer.java:125 — tool/src/org/antlr/v4/analysis/LeftRecursiveRuleAnalyzer.java:125-152 | tool/src/org/antlr/v4/analysis/LeftRecursiveRuleAnalyzer.java:173-192 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) runtime/Dart/lib/src/atn/src/parser_atn_simulator.dart:2184 — runtime/Dart/lib/src/atn/src/parser_atn_simulator.dart:2184-2208 | runtime/Dart/lib/src/atn/src/parser_atn_simulator.dart:2210-2229 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/dfa/DFA.java:118 — runtime/Java/src/org/antlr/v4/runtime/dfa/DFA.java:118-137 | runtime/CSharp/src/Dfa/DFA.cs:112-135 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (34 corresponding lines) · ×3
  • Edited copy of a member (34 corresponding lines) runtime/Go/antlr/v4/semantic_context.go:270 — runtime/Go/antlr/v4/semantic_context.go:270-306 | runtime/Go/antlr/v4/semantic_context.go:417-450 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (34 corresponding lines) runtime/CSharp/src/Tree/Pattern/ParseTreePatternMatcher.cs:300 — runtime/CSharp/src/Tree/Pattern/ParseTreePatternMatcher.cs:300-334 | runtime/Java/src/org/antlr/v4/runtime/tree/pattern/ParseTreePatternMatcher.java:191-224 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (34 corresponding lines) runtime/CSharp/src/UnbufferedCharStream.cs:371 — runtime/CSharp/src/UnbufferedCharStream.cs:371-404 | runtime/CSharp/src/UnbufferedTokenStream.cs:326-360 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (24 corresponding lines) · ×3
  • Edited copy of a member (24 corresponding lines) runtime/CSharp/src/Atn/PredictionContext.cs:379 — runtime/CSharp/src/Atn/PredictionContext.cs:379-407 | runtime/Java/src/org/antlr/v4/runtime/atn/PredictionContext.java:301-324 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) runtime/Go/antlr/v4/utils.go:332 — runtime/Go/antlr/v4/utils.go:332-356 | runtime/Go/antlr/v4/utils.go:358-381 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) runtime/Python3/src/antlr4/atn/SemanticContext.py:210 — runtime/Python3/src/antlr4/atn/SemanticContext.py:210-233 | runtime/Python3/src/antlr4/atn/SemanticContext.py:294-317 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×3
  • Duplicated block (14 lines × 2) tool/src/org/antlr/v4/gui/Interpreter.java:169 — tool/src/org/antlr/v4/gui/Interpreter.java:169-182 | tool/src/org/antlr/v4/gui/TestRig.java:172-185 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (14 lines × 2) tool/src/org/antlr/v4/automata/ParserATNFactory.java:565 — tool/src/org/antlr/v4/automata/ParserATNFactory.java:565-578 | tool/src/org/antlr/v4/automata/ParserATNFactory.java:613-626 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) runtime/Go/antlr/v4/jcollect.go:185 — runtime/Go/antlr/v4/jcollect.go:185-198 | runtime/Go/antlr/v4/jcollect.go:326-339 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `runtime/Go/antlr/v4/jcollect.go:185` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
R4 · Test Coverage · No test reaches this file · ×3
  • No test reaches this file runtime/JavaScript/src/antlr4/context/InterpreterRuleContext.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file runtime/JavaScript/src/antlr4/utils/titleCase.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file runtime/JavaScript/src/antlr4/TokenSource.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
D1 · Cyclomatic Complexity · ParseTreePatternMatcher.matchImpl (cyclomatic 21) · ×2
  • ParseTreePatternMatcher.matchImpl (cyclomatic 21) runtime/Java/src/org/antlr/v4/runtime/tree/pattern/ParseTreePatternMatcher.java:256 — ParseTreePatternMatcher.matchImpl has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ParseTreePatternMatcher.matchImpl (cyclomatic 21) runtime/Python3/src/antlr4/tree/ParseTreePatternMatcher.py:195 — ParseTreePatternMatcher.matchImpl has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ParserATNSimulator.canDropLoopEntryEdgeInLeftRecursiveRule (cyclomatic 20) · ×2
  • ParserATNSimulator.canDropLoopEntryEdgeInLeftRecursiveRule (cyclomatic 20) runtime/Go/antlr/v4/parser_atn_simulator.go:1183 — ParserATNSimulator.canDropLoopEntryEdgeInLeftRecursiveRule has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ParserATNSimulator.canDropLoopEntryEdgeInLeftRecursiveRule (cyclomatic 20) runtime/Swift/Sources/Antlr4/atn/ParserATNSimulator.swift:1570 — ParserATNSimulator.canDropLoopEntryEdgeInLeftRecursiveRule has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ParserATNSimulator.canDropLoopEntryEdgeInLeftRecursiveRule (cyclomatic 19) · ×2
  • ParserATNSimulator.canDropLoopEntryEdgeInLeftRecursiveRule (cyclomatic 19) runtime/Dart/lib/src/atn/src/parser_atn_simulator.dart:1661 — ParserATNSimulator.canDropLoopEntryEdgeInLeftRecursiveRule has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ParserATNSimulator.canDropLoopEntryEdgeInLeftRecursiveRule (cyclomatic 19) runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:1316 — ParserATNSimulator.canDropLoopEntryEdgeInLeftRecursiveRule has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PredictionContext.mergeSingletons (cyclomatic 18) · ×2
  • PredictionContext.mergeSingletons (cyclomatic 18) runtime/Java/src/org/antlr/v4/runtime/atn/PredictionContext.java:194 — PredictionContext.mergeSingletons has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • PredictionContext.mergeSingletons (cyclomatic 18) runtime/Python3/src/antlr4/PredictionContext.py:307 — PredictionContext.mergeSingletons has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D2 · Cognitive Complexity · ParserATNSimulator.execATN (cognitive 51) · ×2
  • ParserATNSimulator.execATN (cognitive 51) runtime/Python3/src/antlr4/atn/ParserATNSimulator.py:386 — ParserATNSimulator.execATN has cognitive complexity 51 (threshold 15). Drivers by points: if/else 17 (48 pts), boolean chains 2, loops 1 (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • ParserATNSimulator.execATN (cognitive 51) runtime/Go/antlr/v4/parser_atn_simulator.go:214 — ParserATNSimulator.execATN has cognitive complexity 51 (threshold 15). Drivers by points: if/else 16 (45 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ParserATNSimulator.execATN (cognitive 50) · ×2
  • ParserATNSimulator.execATN (cognitive 50) runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:413 — ParserATNSimulator.execATN has cognitive complexity 50 (threshold 15). Drivers by points: if/else 15 (44 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • ParserATNSimulator.execATN (cognitive 50) runtime/Dart/lib/src/atn/src/parser_atn_simulator.dart:401 — ParserATNSimulator.execATN has cognitive complexity 50 (threshold 15). Drivers by points: if/else 16 (44 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ParserATNSimulator.closure_ (cognitive 50) · ×2
  • ParserATNSimulator.closure_ (cognitive 50) runtime/Python3/src/antlr4/atn/ParserATNSimulator.py:1145 — ParserATNSimulator.closure_ has cognitive complexity 50 (threshold 15). Drivers by points: if/else 14 (47 pts), boolean chains 2, loops 1 (nesting depth added 33). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • ParserATNSimulator.closure_ (cognitive 50) runtime/Swift/Sources/Antlr4/atn/ParserATNSimulator.swift:1394 — ParserATNSimulator.closure_ has cognitive complexity 50 (threshold 15). Drivers by points: if/else 15 (46 pts), boolean chains 3, loops 1 (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PredictionContext.mergeArrays (cognitive 48) · ×2
  • PredictionContext.mergeArrays (cognitive 48) runtime/Java/src/org/antlr/v4/runtime/atn/PredictionContext.java:345 — PredictionContext.mergeArrays has cognitive complexity 48 (threshold 15). Drivers by points: if/else 23 (39 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • PredictionContext.mergeArrays (cognitive 48) runtime/Python3/src/antlr4/PredictionContext.py:443 — PredictionContext.mergeArrays has cognitive complexity 48 (threshold 15). Drivers by points: if/else 22 (38 pts), boolean chains 5, loops 3 (5 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LL1Analyzer._LOOK (cognitive 40) · ×2
  • LL1Analyzer._LOOK (cognitive 40) runtime/Java/src/org/antlr/v4/runtime/atn/LL1Analyzer.java:137 — LL1Analyzer._LOOK has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (34 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LL1Analyzer._LOOK (cognitive 40) runtime/JavaScript/src/antlr4/atn/LL1Analyzer.js:113 — LL1Analyzer._LOOK has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (34 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ATNDeserializer.readEdges (cognitive 40) · ×2
  • ATNDeserializer.readEdges (cognitive 40) runtime/Go/antlr/v4/atn_deserializer.go:230 — ATNDeserializer.readEdges has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (29 pts), loops 6 (11 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ATNDeserializer.readEdges (cognitive 40) runtime/JavaScript/src/antlr4/atn/ATNDeserializer.js:242 — ATNDeserializer.readEdges has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (29 pts), loops 6 (11 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserATNSimulator.computeReachSet (cognitive 36) · ×2
  • ParserATNSimulator.computeReachSet (cognitive 36) runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:747 — ParserATNSimulator.computeReachSet has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (25 pts), loops 4 (7 pts), boolean chains 4 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ParserATNSimulator.computeReachSet (cognitive 36) runtime/Python3/src/antlr4/atn/ParserATNSimulator.py:661 — ParserATNSimulator.computeReachSet has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (25 pts), loops 4 (7 pts), boolean chains 4 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PredictionContext.toStrings (cognitive 34) · ×2
  • PredictionContext.toStrings (cognitive 34) runtime/Java/src/org/antlr/v4/runtime/atn/PredictionContext.java:660 — PredictionContext.toStrings has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (26 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • PredictionContext.toStrings (cognitive 34) runtime/Dart/lib/src/prediction_context.dart:652 — PredictionContext.toStrings has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (26 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PredictionContext.mergeSingletons (cognitive 32) · ×2
  • PredictionContext.mergeSingletons (cognitive 32) runtime/Java/src/org/antlr/v4/runtime/atn/PredictionContext.java:194 — PredictionContext.mergeSingletons has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (30 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • PredictionContext.mergeSingletons (cognitive 32) runtime/Python3/src/antlr4/PredictionContext.py:307 — PredictionContext.mergeSingletons has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (30 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParseTreePatternMatcher.split (cognitive 29) · ×2
  • ParseTreePatternMatcher.split (cognitive 29) runtime/Java/src/org/antlr/v4/runtime/tree/pattern/ParseTreePatternMatcher.java:412 — ParseTreePatternMatcher.split has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (24 pts), loops 4, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ParseTreePatternMatcher.split (cognitive 29) runtime/Dart/lib/src/tree/src/pattern/parse_tree_match.dart:509 — ParseTreePatternMatcher.split has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (24 pts), loops 4, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserATNSimulator.closureCheckingStopState (cognitive 28) · ×2
  • ParserATNSimulator.closureCheckingStopState (cognitive 28) runtime/Swift/Sources/Antlr4/atn/ParserATNSimulator.swift:1326 — ParserATNSimulator.closureCheckingStopState has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 1 (3 pts) (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • ParserATNSimulator.closureCheckingStopState (cognitive 28) runtime/Dart/lib/src/atn/src/parser_atn_simulator.dart:1488 — ParserATNSimulator.closureCheckingStopState has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 1 (3 pts) (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Parser.consume (cognitive 21) · ×2
  • Parser.consume (cognitive 21) runtime/Java/src/org/antlr/v4/runtime/Parser.java:568 — Parser.consume has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (8 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Parser.consume (cognitive 21) runtime/Dart/lib/src/parser.dart:379 — Parser.consume has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (8 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserATNSimulator.canDropLoopEntryEdgeInLeftRecursiveRule (cognitive 20) · ×2
  • ParserATNSimulator.canDropLoopEntryEdgeInLeftRecursiveRule (cognitive 20) runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:1666 — ParserATNSimulator.canDropLoopEntryEdgeInLeftRecursiveRule has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 4, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ParserATNSimulator.canDropLoopEntryEdgeInLeftRecursiveRule (cognitive 20) runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:1316 — ParserATNSimulator.canDropLoopEntryEdgeInLeftRecursiveRule has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 4, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParseTreePatternMatcher.tokenize (cognitive 20) · ×2
  • ParseTreePatternMatcher.tokenize (cognitive 20) runtime/Java/src/org/antlr/v4/runtime/tree/pattern/ParseTreePatternMatcher.java:365 — ParseTreePatternMatcher.tokenize has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ParseTreePatternMatcher.tokenize (cognitive 20) runtime/Dart/lib/src/tree/src/pattern/parse_tree_match.dart:461 — ParseTreePatternMatcher.tokenize has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LexerATNSimulator.getEpsilonTarget (cognitive 20) · ×2
  • LexerATNSimulator.getEpsilonTarget (cognitive 20) runtime/Go/antlr/v4/lexer_atn_simulator.go:406 — LexerATNSimulator.getEpsilonTarget has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LexerATNSimulator.getEpsilonTarget (cognitive 20) runtime/JavaScript/src/antlr4/atn/LexerATNSimulator.js:409 — LexerATNSimulator.getEpsilonTarget has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PredictionContext.getCachedContext (cognitive 18) · ×2
  • PredictionContext.getCachedContext (cognitive 18) runtime/Java/src/org/antlr/v4/runtime/atn/PredictionContext.java:544 — PredictionContext.getCachedContext has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • PredictionContext.getCachedContext (cognitive 18) runtime/Dart/lib/src/prediction_context.dart:539 — PredictionContext.getCachedContext has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TokenStreamRewriter.getText (cognitive 18) · ×2
  • TokenStreamRewriter.getText (cognitive 18) runtime/Java/src/org/antlr/v4/runtime/TokenStreamRewriter.java:383 — TokenStreamRewriter.getText has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TokenStreamRewriter.getText (cognitive 18) runtime/Swift/Sources/Antlr4/TokenStreamRewriter.swift:572 — TokenStreamRewriter.getText has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IntervalSet.toString (cognitive 16) · ×2
  • IntervalSet.toString (cognitive 16) runtime/Java/src/org/antlr/v4/runtime/misc/IntervalSet.java:475 — IntervalSet.toString has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • IntervalSet.toString (cognitive 16) runtime/Swift/Sources/Antlr4/misc/IntervalSet.swift:547 — IntervalSet.toString has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserInterpreter.visitState (cognitive 16) · ×2
  • ParserInterpreter.visitState (cognitive 16) runtime/Python3/src/antlr4/ParserInterpreter.py:99 — ParserInterpreter.visitState has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ParserInterpreter.visitState (cognitive 16) runtime/Dart/lib/src/parser_interpreter.dart:184 — ParserInterpreter.visitState has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×2
  • Edited copy of a member (27 corresponding lines) tool/src/org/antlr/v4/codegen/model/ListenerFile.java:41 — tool/src/org/antlr/v4/codegen/model/ListenerFile.java:41-68 | tool/src/org/antlr/v4/codegen/model/VisitorFile.java:38-64 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) runtime/CSharp/src/Atn/SemanticContext.cs:172 — runtime/CSharp/src/Atn/SemanticContext.cs:172-198 | runtime/CSharp/src/Atn/SemanticContext.cs:290-316 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (36 corresponding lines) · ×2
  • Edited copy of a member (36 corresponding lines) runtime/CSharp/src/Atn/ATNDeserializer.cs:960 — runtime/CSharp/src/Atn/ATNDeserializer.cs:960-1032 | runtime/Java/src/org/antlr/v4/runtime/atn/ATNDeserializer.java:497-532 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) runtime/CSharp/src/Misc/IntervalSet.cs:813 — runtime/CSharp/src/Misc/IntervalSet.cs:813-857 | runtime/Java/src/org/antlr/v4/runtime/misc/IntervalSet.java:650-685 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (40 corresponding lines) · ×2
  • Edited copy of a member (40 corresponding lines) runtime/Swift/Sources/Antlr4/atn/ParserATNSimulator.swift:1707 — runtime/Swift/Sources/Antlr4/atn/ParserATNSimulator.swift:1707-1747 | runtime/Swift/Sources/Antlr4/atn/ParserATNSimulator.swift:1750-1789 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (40 corresponding lines) runtime/CSharp/src/Atn/ParserATNSimulator.cs:1246 — runtime/CSharp/src/Atn/ParserATNSimulator.cs:1246-1290 | runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:1171-1210 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (41 corresponding lines) · ×2
  • Edited copy of a member (41 corresponding lines) runtime/Dart/lib/src/atn/src/parser_atn_simulator.dart:1886 — runtime/Dart/lib/src/atn/src/parser_atn_simulator.dart:1886-1926 | runtime/Dart/lib/src/atn/src/parser_atn_simulator.dart:1928-1974 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (41 corresponding lines) runtime/Go/antlr/v4/semantic_context.go:198 — runtime/Go/antlr/v4/semantic_context.go:198-238 | runtime/Go/antlr/v4/semantic_context.go:347-388 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (29 corresponding lines) · ×2
  • Edited copy of a member (29 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/UnbufferedCharStream.java:278 — runtime/Java/src/org/antlr/v4/runtime/UnbufferedCharStream.java:278-306 | runtime/Java/src/org/antlr/v4/runtime/UnbufferedTokenStream.java:243-271 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) runtime/CSharp/src/Atn/PredictionContext.cs:102 — runtime/CSharp/src/Atn/PredictionContext.cs:102-135 | runtime/Java/src/org/antlr/v4/runtime/atn/PredictionContext.java:137-165 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 7+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 7+ corresponding lines) runtime/Swift/Sources/Antlr4/atn/ParserATNSimulator.swift:2013 — runtime/Swift/Sources/Antlr4/atn/ParserATNSimulator.swift:2013-2019 | runtime/Swift/Sources/Antlr4/atn/ParserATNSimulator.swift:2021-2027 | runtime/Swift/Sources/Antlr4/atn/ParserATNSimulator.swift:2033-2046 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 7+ corresponding lines) runtime/CSharp/src/DiagnosticErrorListener.cs:75 — runtime/CSharp/src/DiagnosticErrorListener.cs:75-86 | runtime/CSharp/src/DiagnosticErrorListener.cs:89-95 | runtime/CSharp/src/DiagnosticErrorListener.cs:98-104 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 12+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 12+ corresponding lines) runtime/Swift/Sources/Antlr4/DiagnosticErrorListener.swift:55 — runtime/Swift/Sources/Antlr4/DiagnosticErrorListener.swift:55-72 | runtime/Swift/Sources/Antlr4/DiagnosticErrorListener.swift:74-85 | runtime/Swift/Sources/Antlr4/DiagnosticErrorListener.swift:87-98 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) runtime/Swift/Sources/Antlr4/misc/BitSet.swift:253 — runtime/Swift/Sources/Antlr4/misc/BitSet.swift:253-266 | runtime/Swift/Sources/Antlr4/misc/BitSet.swift:321-333 | runtime/Swift/Sources/Antlr4/misc/BitSet.swift:511-522 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 9+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 9+ corresponding lines) runtime/Dart/lib/src/error/src/diagnostic_error_listener.dart:42 — runtime/Dart/lib/src/error/src/diagnostic_error_listener.dart:42-56 | runtime/Dart/lib/src/error/src/diagnostic_error_listener.dart:58-73 | runtime/Dart/lib/src/error/src/diagnostic_error_listener.dart:75-83 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) runtime/CSharp/src/Atn/ParserATNSimulator.cs:2281 — runtime/CSharp/src/Atn/ParserATNSimulator.cs:2281-2290 | runtime/CSharp/src/Atn/ParserATNSimulator.cs:2293-2301 | runtime/CSharp/src/Atn/ParserATNSimulator.cs:2310-2320 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 6+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 6+ corresponding lines) runtime/Swift/Sources/Antlr4/atn/AmbiguityInfo.swift:61 — runtime/Swift/Sources/Antlr4/atn/AmbiguityInfo.swift:61-69 | runtime/Swift/Sources/Antlr4/atn/ErrorInfo.swift:36-41 | runtime/Swift/Sources/Antlr4/atn/LookaheadEventInfo.swift:31-36 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 6+ corresponding lines) runtime/Java/src/org/antlr/v4/runtime/atn/LexerChannelAction.java:70 — runtime/Java/src/org/antlr/v4/runtime/atn/LexerChannelAction.java:70-75 | runtime/Java/src/org/antlr/v4/runtime/atn/LexerCustomAction.java:101-107 | runtime/Java/src/org/antlr/v4/runtime/atn/LexerTypeAction.java:68-73 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×2
  • Duplicated block (5 lines × 3) runtime/CSharp/src/Atn/LexerMoreAction.cs:82 — runtime/CSharp/src/Atn/LexerMoreAction.cs:82-86 | runtime/CSharp/src/Atn/LexerPopModeAction.cs:82-86 | runtime/CSharp/src/Atn/LexerSkipAction.cs:82-86 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 3) runtime/Java/src/org/antlr/v4/runtime/atn/LexerMoreAction.java:62 — runtime/Java/src/org/antlr/v4/runtime/atn/LexerMoreAction.java:62-66 | runtime/Java/src/org/antlr/v4/runtime/atn/LexerPopModeAction.java:62-66 | runtime/Java/src/org/antlr/v4/runtime/atn/LexerSkipAction.java:62-66 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×2
  • Duplicated block (20 lines × 2) runtime/Python3/src/antlr4/atn/ParserATNSimulator.py:1395 — runtime/Python3/src/antlr4/atn/ParserATNSimulator.py:1395-1414 | runtime/Python3/src/antlr4/atn/ParserATNSimulator.py:1425-1444 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (20 lines × 2) runtime/Go/antlr/v4/parser_atn_simulator.go:1329 — runtime/Go/antlr/v4/parser_atn_simulator.go:1329-1348 | runtime/Go/antlr/v4/parser_atn_simulator.go:1366-1385 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `runtime/Go/antlr/v4/parser_atn_simulator.go:1329` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D44 · Platform End-of-Life · End-of-life runtime · ×2
  • End-of-life runtime: .NET net5.0 runtime/CSharp/tests/issue-2693/Test.csproj:4 — runtime/CSharp/tests/issue-2693/Test.csproj declares .NET net5.0 as this project's target framework, and .NET 5, support ended 2022-05-10. An unsupported runtime receives no security patches, so every vulnerability disclosed in it since 2022-05-10 is present and unfixable without moving off it. This is a migration rather than an upgrade: there is no newer release of a runtime that has ended.
  • End-of-life runtime: .NET net5.0 runtime/CSharp/tests/issue-3079/Test.csproj:4 — runtime/CSharp/tests/issue-3079/Test.csproj declares .NET net5.0 as this project's target framework, and .NET 5, support ended 2022-05-10. An unsupported runtime receives no security patches, so every vulnerability disclosed in it since 2022-05-10 is present and unfixable without moving off it. This is a migration rather than an upgrade: there is no newer release of a runtime that has ended.
D6 · Cohesion (LCOM4) · Low cohesion · ×2
  • Low cohesion: Parser (LCOM4 8) runtime/Java/src/org/antlr/v4/runtime/Parser.java:38 — Parser's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Recognizer (LCOM4 5) runtime/CSharp/src/Recognizer.cs:14 — Recognizer's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
R10 · Code Duplication · Duplicated block (24 lines × 2 locations) · ×2
  • Duplicated block (24 lines × 2 locations) runtime/JavaScript/src/antlr4/action/LexerChannelAction.js:14 — runtime/JavaScript/src/antlr4/action/LexerChannelAction.js:14 · runtime/JavaScript/src/antlr4/action/LexerTypeAction.js:13 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
  • Duplicated block (24 lines × 2 locations) runtime/JavaScript/src/antlr4/action/LexerModeAction.js:12 — runtime/JavaScript/src/antlr4/action/LexerModeAction.js:12 · runtime/JavaScript/src/antlr4/action/LexerPushModeAction.js:12 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R10 · Code Duplication · Duplicated block with local edits (10 matched lines × 2 locations) · ×2
  • Duplicated block with local edits (10 matched lines × 2 locations) runtime/JavaScript/src/antlr4/BufferedTokenStream.js:160 — runtime/JavaScript/src/antlr4/BufferedTokenStream.js:160 · runtime/JavaScript/src/antlr4/BufferedTokenStream.js:361 — the two spans are one implementation copied and then locally edited — 71 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (10 matched lines × 2 locations) runtime/JavaScript/src/antlr4/Parser.js:508 — runtime/JavaScript/src/antlr4/Parser.js:508 · runtime/JavaScript/src/antlr4/atn/ATN.js:132 — the two spans are one implementation copied and then locally edited — 90 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
SC1 · Supply-chain hygiene · JavaScript dependencies are not locked · ×2
  • JavaScript dependencies are not locked runtime/JavaScript/spec/imports/builds/node-cjs-ts/package.json:12 — runtime/JavaScript/spec/imports/builds/node-cjs-ts/package.json declares dependencies that no committed lockfile resolves — there is no REDACTED / yarn.lock / pnpm-lock.yaml / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
  • JavaScript dependencies are not locked runtime/JavaScript/spec/imports/builds/node-esm-ts/package.json:12 — runtime/JavaScript/spec/imports/builds/node-esm-ts/package.json declares dependencies that no committed lockfile resolves — there is no REDACTED / yarn.lock / pnpm-lock.yaml / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
D1 · Cyclomatic Complexity · ATNDeserializer.deserialize (cyclomatic 54) · ×1
  • ATNDeserializer.deserialize (cyclomatic 54) runtime/Java/src/org/antlr/v4/runtime/atn/ATNDeserializer.java:51 — ATNDeserializer.deserialize has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · antlr.reduceToSingleOperationPerIndex (cyclomatic 40) · ×1
  • antlr.reduceToSingleOperationPerIndex (cyclomatic 40) runtime/Go/antlr/v4/tokenstream_rewriter.go:537 — antlr.reduceToSingleOperationPerIndex has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GrammarTransformPipeline.integrateImportedGrammars (cyclomatic 39) · ×1
  • GrammarTransformPipeline.integrateImportedGrammars (cyclomatic 39) tool/src/org/antlr/v4/tool/GrammarTransformPipeline.java:156 — GrammarTransformPipeline.integrateImportedGrammars has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RewriteOperationArray.reduceToSingleOperationPerIndex (cyclomatic 33) · ×1
  • RewriteOperationArray.reduceToSingleOperationPerIndex (cyclomatic 33) runtime/Swift/Sources/Antlr4/TokenStreamRewriter.swift:247 — RewriteOperationArray.reduceToSingleOperationPerIndex has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ATNDeserializer.InlineSetRules (cyclomatic 31) · ×1
  • ATNDeserializer.InlineSetRules (cyclomatic 31) runtime/CSharp/src/Atn/ATNDeserializer.cs:573 — ATNDeserializer.InlineSetRules has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CodeGenPipeline.process (cyclomatic 31) · ×1
  • CodeGenPipeline.process (cyclomatic 31) tool/src/org/antlr/v4/codegen/CodeGenPipeline.java:22 — CodeGenPipeline.process has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TokenStreamRewriter.reduceToSingleOperationPerIndex (cyclomatic 31) · ×1
  • TokenStreamRewriter.reduceToSingleOperationPerIndex (cyclomatic 31) runtime/JavaScript/src/antlr4/TokenStreamRewriter.js:215 — TokenStreamRewriter.reduceToSingleOperationPerIndex has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PredictionContext.MergeArrays (cyclomatic 30) · ×1
  • PredictionContext.MergeArrays (cyclomatic 30) runtime/CSharp/src/Atn/PredictionContext.cs:225 — PredictionContext.MergeArrays has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TokenStreamRewriter.reduceToSingleOperationPerIndex (cyclomatic 30) · ×1
  • TokenStreamRewriter.reduceToSingleOperationPerIndex (cyclomatic 30) runtime/Java/src/org/antlr/v4/runtime/TokenStreamRewriter.java:478 — TokenStreamRewriter.reduceToSingleOperationPerIndex has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · antlr.mergeArrays (cyclomatic 30) · ×1
  • antlr.mergeArrays (cyclomatic 30) runtime/Go/antlr/v4/prediction_context.go:546 — antlr.mergeArrays has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PredictionContextUtils.mergeArrays (cyclomatic 30) · ×1
  • PredictionContextUtils.mergeArrays (cyclomatic 30) runtime/JavaScript/src/antlr4/context/PredictionContextUtils.js:131 — PredictionContextUtils.mergeArrays has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TokenStreamRewriter.ReduceToSingleOperationPerIndex (cyclomatic 29) · ×1
  • TokenStreamRewriter.ReduceToSingleOperationPerIndex (cyclomatic 29) runtime/CSharp/src/TokenStreamRewriter.cs:567 — TokenStreamRewriter.ReduceToSingleOperationPerIndex has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PredictionContext.mergeArrays (cyclomatic 29) · ×1
  • PredictionContext.mergeArrays (cyclomatic 29) runtime/Python3/src/antlr4/PredictionContext.py:443 — PredictionContext.mergeArrays has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ScopeParser._splitArgumentList (cyclomatic 28) · ×1
  • ScopeParser._splitArgumentList (cyclomatic 28) tool/src/org/antlr/v4/parse/ScopeParser.java:265 — ScopeParser._splitArgumentList has cyclomatic complexity 28 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · DOTGenerator.getDOT (cyclomatic 28) · ×1
  • DOTGenerator.getDOT (cyclomatic 28) tool/src/org/antlr/v4/tool/DOTGenerator.java:181 — DOTGenerator.getDOT has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PredictionContext.mergeArrays (cyclomatic 28) · ×1
  • PredictionContext.mergeArrays (cyclomatic 28) runtime/Java/src/org/antlr/v4/runtime/atn/PredictionContext.java:345 — PredictionContext.mergeArrays has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RuleDependencyChecker.CheckDependencies (cyclomatic 27) · ×1
  • RuleDependencyChecker.CheckDependencies (cyclomatic 27) runtime/CSharp/src/Misc/RuleDependencyChecker.cs:81 — RuleDependencyChecker.CheckDependencies has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TokenStreamRewriter._reduceToSingleOperationPerIndex (cyclomatic 27) · ×1
  • TokenStreamRewriter._reduceToSingleOperationPerIndex (cyclomatic 27) runtime/Python3/src/antlr4/TokenStreamRewriter.py:140 — TokenStreamRewriter._reduceToSingleOperationPerIndex has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ParserATNSimulator.computeReachSet (cyclomatic 26) · ×1
  • ParserATNSimulator.computeReachSet (cyclomatic 26) runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:698 — ParserATNSimulator.computeReachSet has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PredictionContext.mergeArrays (cyclomatic 25) · ×1
  • PredictionContext.mergeArrays (cyclomatic 25) runtime/Dart/lib/src/prediction_context.dart:319 — PredictionContext.mergeArrays has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ParserATNSimulator.ComputeReachSet (cyclomatic 24) · ×1
  • ParserATNSimulator.ComputeReachSet (cyclomatic 24) runtime/CSharp/src/Atn/ParserATNSimulator.cs:786 — ParserATNSimulator.ComputeReachSet has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ATNOptimizer.optimizeSets (cyclomatic 24) · ×1
  • ATNOptimizer.optimizeSets (cyclomatic 24) tool/src/org/antlr/v4/automata/ATNOptimizer.java:41 — ATNOptimizer.optimizeSets has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Tool.handleArgs (cyclomatic 23) · ×1
  • Tool.handleArgs (cyclomatic 23) tool/src/org/antlr/v4/Tool.java:198 — Tool.handleArgs has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LL1Analyzer.look1 (cyclomatic 23) · ×1
  • LL1Analyzer.look1 (cyclomatic 23) runtime/Go/antlr/v4/ll1_analyzer.go:122 — LL1Analyzer.look1 has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ATNDeserializer.OptimizeSets (cyclomatic 22) · ×1
  • ATNDeserializer.OptimizeSets (cyclomatic 22) runtime/CSharp/src/Atn/ATNDeserializer.cs:774 — ATNDeserializer.OptimizeSets has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LL1Analyzer.Look_ (cyclomatic 22) · ×1
  • LL1Analyzer.Look_ (cyclomatic 22) runtime/CSharp/src/Atn/LL1Analyzer.cs:142 — LL1Analyzer.Look_ has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ParserATNSimulator.ExecATN (cyclomatic 22) · ×1
  • ParserATNSimulator.ExecATN (cyclomatic 22) runtime/CSharp/src/Atn/ParserATNSimulator.cs:418 — ParserATNSimulator.ExecATN has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CharSupport.getStringFromGrammarStringLiteral (cyclomatic 22) · ×1
  • CharSupport.getStringFromGrammarStringLiteral (cyclomatic 22) tool/src/org/antlr/v4/misc/CharSupport.java:86 — CharSupport.getStringFromGrammarStringLiteral has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EscapeSequenceParsing.parseEscape (cyclomatic 22) · ×1
  • EscapeSequenceParsing.parseEscape (cyclomatic 22) tool/src/org/antlr/v4/misc/EscapeSequenceParsing.java:83 — EscapeSequenceParsing.parseEscape has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ATNDeserializer.CombineChainedEpsilons (cyclomatic 21) · ×1
  • ATNDeserializer.CombineChainedEpsilons (cyclomatic 21) runtime/CSharp/src/Atn/ATNDeserializer.cs:705 — ATNDeserializer.CombineChainedEpsilons has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ParseTreePatternMatcher.MatchImpl (cyclomatic 21) · ×1
  • ParseTreePatternMatcher.MatchImpl (cyclomatic 21) runtime/CSharp/src/Tree/Pattern/ParseTreePatternMatcher.cs:390 — ParseTreePatternMatcher.MatchImpl has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ParseTreePatternMatcher.Split (cyclomatic 21) · ×1
  • ParseTreePatternMatcher.Split (cyclomatic 21) runtime/CSharp/src/Tree/Pattern/ParseTreePatternMatcher.cs:587 — ParseTreePatternMatcher.Split has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InterpreterDataReader.parseFile (cyclomatic 21) · ×1
  • InterpreterDataReader.parseFile (cyclomatic 21) runtime/Java/src/org/antlr/v4/runtime/misc/InterpreterDataReader.java:55 — InterpreterDataReader.parseFile has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InterpreterDataReader.init (cyclomatic 21) · ×1
  • InterpreterDataReader.init (cyclomatic 21) runtime/Swift/Sources/Antlr4/misc/InterpreterDataReader.swift:52 — InterpreterDataReader.init has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ParserATNSimulator.computeReachSet (cyclomatic 21) · ×1
  • ParserATNSimulator.computeReachSet (cyclomatic 21) runtime/Dart/lib/src/atn/src/parser_atn_simulator.dart:800 — ParserATNSimulator.computeReachSet has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Target.getTargetStringLiteralFromANTLRStringLiteral (cyclomatic 20) · ×1
  • Target.getTargetStringLiteralFromANTLRStringLiteral (cyclomatic 20) tool/src/org/antlr/v4/codegen/Target.java:237 — Target.getTargetStringLiteralFromANTLRStringLiteral has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GrammarTransformPipeline.extractImplicitLexer (cyclomatic 20) · ×1
  • GrammarTransformPipeline.extractImplicitLexer (cyclomatic 20) tool/src/org/antlr/v4/tool/GrammarTransformPipeline.java:385 — GrammarTransformPipeline.extractImplicitLexer has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ParserInterpreter.visitState (cyclomatic 20) · ×1
  • ParserInterpreter.visitState (cyclomatic 20) runtime/Swift/Sources/Antlr4/ParserInterpreter.swift:177 — ParserInterpreter.visitState has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LexerAction.swift.== (cyclomatic 20) · ×1
  • LexerAction.swift.== (cyclomatic 20) runtime/Swift/Sources/Antlr4/atn/LexerAction.swift:65 — LexerAction.swift.== has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · LexerATNFactory.createLexerAction (cyclomatic 19) · ×1
  • LexerATNFactory.createLexerAction (cyclomatic 19) tool/src/org/antlr/v4/automata/LexerATNFactory.java:634 — LexerATNFactory.createLexerAction has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OutputModelWalker.walk (cyclomatic 19) · ×1
  • OutputModelWalker.walk (cyclomatic 19) tool/src/org/antlr/v4/codegen/OutputModelWalker.java:54 — OutputModelWalker.walk has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ATNSerializer.addEdges (cyclomatic 19) · ×1
  • ATNSerializer.addEdges (cyclomatic 19) runtime/Java/src/org/antlr/v4/runtime/atn/ATNSerializer.java:159 — ATNSerializer.addEdges has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ATNDeserializer.deserialize (cyclomatic 19) · ×1
  • ATNDeserializer.deserialize (cyclomatic 19) runtime/Swift/Sources/Antlr4/atn/ATNDeserializer.swift:18 — ATNDeserializer.deserialize has cyclomatic complexity 19 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · PredictionContext.mergeArrays (cyclomatic 19) · ×1
  • PredictionContext.mergeArrays (cyclomatic 19) runtime/Swift/Sources/Antlr4/atn/PredictionContext.swift:371 — PredictionContext.mergeArrays has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ParseTreePatternMatcher.matchImpl (cyclomatic 19) · ×1
  • ParseTreePatternMatcher.matchImpl (cyclomatic 19) runtime/Swift/Sources/Antlr4/tree/pattern/ParseTreePatternMatcher.swift:210 — ParseTreePatternMatcher.matchImpl has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ParserInterpreter.visitState (cyclomatic 19) · ×1
  • ParserInterpreter.visitState (cyclomatic 19) runtime/Dart/lib/src/parser_interpreter.dart:184 — ParserInterpreter.visitState has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PredictionContext.mergeSingletons (cyclomatic 19) · ×1
  • PredictionContext.mergeSingletons (cyclomatic 19) runtime/Dart/lib/src/prediction_context.dart:155 — PredictionContext.mergeSingletons has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LexerATNSimulator.Closure (cyclomatic 18) · ×1
  • LexerATNSimulator.Closure (cyclomatic 18) runtime/CSharp/src/Atn/LexerATNSimulator.cs:407 — LexerATNSimulator.Closure has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ParserATNSimulator.CanDropLoopEntryEdgeInLeftRecursiveRule (cyclomatic 18) · ×1
  • ParserATNSimulator.CanDropLoopEntryEdgeInLeftRecursiveRule (cyclomatic 18) runtime/CSharp/src/Atn/ParserATNSimulator.cs:1777 — ParserATNSimulator.CanDropLoopEntryEdgeInLeftRecursiveRule has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PredictionContext.MergeSingletons (cyclomatic 18) · ×1
  • PredictionContext.MergeSingletons (cyclomatic 18) runtime/CSharp/src/Atn/PredictionContext.cs:137 — PredictionContext.MergeSingletons has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ParserInterpreter.VisitState (cyclomatic 18) · ×1
  • ParserInterpreter.VisitState (cyclomatic 18) runtime/CSharp/src/ParserInterpreter.cs:184 — ParserInterpreter.VisitState has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ParserInterpreter.visitState (cyclomatic 18) · ×1
  • ParserInterpreter.visitState (cyclomatic 18) runtime/Java/src/org/antlr/v4/runtime/ParserInterpreter.java:219 — ParserInterpreter.visitState has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · antlr.mergeSingletons (cyclomatic 18) · ×1
  • antlr.mergeSingletons (cyclomatic 18) runtime/Go/antlr/v4/prediction_context.go:387 — antlr.mergeSingletons has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ATNDeserializer.readEdges (cyclomatic 18) · ×1
  • ATNDeserializer.readEdges (cyclomatic 18) runtime/Dart/lib/src/atn/src/atn_deserializer.dart:222 — ATNDeserializer.readEdges has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LexerATNSimulator.getEpsilonTarget (cyclomatic 18) · ×1
  • LexerATNSimulator.getEpsilonTarget (cyclomatic 18) runtime/Dart/lib/src/atn/src/lexer_atn_simulator.dart:508 — LexerATNSimulator.getEpsilonTarget has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PredictionContextUtils.mergeSingletons (cyclomatic 18) · ×1
  • PredictionContextUtils.mergeSingletons (cyclomatic 18) runtime/JavaScript/src/antlr4/context/PredictionContextUtils.js:292 — PredictionContextUtils.mergeSingletons has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ATNDeserializer.GenerateRuleBypassTransitions (cyclomatic 17) · ×1
  • ATNDeserializer.GenerateRuleBypassTransitions (cyclomatic 17) runtime/CSharp/src/Atn/ATNDeserializer.cs:88 — ATNDeserializer.GenerateRuleBypassTransitions has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ATNDeserializer.ReadEdges (cyclomatic 17) · ×1
  • ATNDeserializer.ReadEdges (cyclomatic 17) runtime/CSharp/src/Atn/ATNDeserializer.cs:219 — ATNDeserializer.ReadEdges has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ParserATNSimulator.Closure_ (cyclomatic 17) · ×1
  • ParserATNSimulator.Closure_ (cyclomatic 17) runtime/CSharp/src/Atn/ParserATNSimulator.cs:1606 — ParserATNSimulator.Closure_ has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LexerATNFactory.checkCommands (cyclomatic 17) · ×1
  • LexerATNFactory.checkCommands (cyclomatic 17) tool/src/org/antlr/v4/automata/LexerATNFactory.java:688 — LexerATNFactory.checkCommands has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ParserATNSimulator.closureWork (cyclomatic 17) · ×1
  • ParserATNSimulator.closureWork (cyclomatic 17) runtime/Go/antlr/v4/parser_atn_simulator.go:1115 — ParserATNSimulator.closureWork has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ATNDeserializer.generateRuleBypassTransitions (cyclomatic 17) · ×1
  • ATNDeserializer.generateRuleBypassTransitions (cyclomatic 17) runtime/Swift/Sources/Antlr4/atn/ATNDeserializer.swift:340 — ATNDeserializer.generateRuleBypassTransitions has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LexerATNSimulator.closure (cyclomatic 17) · ×1
  • LexerATNSimulator.closure (cyclomatic 17) runtime/Dart/lib/src/atn/src/lexer_atn_simulator.dart:414 — LexerATNSimulator.closure has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ATNDeserializer.VerifyATN (cyclomatic 16) · ×1
  • ATNDeserializer.VerifyATN (cyclomatic 16) runtime/CSharp/src/Atn/ATNDeserializer.cs:490 — ATNDeserializer.VerifyATN has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LeftRecursiveRuleAnalyzer.text (cyclomatic 16) · ×1
  • LeftRecursiveRuleAnalyzer.text (cyclomatic 16) tool/src/org/antlr/v4/analysis/LeftRecursiveRuleAnalyzer.java:324 — LeftRecursiveRuleAnalyzer.text has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Interpreter.interp (cyclomatic 16) · ×1
  • Interpreter.interp (cyclomatic 16) tool/src/org/antlr/v4/gui/Interpreter.java:132 — Interpreter.interp has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Interpreter.<init> (cyclomatic 16) · ×1
  • Interpreter.<init> (cyclomatic 16) tool/src/org/antlr/v4/gui/Interpreter.java:63 — Interpreter.<init> has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ScopeParser._parsePrefixDecl (cyclomatic 16) · ×1
  • ScopeParser._parsePrefixDecl (cyclomatic 16) tool/src/org/antlr/v4/parse/ScopeParser.java:144 — ScopeParser._parsePrefixDecl has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ParserInterpreter.visitState (cyclomatic 16) · ×1
  • ParserInterpreter.visitState (cyclomatic 16) runtime/Python3/src/antlr4/ParserInterpreter.py:99 — ParserInterpreter.visitState has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · LexerATNSimulator.closure (cyclomatic 16) · ×1
  • LexerATNSimulator.closure (cyclomatic 16) runtime/Swift/Sources/Antlr4/atn/LexerATNSimulator.swift:413 — LexerATNSimulator.closure has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ParserATNSimulator.execATNWithFullContext (cyclomatic 16) · ×1
  • ParserATNSimulator.execATNWithFullContext (cyclomatic 16) runtime/Swift/Sources/Antlr4/atn/ParserATNSimulator.swift:635 — ParserATNSimulator.execATNWithFullContext has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ATNDeserializer.generateRuleBypassTransition (cyclomatic 16) · ×1
  • ATNDeserializer.generateRuleBypassTransition (cyclomatic 16) runtime/Dart/lib/src/atn/src/atn_deserializer.dart:333 — ATNDeserializer.generateRuleBypassTransition has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D2 · Cognitive Complexity · GrammarTransformPipeline.integrateImportedGrammars (cognitive 125) · ×1
  • GrammarTransformPipeline.integrateImportedGrammars (cognitive 125) tool/src/org/antlr/v4/tool/GrammarTransformPipeline.java:156 — GrammarTransformPipeline.integrateImportedGrammars has cognitive complexity 125 (threshold 15). Drivers by points: if/else 28 (84 pts), loops 13 (40 pts), boolean chains 1 (nesting depth added 83). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ATNDeserializer.deserialize (cognitive 125) · ×1
  • ATNDeserializer.deserialize (cognitive 125) runtime/Java/src/org/antlr/v4/runtime/atn/ATNDeserializer.java:51 — ATNDeserializer.deserialize has cognitive complexity 125 (threshold 15). Drivers by points: if/else 30 (83 pts), loops 22 (40 pts), boolean chains 2 (nesting depth added 71). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodeGenPipeline.process (cognitive 85) · ×1
  • CodeGenPipeline.process (cognitive 85) tool/src/org/antlr/v4/codegen/CodeGenPipeline.java:22 — CodeGenPipeline.process has cognitive complexity 85 (threshold 15). Drivers by points: if/else 29 (81 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 53). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · antlr.reduceToSingleOperationPerIndex (cognitive 84) · ×1
  • antlr.reduceToSingleOperationPerIndex (cognitive 84) runtime/Go/antlr/v4/tokenstream_rewriter.go:537 — antlr.reduceToSingleOperationPerIndex has cognitive complexity 84 (threshold 15). Drivers by points: if/else 22 (63 pts), loops 7 (11 pts), boolean chains 10 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ATNOptimizer.optimizeSets (cognitive 72) · ×1
  • ATNOptimizer.optimizeSets (cognitive 72) tool/src/org/antlr/v4/automata/ATNOptimizer.java:41 — ATNOptimizer.optimizeSets has cognitive complexity 72 (threshold 15). Drivers by points: if/else 16 (49 pts), loops 7 (21 pts), boolean chains 2 (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RewriteOperationArray.reduceToSingleOperationPerIndex (cognitive 72) · ×1
  • RewriteOperationArray.reduceToSingleOperationPerIndex (cognitive 72) runtime/Swift/Sources/Antlr4/TokenStreamRewriter.swift:247 — RewriteOperationArray.reduceToSingleOperationPerIndex has cognitive complexity 72 (threshold 15). Drivers by points: if/else 19 (55 pts), loops 7 (11 pts), boolean chains 6 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CharSupport.getStringFromGrammarStringLiteral (cognitive 64) · ×1
  • CharSupport.getStringFromGrammarStringLiteral (cognitive 64) tool/src/org/antlr/v4/misc/CharSupport.java:86 — CharSupport.getStringFromGrammarStringLiteral has cognitive complexity 64 (threshold 15). Drivers by points: if/else 12 (45 pts), loops 3 (11 pts), boolean chains 8 (nesting depth added 41). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · IntervalSet.And (cognitive 62) · ×1
  • IntervalSet.And (cognitive 62) runtime/CSharp/src/Misc/IntervalSet.cs:374 — IntervalSet.And has cognitive complexity 62 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · IntervalSet.and (cognitive 62) · ×1
  • IntervalSet.and (cognitive 62) runtime/Swift/Sources/Antlr4/misc/IntervalSet.swift:324 — IntervalSet.and has cognitive complexity 62 (threshold 15). Drivers by points: if/else 17 (60 pts), boolean chains 1, loops 1 (nesting depth added 43). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DOTGenerator.getDOT (cognitive 58) · ×1
  • DOTGenerator.getDOT (cognitive 58) tool/src/org/antlr/v4/tool/DOTGenerator.java:181 — DOTGenerator.getDOT has cognitive complexity 58 (threshold 15). Drivers by points: if/else 25 (53 pts), loops 4 (5 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reduceToSingleOperationPerIndex (cognitive 58) · ×1
  • reduceToSingleOperationPerIndex (cognitive 58) runtime/JavaScript/src/antlr4/TokenStreamRewriter.js:215 — reduceToSingleOperationPerIndex has cognitive complexity 58 (threshold 15). Drivers by points: if/else 16 (37 pts), loops 7 (11 pts), boolean chains 6, ternaries 1 (4 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TokenStreamRewriter.reduceToSingleOperationPerIndex (cognitive 57) · ×1
  • TokenStreamRewriter.reduceToSingleOperationPerIndex (cognitive 57) runtime/Java/src/org/antlr/v4/runtime/TokenStreamRewriter.java:478 — TokenStreamRewriter.reduceToSingleOperationPerIndex has cognitive complexity 57 (threshold 15). Drivers by points: if/else 16 (37 pts), loops 7 (11 pts), boolean chains 5, ternaries 1 (4 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TokenStreamRewriter.ReduceToSingleOperationPerIndex (cognitive 56) · ×1
  • TokenStreamRewriter.ReduceToSingleOperationPerIndex (cognitive 56) runtime/CSharp/src/TokenStreamRewriter.cs:567 — TokenStreamRewriter.ReduceToSingleOperationPerIndex has cognitive complexity 56 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParseTreePatternMatcher.MatchImpl (cognitive 54) · ×1
  • ParseTreePatternMatcher.MatchImpl (cognitive 54) runtime/CSharp/src/Tree/Pattern/ParseTreePatternMatcher.cs:390 — ParseTreePatternMatcher.MatchImpl has cognitive complexity 54 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · ParserATNSimulator.execATN (cognitive 54) · ×1
  • ParserATNSimulator.execATN (cognitive 54) runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:395 — ParserATNSimulator.execATN has cognitive complexity 54 (threshold 15). Drivers by points: if/else 20 (51 pts), boolean chains 2, loops 1 (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ParserATNSimulator.execATN (cognitive 53) · ×1
  • ParserATNSimulator.execATN (cognitive 53) runtime/Swift/Sources/Antlr4/atn/ParserATNSimulator.swift:423 — ParserATNSimulator.execATN has cognitive complexity 53 (threshold 15). Drivers by points: if/else 18 (47 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ATNDeserializer.InlineSetRules (cognitive 52) · ×1
  • ATNDeserializer.InlineSetRules (cognitive 52) runtime/CSharp/src/Atn/ATNDeserializer.cs:573 — ATNDeserializer.InlineSetRules has cognitive complexity 52 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParseTreePatternMatcher.matchImpl (cognitive 52) · ×1
  • ParseTreePatternMatcher.matchImpl (cognitive 52) runtime/Swift/Sources/Antlr4/tree/pattern/ParseTreePatternMatcher.swift:210 — ParseTreePatternMatcher.matchImpl has cognitive complexity 52 (threshold 15). Drivers by points: if/else 19 (48 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ATNDeserializer.OptimizeSets (cognitive 51) · ×1
  • ATNDeserializer.OptimizeSets (cognitive 51) runtime/CSharp/src/Atn/ATNDeserializer.cs:774 — ATNDeserializer.OptimizeSets has cognitive complexity 51 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserATNSimulator.ExecATN (cognitive 51) · ×1
  • ParserATNSimulator.ExecATN (cognitive 51) runtime/CSharp/src/Atn/ParserATNSimulator.cs:418 — ParserATNSimulator.ExecATN has cognitive complexity 51 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · Tool.handleArgs (cognitive 51) · ×1
  • Tool.handleArgs (cognitive 51) tool/src/org/antlr/v4/Tool.java:198 — Tool.handleArgs has cognitive complexity 51 (threshold 15). Drivers by points: if/else 19 (40 pts), boolean chains 4, error handling 1 (4 pts), loops 2 (3 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mergeArrays (cognitive 50) · ×1
  • mergeArrays (cognitive 50) runtime/JavaScript/src/antlr4/context/PredictionContextUtils.js:131 — mergeArrays has cognitive complexity 50 (threshold 15). Drivers by points: if/else 23 (39 pts), boolean chains 6, loops 3 (5 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ATNDeserializer.CombineChainedEpsilons (cognitive 49) · ×1
  • ATNDeserializer.CombineChainedEpsilons (cognitive 49) runtime/CSharp/src/Atn/ATNDeserializer.cs:705 — ATNDeserializer.CombineChainedEpsilons has cognitive complexity 49 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PredictionContext.MergeArrays (cognitive 49) · ×1
  • PredictionContext.MergeArrays (cognitive 49) runtime/CSharp/src/Atn/PredictionContext.cs:225 — PredictionContext.MergeArrays has cognitive complexity 49 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RuleDependencyChecker.CheckDependencies (cognitive 49) · ×1
  • RuleDependencyChecker.CheckDependencies (cognitive 49) runtime/CSharp/src/Misc/RuleDependencyChecker.cs:81 — RuleDependencyChecker.CheckDependencies has cognitive complexity 49 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · antlr.mergeArrays (cognitive 48) · ×1
  • antlr.mergeArrays (cognitive 48) runtime/Go/antlr/v4/prediction_context.go:546 — antlr.mergeArrays has cognitive complexity 48 (threshold 15). Drivers by points: if/else 23 (39 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserATNSimulator.closureWork (cognitive 48) · ×1
  • ParserATNSimulator.closureWork (cognitive 48) runtime/Go/antlr/v4/parser_atn_simulator.go:1115 — ParserATNSimulator.closureWork has cognitive complexity 48 (threshold 15). Drivers by points: if/else 13 (44 pts), boolean chains 3, loops 1 (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · TokenStreamRewriter._reduceToSingleOperationPerIndex (cognitive 47) · ×1
  • TokenStreamRewriter._reduceToSingleOperationPerIndex (cognitive 47) runtime/Python3/src/antlr4/TokenStreamRewriter.py:140 — TokenStreamRewriter._reduceToSingleOperationPerIndex has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (34 pts), loops 7 (11 pts), boolean chains 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserATNSimulator.computeReachSet (cognitive 45) · ×1
  • ParserATNSimulator.computeReachSet (cognitive 45) runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:698 — ParserATNSimulator.computeReachSet has cognitive complexity 45 (threshold 15). Drivers by points: if/else 18 (34 pts), loops 4 (7 pts), boolean chains 4 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ATNDeserializer.GenerateRuleBypassTransitions (cognitive 44) · ×1
  • ATNDeserializer.GenerateRuleBypassTransitions (cognitive 44) runtime/CSharp/src/Atn/ATNDeserializer.cs:88 — ATNDeserializer.GenerateRuleBypassTransitions has cognitive complexity 44 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserATNSimulator.Closure_ (cognitive 44) · ×1
  • ParserATNSimulator.Closure_ (cognitive 44) runtime/CSharp/src/Atn/ParserATNSimulator.cs:1606 — ParserATNSimulator.Closure_ has cognitive complexity 44 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · ATNDeserializer.readEdges (cognitive 44) · ×1
  • ATNDeserializer.readEdges (cognitive 44) runtime/Dart/lib/src/atn/src/atn_deserializer.dart:222 — ATNDeserializer.readEdges has cognitive complexity 44 (threshold 15). Drivers by points: if/else 11 (33 pts), loops 6 (11 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ScopeParser._splitArgumentList (cognitive 43) · ×1
  • ScopeParser._splitArgumentList (cognitive 43) tool/src/org/antlr/v4/parse/ScopeParser.java:265 — ScopeParser._splitArgumentList has cognitive complexity 43 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 5 (13 pts), boolean chains 9, match/switch 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ATNDeserializer.generateRuleBypassTransitions (cognitive 43) · ×1
  • ATNDeserializer.generateRuleBypassTransitions (cognitive 43) runtime/Swift/Sources/Antlr4/atn/ATNDeserializer.swift:340 — ATNDeserializer.generateRuleBypassTransitions has cognitive complexity 43 (threshold 15). Drivers by points: if/else 9 (29 pts), loops 5 (11 pts), boolean chains 3 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LL1Analyzer._LOOK (cognitive 43) · ×1
  • LL1Analyzer._LOOK (cognitive 43) runtime/Swift/Sources/Antlr4/atn/LL1Analyzer.swift:131 — LL1Analyzer._LOOK has cognitive complexity 43 (threshold 15). Drivers by points: if/else 20 (37 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserATNSimulator.computeReachSet (cognitive 42) · ×1
  • ParserATNSimulator.computeReachSet (cognitive 42) runtime/Swift/Sources/Antlr4/atn/ParserATNSimulator.swift:754 — ParserATNSimulator.computeReachSet has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (30 pts), loops 4 (8 pts), boolean chains 4 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LL1Analyzer._LOOK (cognitive 42) · ×1
  • LL1Analyzer._LOOK (cognitive 42) runtime/Dart/lib/src/ll1_analyzer.dart:97 — LL1Analyzer._LOOK has cognitive complexity 42 (threshold 15). Drivers by points: if/else 19 (35 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParseTreePatternMatcher.Split (cognitive 41) · ×1
  • ParseTreePatternMatcher.Split (cognitive 41) runtime/CSharp/src/Tree/Pattern/ParseTreePatternMatcher.cs:587 — ParseTreePatternMatcher.Split has cognitive complexity 41 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · LexerATNFactory.checkRangeAndAddToSet (cognitive 41) · ×1
  • LexerATNFactory.checkRangeAndAddToSet (cognitive 41) tool/src/org/antlr/v4/automata/LexerATNFactory.java:550 — LexerATNFactory.checkRangeAndAddToSet has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 2 (9 pts), ternaries 1 (5 pts), boolean chains 2 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · LL1Analyzer.look1 (cognitive 41) · ×1
  • LL1Analyzer.look1 (cognitive 41) runtime/Go/antlr/v4/ll1_analyzer.go:122 — LL1Analyzer.look1 has cognitive complexity 41 (threshold 15). Drivers by points: if/else 20 (35 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 17). Of this number, 38 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LL1Analyzer.Look_ (cognitive 40) · ×1
  • LL1Analyzer.Look_ (cognitive 40) runtime/CSharp/src/Atn/LL1Analyzer.cs:142 — LL1Analyzer.Look_ has cognitive complexity 40 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PredictionContext.ToStrings (cognitive 40) · ×1
  • PredictionContext.ToStrings (cognitive 40) runtime/CSharp/src/Atn/PredictionContext.cs:491 — PredictionContext.ToStrings has cognitive complexity 40 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · ATNDeserializer.ReadEdges (cognitive 39) · ×1
  • ATNDeserializer.ReadEdges (cognitive 39) runtime/CSharp/src/Atn/ATNDeserializer.cs:219 — ATNDeserializer.ReadEdges has cognitive complexity 39 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EscapeSequenceParsing.parseEscape (cognitive 39) · ×1
  • EscapeSequenceParsing.parseEscape (cognitive 39) tool/src/org/antlr/v4/misc/EscapeSequenceParsing.java:83 — EscapeSequenceParsing.parseEscape has cognitive complexity 39 (threshold 15). Drivers by points: if/else 19 (34 pts), boolean chains 5 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ATNDeserializer.readEdges (cognitive 39) · ×1
  • ATNDeserializer.readEdges (cognitive 39) runtime/Python3/src/antlr4/atn/ATNDeserializer.py:137 — ATNDeserializer.readEdges has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (28 pts), loops 6 (11 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserATNSimulator.computeReachSet (cognitive 39) · ×1
  • ParserATNSimulator.computeReachSet (cognitive 39) runtime/Go/antlr/v4/parser_atn_simulator.go:526 — ParserATNSimulator.computeReachSet has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (28 pts), loops 4 (7 pts), boolean chains 4 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PredictionContext.mergeArrays (cognitive 39) · ×1
  • PredictionContext.mergeArrays (cognitive 39) runtime/Dart/lib/src/prediction_context.dart:319 — PredictionContext.mergeArrays has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (28 pts), boolean chains 6, loops 3 (5 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParseTreePatternMatcher.matchImpl (cognitive 38) · ×1
  • ParseTreePatternMatcher.matchImpl (cognitive 38) runtime/Java/src/org/antlr/v4/runtime/tree/pattern/ParseTreePatternMatcher.java:256 — ParseTreePatternMatcher.matchImpl has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (34 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserATNSimulator.closureCheckingStopState (cognitive 38) · ×1
  • ParserATNSimulator.closureCheckingStopState (cognitive 38) runtime/Go/antlr/v4/parser_atn_simulator.go:996 — ParserATNSimulator.closureCheckingStopState has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (33 pts), loops 2 (5 pts) (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ATNPrinter.asString (cognitive 37) · ×1
  • ATNPrinter.asString (cognitive 37) tool/src/org/antlr/v4/automata/ATNPrinter.java:45 — ATNPrinter.asString has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (24 pts), ternaries 2 (10 pts), loops 2 (3 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DOTGenerator.getStateLabel (cognitive 37) · ×1
  • DOTGenerator.getStateLabel (cognitive 37) tool/src/org/antlr/v4/tool/DOTGenerator.java:111 — DOTGenerator.getStateLabel has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 3 (11 pts), boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserATNSimulator.ComputeReachSet (cognitive 36) · ×1
  • ParserATNSimulator.ComputeReachSet (cognitive 36) runtime/CSharp/src/Atn/ParserATNSimulator.cs:786 — ParserATNSimulator.ComputeReachSet has cognitive complexity 36 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserATNSimulator.execATNWithFullContext (cognitive 36) · ×1
  • ParserATNSimulator.execATNWithFullContext (cognitive 36) runtime/Swift/Sources/Antlr4/atn/ParserATNSimulator.swift:635 — ParserATNSimulator.execATNWithFullContext has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (33 pts), boolean chains 2, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Target.getTargetStringLiteralFromANTLRStringLiteral (cognitive 35) · ×1
  • Target.getTargetStringLiteralFromANTLRStringLiteral (cognitive 35) tool/src/org/antlr/v4/codegen/Target.java:237 — Target.getTargetStringLiteralFromANTLRStringLiteral has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 2 (6 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SymbolChecks.checkForLabelConflicts (cognitive 35) · ×1
  • SymbolChecks.checkForLabelConflicts (cognitive 35) tool/src/org/antlr/v4/semantics/SymbolChecks.java:117 — SymbolChecks.checkForLabelConflicts has cognitive complexity 35 (threshold 15). Drivers by points: if/else 5 (19 pts), loops 5 (16 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LL1Analyzer._LOOK (cognitive 35) · ×1
  • LL1Analyzer._LOOK (cognitive 35) runtime/Python3/src/antlr4/LL1Analyzer.py:110 — LL1Analyzer._LOOK has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (29 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PredictionContext.toStrings (cognitive 35) · ×1
  • PredictionContext.toStrings (cognitive 35) runtime/Swift/Sources/Antlr4/atn/PredictionContext.swift:649 — PredictionContext.toStrings has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (26 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PredictionContext.MergeSingletons (cognitive 34) · ×1
  • PredictionContext.MergeSingletons (cognitive 34) runtime/CSharp/src/Atn/PredictionContext.cs:137 — PredictionContext.MergeSingletons has cognitive complexity 34 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParseTreePatternMatcher.matchImpl (cognitive 34) · ×1
  • ParseTreePatternMatcher.matchImpl (cognitive 34) runtime/Python3/src/antlr4/tree/ParseTreePatternMatcher.py:195 — ParseTreePatternMatcher.matchImpl has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (30 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ATNDeserializer.generateRuleBypassTransition (cognitive 34) · ×1
  • ATNDeserializer.generateRuleBypassTransition (cognitive 34) runtime/Dart/lib/src/atn/src/atn_deserializer.dart:333 — ATNDeserializer.generateRuleBypassTransition has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LexerATNSimulator.Closure (cognitive 33) · ×1
  • LexerATNSimulator.Closure (cognitive 33) runtime/CSharp/src/Atn/LexerATNSimulator.cs:407 — LexerATNSimulator.Closure has cognitive complexity 33 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GrammarTransformPipeline.extractImplicitLexer (cognitive 33) · ×1
  • GrammarTransformPipeline.extractImplicitLexer (cognitive 33) tool/src/org/antlr/v4/tool/GrammarTransformPipeline.java:385 — GrammarTransformPipeline.extractImplicitLexer has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 7 (10 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PredictionContext.mergeSingletons (cognitive 33) · ×1
  • PredictionContext.mergeSingletons (cognitive 33) runtime/Dart/lib/src/prediction_context.dart:155 — PredictionContext.mergeSingletons has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (30 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParseTreePatternMatcher.matchImpl (cognitive 33) · ×1
  • ParseTreePatternMatcher.matchImpl (cognitive 33) runtime/Dart/lib/src/tree/src/pattern/parse_tree_match.dart:363 — ParseTreePatternMatcher.matchImpl has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (29 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ATNDeserializer.VerifyATN (cognitive 32) · ×1
  • ATNDeserializer.VerifyATN (cognitive 32) runtime/CSharp/src/Atn/ATNDeserializer.cs:490 — ATNDeserializer.VerifyATN has cognitive complexity 32 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OutputModelWalker.walk (cognitive 32) · ×1
  • OutputModelWalker.walk (cognitive 32) tool/src/org/antlr/v4/codegen/OutputModelWalker.java:54 — OutputModelWalker.walk has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 3 (7 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InterpreterDataReader.parseFile (cognitive 32) · ×1
  • InterpreterDataReader.parseFile (cognitive 32) runtime/Java/src/org/antlr/v4/runtime/misc/InterpreterDataReader.java:55 — InterpreterDataReader.parseFile has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 6 (8 pts), ternaries 2 (4 pts), error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LexerATNSimulator.closure (cognitive 32) · ×1
  • LexerATNSimulator.closure (cognitive 32) runtime/Go/antlr/v4/lexer_atn_simulator.go:349 — LexerATNSimulator.closure has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ATNDeserializer.verifyATN (cognitive 32) · ×1
  • ATNDeserializer.verifyATN (cognitive 32) runtime/Swift/Sources/Antlr4/atn/ATNDeserializer.swift:423 — ATNDeserializer.verifyATN has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (28 pts), boolean chains 3, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PredictionContextUtils.mergeSingletons (cognitive 32) · ×1
  • PredictionContextUtils.mergeSingletons (cognitive 32) runtime/JavaScript/src/antlr4/context/PredictionContextUtils.js:292 — PredictionContextUtils.mergeSingletons has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (30 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LexerATNSimulator.closure (cognitive 31) · ×1
  • LexerATNSimulator.closure (cognitive 31) runtime/Swift/Sources/Antlr4/atn/LexerATNSimulator.swift:413 — LexerATNSimulator.closure has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LeftRecursiveRuleAnalyzer.text (cognitive 30) · ×1
  • LeftRecursiveRuleAnalyzer.text (cognitive 30) tool/src/org/antlr/v4/analysis/LeftRecursiveRuleAnalyzer.java:324 — LeftRecursiveRuleAnalyzer.text has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 4 (7 pts), boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParseTreePatternMatcher.split (cognitive 30) · ×1
  • ParseTreePatternMatcher.split (cognitive 30) runtime/Swift/Sources/Antlr4/tree/pattern/ParseTreePatternMatcher.swift:351 — ParseTreePatternMatcher.split has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (25 pts), loops 4, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserATNSimulator.computeReachSet (cognitive 30) · ×1
  • ParserATNSimulator.computeReachSet (cognitive 30) runtime/Dart/lib/src/atn/src/parser_atn_simulator.dart:800 — ParserATNSimulator.computeReachSet has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 4 (7 pts), boolean chains 4 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Lexer.nextToken (cognitive 30) · ×1
  • Lexer.nextToken (cognitive 30) runtime/JavaScript/src/antlr4/Lexer.js:91 — Lexer.nextToken has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (24 pts), error handling 1 (3 pts), loops 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SymbolChecks.checkForUnreachableTokens (cognitive 29) · ×1
  • SymbolChecks.checkForUnreachableTokens (cognitive 29) tool/src/org/antlr/v4/semantics/SymbolChecks.java:338 — SymbolChecks.checkForUnreachableTokens has cognitive complexity 29 (threshold 15). Drivers by points: if/else 4 (15 pts), loops 4 (13 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ATNSerializer.addEdges (cognitive 29) · ×1
  • ATNSerializer.addEdges (cognitive 29) runtime/Java/src/org/antlr/v4/runtime/atn/ATNSerializer.java:159 — ATNSerializer.addEdges has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (15 pts), ternaries 2 (8 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LexerATNSimulator.closure (cognitive 29) · ×1
  • LexerATNSimulator.closure (cognitive 29) runtime/Dart/lib/src/atn/src/lexer_atn_simulator.dart:414 — LexerATNSimulator.closure has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserATNSimulator.closureCheckingStopState (cognitive 29) · ×1
  • ParserATNSimulator.closureCheckingStopState (cognitive 29) runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:1211 — ParserATNSimulator.closureCheckingStopState has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ParserATNSimulator.ClosureCheckingStopState (cognitive 28) · ×1
  • ParserATNSimulator.ClosureCheckingStopState (cognitive 28) runtime/CSharp/src/Atn/ParserATNSimulator.cs:1537 — ParserATNSimulator.ClosureCheckingStopState has cognitive complexity 28 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · DOTGenerator.getDOT (cognitive 28) · ×1
  • DOTGenerator.getDOT (cognitive 28) tool/src/org/antlr/v4/tool/DOTGenerator.java:60 — DOTGenerator.getDOT has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 4 (6 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserATNSimulator.closureCheckingStopStateRecursive (cognitive 28) · ×1
  • ParserATNSimulator.closureCheckingStopStateRecursive (cognitive 28) runtime/Go/antlr/v4/parser_atn_simulator.go:1063 — ParserATNSimulator.closureCheckingStopStateRecursive has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 1 (3 pts) (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Lexer.nextToken (cognitive 28) · ×1
  • Lexer.nextToken (cognitive 28) runtime/Swift/Sources/Antlr4/Lexer.swift:128 — Lexer.nextToken has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 2 (5 pts), error handling 1 (4 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UnbufferedCharStream.fill (cognitive 27) · ×1
  • UnbufferedCharStream.fill (cognitive 27) runtime/Java/src/org/antlr/v4/runtime/UnbufferedCharStream.java:158 — UnbufferedCharStream.fill has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ATNDeserializer.validateStates (cognitive 27) · ×1
  • ATNDeserializer.validateStates (cognitive 27) runtime/Swift/Sources/Antlr4/atn/ATNDeserializer.swift:262 — ATNDeserializer.validateStates has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 3 (7 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PredictionContext.mergeArrays (cognitive 27) · ×1
  • PredictionContext.mergeArrays (cognitive 27) runtime/Swift/Sources/Antlr4/atn/PredictionContext.swift:371 — PredictionContext.mergeArrays has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 6, loops 3 (5 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Lexer.nextToken (cognitive 27) · ×1
  • Lexer.nextToken (cognitive 27) runtime/Dart/lib/src/lexer.dart:108 — Lexer.nextToken has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (18 pts), loops 2 (5 pts), error handling 1 (4 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParseTreePatternMatcher.split (cognitive 26) · ×1
  • ParseTreePatternMatcher.split (cognitive 26) runtime/Python3/src/antlr4/tree/ParseTreePatternMatcher.py:306 — ParseTreePatternMatcher.split has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (21 pts), loops 4, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IntervalSet.toString (cognitive 26) · ×1
  • IntervalSet.toString (cognitive 26) runtime/Dart/lib/src/interval_set.dart:530 — IntervalSet.toString has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (23 pts), loops 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserATNSimulator.ExecATNWithFullContext (cognitive 25) · ×1
  • ParserATNSimulator.ExecATNWithFullContext (cognitive 25) runtime/CSharp/src/Atn/ParserATNSimulator.cs:652 — ParserATNSimulator.ExecATNWithFullContext has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IntervalSet.Subtract (cognitive 25) · ×1
  • IntervalSet.Subtract (cognitive 25) runtime/CSharp/src/Misc/IntervalSet.cs:280 — IntervalSet.Subtract has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParseTreePatternMatcher.Tokenize (cognitive 25) · ×1
  • ParseTreePatternMatcher.Tokenize (cognitive 25) runtime/CSharp/src/Tree/Pattern/ParseTreePatternMatcher.cs:523 — ParseTreePatternMatcher.Tokenize has cognitive complexity 25 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · UnbufferedCharStream.Fill (cognitive 25) · ×1
  • UnbufferedCharStream.Fill (cognitive 25) runtime/CSharp/src/UnbufferedCharStream.cs:211 — UnbufferedCharStream.Fill has cognitive complexity 25 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · LexerATNFactory.checkCommands (cognitive 25) · ×1
  • LexerATNFactory.checkCommands (cognitive 25) tool/src/org/antlr/v4/automata/LexerATNFactory.java:688 — LexerATNFactory.checkCommands has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Interpreter.<init> (cognitive 25) · ×1
  • Interpreter.<init> (cognitive 25) tool/src/org/antlr/v4/gui/Interpreter.java:63 — Interpreter.<init> has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (24 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SymbolChecks.getSingleTokenValues (cognitive 25) · ×1
  • SymbolChecks.getSingleTokenValues (cognitive 25) tool/src/org/antlr/v4/semantics/SymbolChecks.java:378 — SymbolChecks.getSingleTokenValues has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 2 (4 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserATNSimulator.closureCheckingStopState (cognitive 25) · ×1
  • ParserATNSimulator.closureCheckingStopState (cognitive 25) runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:1440 — ParserATNSimulator.closureCheckingStopState has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 1 (3 pts) (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Lexer.nextToken (cognitive 25) · ×1
  • Lexer.nextToken (cognitive 25) runtime/Python3/src/antlr4/Lexer.py:114 — Lexer.nextToken has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (19 pts), error handling 1 (3 pts), loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · antlr.mergeSingletons (cognitive 25) · ×1
  • antlr.mergeSingletons (cognitive 25) runtime/Go/antlr/v4/prediction_context.go:387 — antlr.mergeSingletons has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserATNSimulator.canDropLoopEntryEdgeInLeftRecursiveRule (cognitive 25) · ×1
  • ParserATNSimulator.canDropLoopEntryEdgeInLeftRecursiveRule (cognitive 25) runtime/Swift/Sources/Antlr4/atn/ParserATNSimulator.swift:1570 — ParserATNSimulator.canDropLoopEntryEdgeInLeftRecursiveRule has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 8, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PredictionContext.mergeSingletons (cognitive 25) · ×1
  • PredictionContext.mergeSingletons (cognitive 25) runtime/Swift/Sources/Antlr4/atn/PredictionContext.swift:200 — PredictionContext.mergeSingletons has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IntervalSet.subtract (cognitive 25) · ×1
  • IntervalSet.subtract (cognitive 25) runtime/Swift/Sources/Antlr4/misc/IntervalSet.swift:237 — IntervalSet.subtract has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParseTreePatternMatcher.tokenize (cognitive 25) · ×1
  • ParseTreePatternMatcher.tokenize (cognitive 25) runtime/Swift/Sources/Antlr4/tree/pattern/ParseTreePatternMatcher.swift:303 — ParseTreePatternMatcher.tokenize has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 2 (4 pts) (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · RuleDependencyChecker.GetRuleVersions (cognitive 24) · ×1
  • RuleDependencyChecker.GetRuleVersions (cognitive 24) runtime/CSharp/src/Misc/RuleDependencyChecker.cs:213 — RuleDependencyChecker.GetRuleVersions has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserATNSimulator.canDropLoopEntryEdgeInLeftRecursiveRule (cognitive 24) · ×1
  • ParserATNSimulator.canDropLoopEntryEdgeInLeftRecursiveRule (cognitive 24) runtime/Dart/lib/src/atn/src/parser_atn_simulator.dart:1661 — ParserATNSimulator.canDropLoopEntryEdgeInLeftRecursiveRule has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 8, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ListTokenSource.Line.get (cognitive 23) · ×1
  • ListTokenSource.Line.get (cognitive 23) runtime/CSharp/src/ListTokenSource.cs:217 — ListTokenSource.Line.get has cognitive complexity 23 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · IntervalSet.ToString (cognitive 23) · ×1
  • IntervalSet.ToString (cognitive 23) runtime/CSharp/src/Misc/IntervalSet.cs:616 — IntervalSet.ToString has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LexerATNFactory.createLexerAction (cognitive 23) · ×1
  • LexerATNFactory.createLexerAction (cognitive 23) tool/src/org/antlr/v4/automata/LexerATNFactory.java:634 — LexerATNFactory.createLexerAction has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 7 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RuleFunction.getDeclsForAllElements (cognitive 23) · ×1
  • RuleFunction.getDeclsForAllElements (cognitive 23) tool/src/org/antlr/v4/codegen/model/RuleFunction.java:173 — RuleFunction.getDeclsForAllElements has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ScopeParser.parseAttributeDef (cognitive 23) · ×1
  • ScopeParser.parseAttributeDef (cognitive 23) tool/src/org/antlr/v4/parse/ScopeParser.java:68 — ScopeParser.parseAttributeDef has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3 (8 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Array2DHashSet.containsAll (cognitive 23) · ×1
  • Array2DHashSet.containsAll (cognitive 23) runtime/Java/src/org/antlr/v4/runtime/misc/Array2DHashSet.java:305 — Array2DHashSet.containsAll has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 3 (7 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IntervalSet.and (cognitive 23) · ×1
  • IntervalSet.and (cognitive 23) runtime/Java/src/org/antlr/v4/runtime/misc/IntervalSet.java:315 — IntervalSet.and has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserATNSimulator.closureCheckingStopState (cognitive 23) · ×1
  • ParserATNSimulator.closureCheckingStopState (cognitive 23) runtime/Python3/src/antlr4/atn/ParserATNSimulator.py:1103 — ParserATNSimulator.closureCheckingStopState has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 1 (3 pts) (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PredictionContext.String (cognitive 23) · ×1
  • PredictionContext.String (cognitive 23) runtime/Go/antlr/v4/prediction_context.go:222 — PredictionContext.String has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ATNDeserializer.deserialize (cognitive 23) · ×1
  • ATNDeserializer.deserialize (cognitive 23) runtime/Swift/Sources/Antlr4/atn/ATNDeserializer.swift:18 — ATNDeserializer.deserialize has cognitive complexity 23 (threshold 15). Drivers by points: loops 10 (12 pts), if/else 8 (11 pts) (nesting depth added 5). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · IntervalSet.subtract (cognitive 23) · ×1
  • IntervalSet.subtract (cognitive 23) runtime/Dart/lib/src/interval_set.dart:320 — IntervalSet.subtract has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GrammarDependencies.analyse (cognitive 22) · ×1
  • GrammarDependencies.analyse (cognitive 22) REDACTED:212 — GrammarDependencies.analyse has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 4 (6 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserATNFactory.elemList (cognitive 22) · ×1
  • ParserATNFactory.elemList (cognitive 22) tool/src/org/antlr/v4/automata/ParserATNFactory.java:465 — ParserATNFactory.elemList has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Interpreter.interp (cognitive 22) · ×1
  • Interpreter.interp (cognitive 22) tool/src/org/antlr/v4/gui/Interpreter.java:132 — Interpreter.interp has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (15 pts), error handling 1 (2 pts), loops 1 (2 pts), ternaries 2, boolean chains 1 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · LeftRecursiveRule.getAltLabels (cognitive 22) · ×1
  • LeftRecursiveRule.getAltLabels (cognitive 22) tool/src/org/antlr/v4/tool/LeftRecursiveRule.java:117 — LeftRecursiveRule.getAltLabels has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserATNSimulator.execATNWithFullContext (cognitive 22) · ×1
  • ParserATNSimulator.execATNWithFullContext (cognitive 22) runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:622 — ParserATNSimulator.execATNWithFullContext has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IntervalSet.subtract (cognitive 22) · ×1
  • IntervalSet.subtract (cognitive 22) runtime/Java/src/org/antlr/v4/runtime/misc/IntervalSet.java:229 — IntervalSet.subtract has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BaseLexer.NextToken (cognitive 22) · ×1
  • BaseLexer.NextToken (cognitive 22) runtime/Go/antlr/v4/lexer.go:181 — BaseLexer.NextToken has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserATNSimulator.canDropLoopEntryEdgeInLeftRecursiveRule (cognitive 22) · ×1
  • ParserATNSimulator.canDropLoopEntryEdgeInLeftRecursiveRule (cognitive 22) runtime/Go/antlr/v4/parser_atn_simulator.go:1183 — ParserATNSimulator.canDropLoopEntryEdgeInLeftRecursiveRule has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 4, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.consume (cognitive 22) · ×1
  • Parser.consume (cognitive 22) runtime/Swift/Sources/Antlr4/Parser.swift:536 — Parser.consume has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (8 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ATNDeserializer.verifyATN (cognitive 22) · ×1
  • ATNDeserializer.verifyATN (cognitive 22) runtime/JavaScript/src/antlr4/atn/ATNDeserializer.js:463 — ATNDeserializer.verifyATN has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ParserATNSimulator.ApplyPrecedenceFilter (cognitive 21) · ×1
  • ParserATNSimulator.ApplyPrecedenceFilter (cognitive 21) runtime/CSharp/src/Atn/ParserATNSimulator.cs:1173 — ParserATNSimulator.ApplyPrecedenceFilter has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.Consume (cognitive 21) · ×1
  • Parser.Consume (cognitive 21) runtime/CSharp/src/Parser.cs:724 — Parser.Consume has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TokenStreamRewriter.GetText (cognitive 21) · ×1
  • TokenStreamRewriter.GetText (cognitive 21) runtime/CSharp/src/TokenStreamRewriter.cs:456 — TokenStreamRewriter.GetText has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Trees.GetNodeText (cognitive 21) · ×1
  • Trees.GetNodeText (cognitive 21) runtime/CSharp/src/Tree/Trees.cs:83 — Trees.GetNodeText has cognitive complexity 21 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · TailEpsilonRemover.visitState (cognitive 21) · ×1
  • TailEpsilonRemover.visitState (cognitive 21) tool/src/org/antlr/v4/automata/TailEpsilonRemover.java:31 — TailEpsilonRemover.visitState has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 3 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · BuildDependencyGenerator.getGeneratedFileList (cognitive 21) · ×1
  • BuildDependencyGenerator.getGeneratedFileList (cognitive 21) tool/src/org/antlr/v4/tool/BuildDependencyGenerator.java:78 — BuildDependencyGenerator.getGeneratedFileList has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (19 pts), loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Tool.sortGrammarByTokenVocab (cognitive 21) · ×1
  • Tool.sortGrammarByTokenVocab (cognitive 21) tool/src/org/antlr/v4/Tool.java:491 — Tool.sortGrammarByTokenVocab has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BaseParser.Consume (cognitive 21) · ×1
  • BaseParser.Consume (cognitive 21) runtime/Go/antlr/v4/parser.go:415 — BaseParser.Consume has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (8 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LexerATNSimulator.getReachableConfigSet (cognitive 21) · ×1
  • LexerATNSimulator.getReachableConfigSet (cognitive 21) runtime/Swift/Sources/Antlr4/atn/LexerATNSimulator.swift:319 — LexerATNSimulator.getReachableConfigSet has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TokenStreamRewriter.getText (cognitive 21) · ×1
  • TokenStreamRewriter.getText (cognitive 21) runtime/JavaScript/src/antlr4/TokenStreamRewriter.js:144 — TokenStreamRewriter.getText has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Lexer.NextToken (cognitive 20) · ×1
  • Lexer.NextToken (cognitive 20) runtime/CSharp/src/Lexer.cs:141 — Lexer.NextToken has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Utils.EscapeWhitespace (cognitive 20) · ×1
  • Utils.EscapeWhitespace (cognitive 20) runtime/CSharp/src/Misc/Utils.cs:55 — Utils.EscapeWhitespace has cognitive complexity 20 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · RuleFunction.addContextGetters (cognitive 20) · ×1
  • RuleFunction.addContextGetters (cognitive 20) tool/src/org/antlr/v4/codegen/model/RuleFunction.java:120 — RuleFunction.addContextGetters has cognitive complexity 20 (threshold 15). Drivers by points: loops 5 (14 pts), if/else 3 (6 pts) (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · SemanticPipeline.assignLexerTokenTypes (cognitive 20) · ×1
  • SemanticPipeline.assignLexerTokenTypes (cognitive 20) tool/src/org/antlr/v4/semantics/SemanticPipeline.java:137 — SemanticPipeline.assignLexerTokenTypes has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ATNSerializer.addEdges (cognitive 20) · ×1
  • ATNSerializer.addEdges (cognitive 20) runtime/Java/src/org/antlr/v4/runtime/atn/ATNSerializer.java:289 — ATNSerializer.addEdges has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Lexer.nextToken (cognitive 20) · ×1
  • Lexer.nextToken (cognitive 20) runtime/Java/src/org/antlr/v4/runtime/Lexer.java:112 — Lexer.nextToken has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), error handling 1 (3 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserATNSimulator.execATNWithFullContext (cognitive 20) · ×1
  • ParserATNSimulator.execATNWithFullContext (cognitive 20) runtime/Python3/src/antlr4/atn/ParserATNSimulator.py:558 — ParserATNSimulator.execATNWithFullContext has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · XPath.getXPathElement (cognitive 20) · ×1
  • XPath.getXPathElement (cognitive 20) runtime/Python3/src/antlr4/xpath/XPath.py:133 — XPath.getXPathElement has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 4 (8 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BaseParserRuleContext.String (cognitive 20) · ×1
  • BaseParserRuleContext.String (cognitive 20) runtime/Go/antlr/v4/parser_rule_context.go:324 — BaseParserRuleContext.String has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 4, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserInterpreter.visitState (cognitive 20) · ×1
  • ParserInterpreter.visitState (cognitive 20) runtime/Swift/Sources/Antlr4/ParserInterpreter.swift:177 — ParserInterpreter.visitState has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 2, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ATNDeserializer.deriveEdgesForRuleStopStates (cognitive 20) · ×1
  • ATNDeserializer.deriveEdgesForRuleStopStates (cognitive 20) runtime/Swift/Sources/Antlr4/atn/ATNDeserializer.swift:236 — ATNDeserializer.deriveEdgesForRuleStopStates has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserATNSimulator.adaptivePredict (cognitive 20) · ×1
  • ParserATNSimulator.adaptivePredict (cognitive 20) runtime/Swift/Sources/Antlr4/atn/ParserATNSimulator.swift:310 — ParserATNSimulator.adaptivePredict has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PredictionContext.getCachedContext (cognitive 20) · ×1
  • PredictionContext.getCachedContext (cognitive 20) runtime/Swift/Sources/Antlr4/atn/PredictionContext.swift:549 — PredictionContext.getCachedContext has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LexerATNSimulator.GetReachableConfigSet (cognitive 19) · ×1
  • LexerATNSimulator.GetReachableConfigSet (cognitive 19) runtime/CSharp/src/Atn/LexerATNSimulator.cs:308 — LexerATNSimulator.GetReachableConfigSet has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserATNSimulator.CanDropLoopEntryEdgeInLeftRecursiveRule (cognitive 19) · ×1
  • ParserATNSimulator.CanDropLoopEntryEdgeInLeftRecursiveRule (cognitive 19) runtime/CSharp/src/Atn/ParserATNSimulator.cs:1777 — ParserATNSimulator.CanDropLoopEntryEdgeInLeftRecursiveRule has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GrammarParserInterpreter.visitDecisionState (cognitive 19) · ×1
  • GrammarParserInterpreter.visitDecisionState (cognitive 19) tool/src/org/antlr/v4/tool/GrammarParserInterpreter.java:163 — GrammarParserInterpreter.visitDecisionState has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ParserATNSimulator.canDropLoopEntryEdgeInLeftRecursiveRule (cognitive 19) · ×1
  • ParserATNSimulator.canDropLoopEntryEdgeInLeftRecursiveRule (cognitive 19) runtime/Python3/src/antlr4/atn/ParserATNSimulator.py:1285 — ParserATNSimulator.canDropLoopEntryEdgeInLeftRecursiveRule has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParseTreePatternMatcher.tokenize (cognitive 19) · ×1
  • ParseTreePatternMatcher.tokenize (cognitive 19) runtime/Python3/src/antlr4/tree/ParseTreePatternMatcher.py:275 — ParseTreePatternMatcher.tokenize has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IntervalSet.addInterval (cognitive 19) · ×1
  • IntervalSet.addInterval (cognitive 19) runtime/Go/antlr/v4/interval_set.go:91 — IntervalSet.addInterval has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · LexerAction.swift.== (cognitive 19) · ×1
  • LexerAction.swift.== (cognitive 19) runtime/Swift/Sources/Antlr4/atn/LexerAction.swift:65 — LexerAction.swift.== has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10, boolean chains 9. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PredictionContextUtils.getCachedPredictionContext (cognitive 19) · ×1
  • PredictionContextUtils.getCachedPredictionContext (cognitive 19) runtime/JavaScript/src/antlr4/context/PredictionContextUtils.js:33 — PredictionContextUtils.getCachedPredictionContext has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ATNDeserializer.TestTailCall (cognitive 18) · ×1
  • ATNDeserializer.TestTailCall (cognitive 18) runtime/CSharp/src/Atn/ATNDeserializer.cs:911 — ATNDeserializer.TestTailCall has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserATNSimulator.EvalSemanticContext (cognitive 18) · ×1
  • ParserATNSimulator.EvalSemanticContext (cognitive 18) runtime/CSharp/src/Atn/ParserATNSimulator.cs:1444 — ParserATNSimulator.EvalSemanticContext has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PredictionContext.GetCachedContext (cognitive 18) · ×1
  • PredictionContext.GetCachedContext (cognitive 18) runtime/CSharp/src/Atn/PredictionContext.cs:410 — PredictionContext.GetCachedContext has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IntervalSet.Add (cognitive 18) · ×1
  • IntervalSet.Add (cognitive 18) runtime/CSharp/src/Misc/IntervalSet.cs:130 — IntervalSet.Add has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LeftRecursiveRuleTransformer.translateLeftRecursiveRules (cognitive 18) · ×1
  • LeftRecursiveRuleTransformer.translateLeftRecursiveRules (cognitive 18) tool/src/org/antlr/v4/analysis/LeftRecursiveRuleTransformer.java:64 — LeftRecursiveRuleTransformer.translateLeftRecursiveRules has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LexerATNFactory.set (cognitive 18) · ×1
  • LexerATNFactory.set (cognitive 18) tool/src/org/antlr/v4/automata/LexerATNFactory.java:245 — LexerATNFactory.set has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ScopeParser._parsePrefixDecl (cognitive 18) · ×1
  • ScopeParser._parsePrefixDecl (cognitive 18) tool/src/org/antlr/v4/parse/ScopeParser.java:144 — ScopeParser._parsePrefixDecl has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, loops 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ATNSerializer.serializeSets (cognitive 18) · ×1
  • ATNSerializer.serializeSets (cognitive 18) runtime/Java/src/org/antlr/v4/runtime/atn/ATNSerializer.java:335 — ATNSerializer.serializeSets has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IterativeParseTreeWalker.walk (cognitive 18) · ×1
  • IterativeParseTreeWalker.walk (cognitive 18) runtime/Java/src/org/antlr/v4/runtime/tree/IterativeParseTreeWalker.java:22 — IterativeParseTreeWalker.walk has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · antlr.getCachedBasePredictionContext (cognitive 18) · ×1
  • antlr.getCachedBasePredictionContext (cognitive 18) runtime/Go/antlr/v4/prediction_context.go:680 — antlr.getCachedBasePredictionContext has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JMap.Put (cognitive 18) · ×1
  • JMap.Put (cognitive 18) runtime/Go/antlr/v4/jcollect.go:300 — JMap.Put has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RuleContext.toString (cognitive 18) · ×1
  • RuleContext.toString (cognitive 18) runtime/JavaScript/src/antlr4/context/RuleContext.js:135 — RuleContext.toString has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 6, ternaries 1 (3 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserATNSimulator.applyPrecedenceFilter (cognitive 18) · ×1
  • ParserATNSimulator.applyPrecedenceFilter (cognitive 18) runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:946 — ParserATNSimulator.applyPrecedenceFilter has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ListTokenSource.Column.get (cognitive 17) · ×1
  • ListTokenSource.Column.get (cognitive 17) runtime/CSharp/src/ListTokenSource.cs:146 — ListTokenSource.Column.get has cognitive complexity 17 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · IntervalSet.ToString (cognitive 17) · ×1
  • IntervalSet.ToString (cognitive 17) runtime/CSharp/src/Misc/IntervalSet.cs:674 — IntervalSet.ToString has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Antlr4Mojo.execute (cognitive 17) · ×1
  • Antlr4Mojo.execute (cognitive 17) antlr4-maven-plugin/src/main/java/org/antlr/mojo/antlr4/Antlr4Mojo.java:223 — Antlr4Mojo.execute has cognitive complexity 17 (threshold 15). Drivers by points: error handling 4 (6 pts), if/else 5 (6 pts), loops 3 (5 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LexerATNFactory.getSetFromCharSetLiteral (cognitive 17) · ×1
  • LexerATNFactory.getSetFromCharSetLiteral (cognitive 17) tool/src/org/antlr/v4/automata/LexerATNFactory.java:419 — LexerATNFactory.getSetFromCharSetLiteral has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IntervalSet.toString (cognitive 17) · ×1
  • IntervalSet.toString (cognitive 17) runtime/Java/src/org/antlr/v4/runtime/misc/IntervalSet.java:515 — IntervalSet.toString has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · XPath.split (cognitive 17) · ×1
  • XPath.split (cognitive 17) runtime/Python3/src/antlr4/xpath/XPath.py:80 — XPath.split has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), error handling 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JStore.Put (cognitive 17) · ×1
  • JStore.Put (cognitive 17) runtime/Go/antlr/v4/jcollect.go:159 — JStore.Put has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JPCMap.Put (cognitive 17) · ×1
  • JPCMap.Put (cognitive 17) runtime/Go/antlr/v4/jcollect.go:444 — JPCMap.Put has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (17 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ATNConfigSet.applyPrecedenceFilter (cognitive 17) · ×1
  • ATNConfigSet.applyPrecedenceFilter (cognitive 17) runtime/Swift/Sources/Antlr4/atn/ATNConfigSet.swift:400 — ATNConfigSet.applyPrecedenceFilter has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LexerATNSimulator.execATN (cognitive 17) · ×1
  • LexerATNSimulator.execATN (cognitive 17) runtime/Swift/Sources/Antlr4/atn/LexerATNSimulator.swift:165 — LexerATNSimulator.execATN has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserATNSimulator.adaptivePredict (cognitive 17) · ×1
  • ParserATNSimulator.adaptivePredict (cognitive 17) runtime/Dart/lib/src/atn/src/parser_atn_simulator.dart:321 — ParserATNSimulator.adaptivePredict has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LexerATNSimulator.ExecATN (cognitive 16) · ×1
  • LexerATNSimulator.ExecATN (cognitive 16) runtime/CSharp/src/Atn/LexerATNSimulator.cs:141 — LexerATNSimulator.ExecATN has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArrayEdgeMap.PutAll (cognitive 16) · ×1
  • ArrayEdgeMap.PutAll (cognitive 16) runtime/CSharp/src/Dfa/ArrayEdgeMap.cs:87 — ArrayEdgeMap.PutAll has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DFASerializer.ToString (cognitive 16) · ×1
  • DFASerializer.ToString (cognitive 16) runtime/CSharp/src/Dfa/DFASerializer.cs:48 — DFASerializer.ToString has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserInterpreter.Parse (cognitive 16) · ×1
  • ParserInterpreter.Parse (cognitive 16) runtime/CSharp/src/ParserInterpreter.cs:112 — ParserInterpreter.Parse has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RuleContext.ToString (cognitive 16) · ×1
  • RuleContext.ToString (cognitive 16) runtime/CSharp/src/RuleContext.cs:290 — RuleContext.ToString has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Antlr4Mojo.getCommandArguments (cognitive 16) · ×1
  • Antlr4Mojo.getCommandArguments (cognitive 16) antlr4-maven-plugin/src/main/java/org/antlr/mojo/antlr4/Antlr4Mojo.java:317 — Antlr4Mojo.getCommandArguments has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 2, loops 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · LeftRecursiveRuleAnalyzer.hasImmediateRecursiveRuleRefs (cognitive 16) · ×1
  • LeftRecursiveRuleAnalyzer.hasImmediateRecursiveRuleRefs (cognitive 16) tool/src/org/antlr/v4/analysis/LeftRecursiveRuleAnalyzer.java:263 — LeftRecursiveRuleAnalyzer.hasImmediateRecursiveRuleRefs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ScopeParser._parsePostfixDecl (cognitive 16) · ×1
  • ScopeParser._parsePostfixDecl (cognitive 16) tool/src/org/antlr/v4/parse/ScopeParser.java:196 — ScopeParser._parsePostfixDecl has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 2, loops 2, ternaries 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TokenVocabParser.load (cognitive 16) · ×1
  • TokenVocabParser.load (cognitive 16) tool/src/org/antlr/v4/parse/TokenVocabParser.java:36 — TokenVocabParser.load has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), error handling 4 (6 pts), loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Array2DHashSet.expand (cognitive 16) · ×1
  • Array2DHashSet.expand (cognitive 16) runtime/Java/src/org/antlr/v4/runtime/misc/Array2DHashSet.java:142 — Array2DHashSet.expand has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Array2DHashSet.retainAll (cognitive 16) · ×1
  • Array2DHashSet.retainAll (cognitive 16) runtime/Java/src/org/antlr/v4/runtime/misc/Array2DHashSet.java:335 — Array2DHashSet.retainAll has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · XPathLexer.nextToken (cognitive 16) · ×1
  • XPathLexer.nextToken (cognitive 16) runtime/Java/src/org/antlr/v4/runtime/tree/xpath/XPathLexer.java:93 — XPathLexer.nextToken has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserInterpreter.parse (cognitive 16) · ×1
  • ParserInterpreter.parse (cognitive 16) runtime/Java/src/org/antlr/v4/runtime/ParserInterpreter.java:160 — ParserInterpreter.parse has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 1 (3 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Parser.consume (cognitive 16) · ×1
  • Parser.consume (cognitive 16) runtime/Python3/src/antlr4/Parser.py:345 — Parser.consume has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TokenStreamRewriter.getText (cognitive 16) · ×1
  • TokenStreamRewriter.getText (cognitive 16) runtime/Python3/src/antlr4/TokenStreamRewriter.py:108 — TokenStreamRewriter.getText has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParserATNSimulator.applyPrecedenceFilter (cognitive 16) · ×1
  • ParserATNSimulator.applyPrecedenceFilter (cognitive 16) runtime/Python3/src/antlr4/atn/ParserATNSimulator.py:881 — ParserATNSimulator.applyPrecedenceFilter has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JPCMap2.Put (cognitive 16) · ×1
  • JPCMap2.Put (cognitive 16) runtime/Go/antlr/v4/jcollect.go:542 — JPCMap2.Put has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IterativeParseTreeWalker.Walk (cognitive 16) · ×1
  • IterativeParseTreeWalker.Walk (cognitive 16) runtime/Go/antlr/v4/tree.go:257 — IterativeParseTreeWalker.Walk has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Trees.getNodeText (cognitive 16) · ×1
  • Trees.getNodeText (cognitive 16) runtime/Swift/Sources/Antlr4/tree/Trees.swift:86 — Trees.getNodeText has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (16 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ATNDeserializer.markPrecedenceDecisions (cognitive 16) · ×1
  • ATNDeserializer.markPrecedenceDecisions (cognitive 16) runtime/Dart/lib/src/atn/src/atn_deserializer.dart:424 — ATNDeserializer.markPrecedenceDecisions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (14 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Edited copy of a member (116 corresponding lines) · ×1
  • Edited copy of a member (116 corresponding lines) runtime/CSharp/src/Atn/PredictionContext.cs:230 — runtime/CSharp/src/Atn/PredictionContext.cs:230-353 | runtime/Java/src/org/antlr/v4/runtime/atn/PredictionContext.java:350-465 — These two members are one piece of code written twice and then edited apart: 116 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (104 corresponding lines) · ×1
  • Edited copy of a member (104 corresponding lines) runtime/CSharp/src/Atn/ParserATNSimulator.cs:421 — runtime/CSharp/src/Atn/ParserATNSimulator.cs:421-538 | runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:416-519 — These two members are one piece of code written twice and then edited apart: 104 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (132 corresponding lines) · ×1
  • Edited copy of a member (132 corresponding lines) runtime/CSharp/src/Atn/ParserATNSimulator.cs:787 — runtime/CSharp/src/Atn/ParserATNSimulator.cs:787-932 | runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:749-880 — These two members are one piece of code written twice and then edited apart: 132 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (119 corresponding lines) · ×1
  • Edited copy of a member (119 corresponding lines) runtime/CSharp/src/Atn/ParserATNSimulator.cs:657 — runtime/CSharp/src/Atn/ParserATNSimulator.cs:657-784 | runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:627-745 — These two members are one piece of code written twice and then edited apart: 119 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (48 corresponding lines) · ×1
  • Edited copy of a member (48 corresponding lines) runtime/Go/antlr/v4/parser_atn_simulator.go:996 — runtime/Go/antlr/v4/parser_atn_simulator.go:996-1060 | runtime/Go/antlr/v4/parser_atn_simulator.go:1063-1110 — These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (58 corresponding lines) · ×1
  • Edited copy of a member (58 corresponding lines) runtime/CSharp/src/Atn/PredictionContext.cs:411 — runtime/CSharp/src/Atn/PredictionContext.cs:411-478 | runtime/Java/src/org/antlr/v4/runtime/atn/PredictionContext.java:548-605 — These two members are one piece of code written twice and then edited apart: 58 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (85 corresponding lines) · ×1
  • Edited copy of a member (85 corresponding lines) runtime/CSharp/src/Atn/LexerATNSimulator.cs:488 — runtime/CSharp/src/Atn/LexerATNSimulator.cs:488-577 | runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java:470-554 — These two members are one piece of code written twice and then edited apart: 85 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (62 corresponding lines) · ×1
  • Edited copy of a member (62 corresponding lines) runtime/CSharp/src/Atn/PredictionContext.cs:492 — runtime/CSharp/src/Atn/PredictionContext.cs:492-561 | runtime/Java/src/org/antlr/v4/runtime/atn/PredictionContext.java:660-721 — These two members are one piece of code written twice and then edited apart: 62 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (75 corresponding lines) · ×1
  • Edited copy of a member (75 corresponding lines) runtime/CSharp/src/Misc/IntervalSet.cs:282 — runtime/CSharp/src/Misc/IntervalSet.cs:282-360 | runtime/Java/src/org/antlr/v4/runtime/misc/IntervalSet.java:229-303 — These two members are one piece of code written twice and then edited apart: 75 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (55 corresponding lines) · ×1
  • Edited copy of a member (55 corresponding lines) runtime/CSharp/src/Atn/ParserATNSimulator.cs:1544 — runtime/CSharp/src/Atn/ParserATNSimulator.cs:1544-1603 | runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:1447-1501 — These two members are one piece of code written twice and then edited apart: 55 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (51 corresponding lines) · ×1
  • Edited copy of a member (51 corresponding lines) tool/src/org/antlr/v4/parse/ScopeParser.java:144 — tool/src/org/antlr/v4/parse/ScopeParser.java:144-194 | tool/src/org/antlr/v4/parse/ScopeParser.java:196-248 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (70 corresponding lines) · ×1
  • Edited copy of a member (70 corresponding lines) runtime/CSharp/src/Atn/ParserATNSimulator.cs:1778 — runtime/CSharp/src/Atn/ParserATNSimulator.cs:1778-1851 | runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:1666-1735 — These two members are one piece of code written twice and then edited apart: 70 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (47 corresponding lines) · ×1
  • Edited copy of a member (47 corresponding lines) runtime/CSharp/src/Atn/ParserATNSimulator.cs:575 — runtime/CSharp/src/Atn/ParserATNSimulator.cs:575-627 | runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:553-599 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (31 corresponding lines) · ×1
  • Edited copy of a member (31 corresponding lines) runtime/Java/src/org/antlr/v4/runtime/misc/IntervalSet.java:475 — runtime/Java/src/org/antlr/v4/runtime/misc/IntervalSet.java:475-505 | runtime/Java/src/org/antlr/v4/runtime/misc/IntervalSet.java:515-545 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (67 corresponding lines) · ×1
  • Edited copy of a member (67 corresponding lines) runtime/CSharp/src/Atn/LexerATNSimulator.cs:142 — runtime/CSharp/src/Atn/LexerATNSimulator.cs:142-215 | runtime/Java/src/org/antlr/v4/runtime/atn/LexerATNSimulator.java:165-231 — These two members are one piece of code written twice and then edited apart: 67 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 41+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 41+ corresponding lines) runtime/CSharp/src/Atn/ParserATNSimulator.cs:1921 — runtime/CSharp/src/Atn/ParserATNSimulator.cs:1921-1963 | runtime/CSharp/src/Atn/ParserATNSimulator.cs:1971-2014 | runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:1846-1886 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 41 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 34+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 34+ corresponding lines) runtime/Go/antlr/v4/jcollect.go:159 — runtime/Go/antlr/v4/jcollect.go:159-198 | runtime/Go/antlr/v4/jcollect.go:300-339 | runtime/Go/antlr/v4/jcollect.go:542-575 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 34 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×1
  • Edited copy of a member (26 corresponding lines) runtime/Dart/lib/src/atn/src/semantic_context.dart:214 — runtime/Dart/lib/src/atn/src/semantic_context.dart:214-239 | runtime/Dart/lib/src/atn/src/semantic_context.dart:318-343 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 35+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 35+ corresponding lines) runtime/Swift/Sources/Antlr4/misc/BitSet.swift:279 — runtime/Swift/Sources/Antlr4/misc/BitSet.swift:279-313 | runtime/Swift/Sources/Antlr4/misc/BitSet.swift:360-394 | runtime/Swift/Sources/Antlr4/misc/BitSet.swift:447-489 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 35 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 25+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 25+ corresponding lines) tool/src/org/antlr/v4/automata/LexerATNFactory.java:736 — tool/src/org/antlr/v4/automata/LexerATNFactory.java:736-761 | tool/src/org/antlr/v4/automata/LexerATNFactory.java:763-787 | tool/src/org/antlr/v4/automata/LexerATNFactory.java:789-816 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (33 corresponding lines) · ×1
  • Edited copy of a member (33 corresponding lines) runtime/Go/antlr/v4/dfa_serializer.go:37 — runtime/Go/antlr/v4/dfa_serializer.go:37-69 | runtime/Go/antlr/v4/dfa_serializer.go:124-158 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×1
  • Edited copy of a member (21 corresponding lines) runtime/CSharp/src/Atn/LL1Analyzer.cs:38 — runtime/CSharp/src/Atn/LL1Analyzer.cs:38-60 | runtime/Java/src/org/antlr/v4/runtime/atn/LL1Analyzer.java:37-57 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (25 corresponding lines) · ×1
  • Edited copy of a member (25 corresponding lines) runtime/Swift/Sources/Antlr4/atn/SemanticContext.swift:188 — runtime/Swift/Sources/Antlr4/atn/SemanticContext.swift:188-212 | runtime/Swift/Sources/Antlr4/atn/SemanticContext.swift:283-307 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 26+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 26+ corresponding lines) runtime/Swift/Sources/Antlr4/misc/BitSet.swift:620 — runtime/Swift/Sources/Antlr4/misc/BitSet.swift:620-645 | runtime/Swift/Sources/Antlr4/misc/BitSet.swift:655-682 | runtime/Swift/Sources/Antlr4/misc/BitSet.swift:705-732 | runtime/Swift/Sources/Antlr4/misc/BitSet.swift:747-776 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 27+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 27+ corresponding lines) runtime/Go/antlr/v4/jcollect.go:203 — runtime/Go/antlr/v4/jcollect.go:203-229 | runtime/Go/antlr/v4/jcollect.go:351-378 | runtime/Go/antlr/v4/jcollect.go:513-540 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (30 corresponding lines) · ×1
  • Edited copy of a member (30 corresponding lines) runtime/Swift/Sources/Antlr4/atn/ATNConfig.swift:165 — runtime/Swift/Sources/Antlr4/atn/ATNConfig.swift:165-194 | runtime/Swift/Sources/Antlr4/atn/LexerATNConfig.swift:86-120 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 21+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 21+ corresponding lines) runtime/Java/src/org/antlr/v4/runtime/CodePointCharStream.java:164 — runtime/Java/src/org/antlr/v4/runtime/CodePointCharStream.java:164-184 | runtime/Java/src/org/antlr/v4/runtime/CodePointCharStream.java:219-239 | runtime/Java/src/org/antlr/v4/runtime/CodePointCharStream.java:270-290 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 10+ corresponding lines) runtime/Go/antlr/v4/parser_atn_simulator.go:1627 — runtime/Go/antlr/v4/parser_atn_simulator.go:1627-1636 | runtime/Go/antlr/v4/parser_atn_simulator.go:1639-1648 | runtime/Go/antlr/v4/parser_atn_simulator.go:1657-1666 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 8+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 8+ corresponding lines) runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:2126 — runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:2126-2133 | runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:2135-2142 | runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:2151-2160 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 13+ corresponding lines) runtime/CSharp/src/Misc/IntervalSet.cs:759 — runtime/CSharp/src/Misc/IntervalSet.cs:759-773 | runtime/CSharp/src/Misc/IntervalSet.cs:776-790 | runtime/Java/src/org/antlr/v4/runtime/misc/IntervalSet.java:583-595 | runtime/Java/src/org/antlr/v4/runtime/misc/IntervalSet.java:598-610 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 17+ corresponding lines) runtime/Go/antlr/v4/jcollect.go:123 — runtime/Go/antlr/v4/jcollect.go:123-146 | runtime/Go/antlr/v4/jcollect.go:281-298 | runtime/Go/antlr/v4/jcollect.go:491-507 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 15+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 15+ corresponding lines) runtime/CSharp/src/Atn/ConflictInfo.cs:59 — runtime/CSharp/src/Atn/ConflictInfo.cs:59-73 | runtime/CSharp/src/Atn/LexerActionExecutor.cs:256-270 | runtime/CSharp/src/Atn/LexerCustomAction.cs:145-159 | runtime/CSharp/src/Atn/LexerIndexedCustomAction.cs:160-174 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 6+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 6+ corresponding lines) runtime/CSharp/src/Atn/LexerChannelAction.cs:101 — runtime/CSharp/src/Atn/LexerChannelAction.cs:101-106 | runtime/CSharp/src/Atn/LexerCustomAction.cs:136-142 | runtime/CSharp/src/Atn/LexerModeAction.cs:99-104 | runtime/CSharp/src/Atn/LexerPushModeAction.cs:98-103 | runtime/CSharp/src/Atn/LexerTypeAction.cs:94-99 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (3 corresponding lines) · ×1
  • Edited copy of a member (3 corresponding lines) runtime/Swift/Sources/Antlr4/BufferedTokenStream.swift:475 — runtime/Swift/Sources/Antlr4/BufferedTokenStream.swift:475-481 | runtime/Swift/Sources/Antlr4/UnbufferedTokenStream.swift:119-121 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (4 corresponding lines) · ×1
  • Edited copy of a member (4 corresponding lines) runtime/Swift/Sources/Antlr4/atn/NotSetTransition.swift:18 — runtime/Swift/Sources/Antlr4/atn/NotSetTransition.swift:18-23 | runtime/Swift/Sources/Antlr4/atn/WildcardTransition.swift:18-21 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (18–27 lines × 2) · ×1
  • Duplicated block (18–27 lines × 2) tool/src/org/antlr/v4/codegen/ParserFactory.java:116 — tool/src/org/antlr/v4/codegen/ParserFactory.java:116-142 | tool/src/org/antlr/v4/codegen/ParserFactory.java:157-174 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `tool/src/org/antlr/v4/codegen/ParserFactory.java:116` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×1
  • Duplicated block (26 lines × 2) runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:1813 — runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:1813-1838 | runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:1861-1886 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java:1813` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (19–21 lines × 2) · ×1
  • Duplicated block (19–21 lines × 2) tool/src/org/antlr/v4/gui/TreeViewer.java:506 — tool/src/org/antlr/v4/gui/TreeViewer.java:506-526 | tool/src/org/antlr/v4/gui/TreeViewer.java:571-589 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `tool/src/org/antlr/v4/gui/TreeViewer.java:506` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×1
  • Duplicated block (13 lines × 2) runtime/Java/src/org/antlr/v4/runtime/misc/IntervalSet.java:476 — runtime/Java/src/org/antlr/v4/runtime/misc/IntervalSet.java:476-488 | runtime/Java/src/org/antlr/v4/runtime/misc/IntervalSet.java:516-528 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `runtime/Java/src/org/antlr/v4/runtime/misc/IntervalSet.java:476` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×1
  • Duplicated block (12–13 lines × 2) tool/src/org/antlr/v4/analysis/LeftRecursiveRuleAnalyzer.java:126 — tool/src/org/antlr/v4/analysis/LeftRecursiveRuleAnalyzer.java:126-138 | tool/src/org/antlr/v4/analysis/LeftRecursiveRuleAnalyzer.java:174-185 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `tool/src/org/antlr/v4/analysis/LeftRecursiveRuleAnalyzer.java:141` calls `nextPrecedence`, `addPrecedenceArgToRules`, `stripAltLabel` and `tool/src/org/antlr/v4/analysis/LeftRecursiveRuleAnalyzer.java:186` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×1
  • Duplicated block (9 lines × 4) runtime/CSharp/src/Misc/RuleDependencyChecker.cs:108 — runtime/CSharp/src/Misc/RuleDependencyChecker.cs:108-116 | runtime/CSharp/src/Misc/RuleDependencyChecker.cs:122-130 | runtime/CSharp/src/Misc/RuleDependencyChecker.cs:136-144 | runtime/CSharp/src/Misc/RuleDependencyChecker.cs:150-158 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `runtime/CSharp/src/Misc/RuleDependencyChecker.cs:108` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×1
  • Duplicated block (10 lines × 3) runtime/Java/src/org/antlr/v4/runtime/atn/LexerChannelAction.java:78 — runtime/Java/src/org/antlr/v4/runtime/atn/LexerChannelAction.java:78-87 | runtime/Java/src/org/antlr/v4/runtime/atn/LexerModeAction.java:77-86 | runtime/Java/src/org/antlr/v4/runtime/atn/LexerTypeAction.java:76-85 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (24 lines × 2) · ×1
  • Duplicated block (24 lines × 2) runtime/Go/antlr/v4/dfa_serializer.go:46 — runtime/Go/antlr/v4/dfa_serializer.go:46-69 | runtime/Go/antlr/v4/dfa_serializer.go:135-158 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `runtime/Go/antlr/v4/dfa_serializer.go:46` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×1
  • Duplicated block (27 lines × 2) runtime/Go/antlr/v4/parser_atn_simulator.go:1015 — runtime/Go/antlr/v4/parser_atn_simulator.go:1015-1041 | runtime/Go/antlr/v4/parser_atn_simulator.go:1068-1094 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `runtime/Go/antlr/v4/parser_atn_simulator.go:1015` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×1
  • Duplicated block (17–18 lines × 2) runtime/Go/antlr/v4/utils.go:333 — runtime/Go/antlr/v4/utils.go:333-350 | runtime/Go/antlr/v4/utils.go:359-375 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `runtime/Go/antlr/v4/utils.go:333` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×1
  • Duplicated block (15 lines × 2) runtime/Go/antlr/v4/comparators.go:61 — runtime/Go/antlr/v4/comparators.go:61-75 | runtime/Go/antlr/v4/comparators.go:130-144 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (25–27 lines × 2) · ×1
  • Duplicated block (25–27 lines × 2) runtime/Swift/Sources/Antlr4/atn/ParserATNSimulator.swift:1721 — runtime/Swift/Sources/Antlr4/atn/ParserATNSimulator.swift:1721-1747 | runtime/Swift/Sources/Antlr4/atn/ParserATNSimulator.swift:1765-1789 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `runtime/Swift/Sources/Antlr4/atn/ParserATNSimulator.swift:1721` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note first that the copies are not typed on the same thing: the declarations holding them bind `nil` to `ctx dependent=true") //if ( parser !=` in one and `ctx dependent=\(pt.isCtxDependent)") //if ( parser !=` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (21–22 lines × 2) · ×1
  • Duplicated block (21–22 lines × 2) runtime/Swift/Sources/Antlr4/misc/IntervalSet.swift:501 — runtime/Swift/Sources/Antlr4/misc/IntervalSet.swift:501-521 | runtime/Swift/Sources/Antlr4/misc/IntervalSet.swift:548-569 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `runtime/Swift/Sources/Antlr4/misc/IntervalSet.swift:501` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×1
  • Duplicated block (14–15 lines × 2) runtime/Swift/Sources/Antlr4/misc/BitSet.swift:280 — runtime/Swift/Sources/Antlr4/misc/BitSet.swift:280-293 | runtime/Swift/Sources/Antlr4/misc/BitSet.swift:361-375 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `runtime/Swift/Sources/Antlr4/misc/BitSet.swift:280` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7–9 lines × 2) · ×1
  • Duplicated block (7–9 lines × 2) runtime/Swift/Sources/Antlr4/atn/SemanticContext.swift:241 — runtime/Swift/Sources/Antlr4/atn/SemanticContext.swift:241-249 | runtime/Swift/Sources/Antlr4/atn/SemanticContext.swift:335-341 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `runtime/Swift/Sources/Antlr4/atn/SemanticContext.swift:241` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×1
  • Duplicated block (10 lines × 2) runtime/Dart/lib/src/atn/src/semantic_context.dart:271 — runtime/Dart/lib/src/atn/src/semantic_context.dart:271-280 | runtime/Dart/lib/src/atn/src/semantic_context.dart:375-384 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `runtime/Dart/lib/src/atn/src/semantic_context.dart:271` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×1
  • Duplicated block (7–8 lines × 2) runtime/Dart/lib/src/atn/src/atn_config.dart:143 — runtime/Dart/lib/src/atn/src/atn_config.dart:143-149 | runtime/Dart/lib/src/atn/src/atn_config.dart:215-222 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `runtime/Dart/lib/src/atn/src/atn_config.dart:143` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `runtime/Dart/lib/src/atn/src/atn_config.dart:223` calls `update` and `runtime/Dart/lib/src/atn/src/atn_config.dart:149` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D8 · Code Coverage · Coverage not measured · ×1
  • Coverage not measured — .NET and JavaScript/TypeScript suite — Coverage NOT MEASURED: the .NET half could not be measured — the repository wires up no coverage collector for `--collect:"XPlat Code Coverage"` to use; the JavaScript/TypeScript half could not be measured — runtime/JavaScript/ runs jasmine, which the coverage collector does not drive yet, so no lcov was produced — a gap in the analyzer, not something this repository is missing. This repository's production source spans both ecosystems, and no partial figure is published as if it were the whole: coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan.
R1 · Type Safety · Type Safety · ×1
  • Type Safety — 2 typed · 146 plain JS — the untyped files are runtime/JavaScript/spec/BitSetSpec.js, runtime/JavaScript/spec/HashMapSpec.js, runtime/JavaScript/spec/HashSetSpec.js, runtime/JavaScript/spec/IntervalSetSpec.js, runtime/JavaScript/spec/helpers/Reporter.js, runtime/JavaScript/spec/imports/NodeCommonJSImportSpec.cjs (+140 more).
R10 · Code Duplication · Duplicated block with local edits (58 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (58 matched lines × 2 locations) runtime/JavaScript/src/antlr4/misc/HashMap.js:8 — runtime/JavaScript/src/antlr4/misc/HashMap.js:8 · runtime/JavaScript/src/antlr4/misc/HashSet.js:9 — the two spans are one implementation copied and then locally edited — 327 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (34 lines × 2 locations) · ×1
  • Duplicated block (34 lines × 2 locations) runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:1423 — runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:1423 · runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:1458 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (22 lines × 2 locations) · ×1
  • Duplicated block (22 lines × 2 locations) runtime/JavaScript/src/antlr4/atn/SemanticContext.js:94 — runtime/JavaScript/src/antlr4/atn/SemanticContext.js:94 · runtime/JavaScript/src/antlr4/atn/SemanticContext.js:197 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (20 lines × 2 locations) · ×1
  • Duplicated block (20 lines × 2 locations) runtime/JavaScript/src/antlr4/atn/SemanticContext.js:129 — runtime/JavaScript/src/antlr4/atn/SemanticContext.js:129 · runtime/JavaScript/src/antlr4/atn/SemanticContext.js:230 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (17 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (17 matched lines × 2 locations) runtime/JavaScript/src/antlr4/Recognizer.js:97 — runtime/JavaScript/src/antlr4/Recognizer.js:97 · runtime/JavaScript/src/antlr4/error/DefaultErrorStrategy.js:542 — the two spans are one implementation copied and then locally edited — 73 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (16 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (16 matched lines × 2 locations) runtime/JavaScript/src/antlr4/atn/PrecedencePredicate.js:27 — runtime/JavaScript/src/antlr4/atn/PrecedencePredicate.js:27 · runtime/JavaScript/src/antlr4/atn/Predicate.js:18 — the two spans are one implementation copied and then locally edited — 63 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (12 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (12 matched lines × 2 locations) runtime/JavaScript/src/antlr4/transition/ActionTransition.js:8 — runtime/JavaScript/src/antlr4/transition/ActionTransition.js:8 · runtime/JavaScript/src/antlr4/transition/PredicateTransition.js:10 — the two spans are one implementation copied and then locally edited — 55 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (9 lines × 7 locations) · ×1
  • Duplicated block (9 lines × 7 locations) runtime/JavaScript/src/antlr4/action/LexerChannelAction.js:29 — runtime/JavaScript/src/antlr4/action/LexerChannelAction.js:29 · runtime/JavaScript/src/antlr4/action/LexerCustomAction.js:44 · runtime/JavaScript/src/antlr4/action/LexerIndexedCustomAction.js:48 · runtime/JavaScript/src/antlr4/action/LexerModeAction.js:27 · +3 more site(s) not listed — the 7 copies are spread across 7 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (9 lines × 2 locations) · ×1
  • Duplicated block (9 lines × 2 locations) runtime/JavaScript/src/antlr4/atn/SemanticContext.js:189 — runtime/JavaScript/src/antlr4/atn/SemanticContext.js:189 · runtime/JavaScript/src/antlr4/atn/SemanticContext.js:288 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (7 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (7 matched lines × 2 locations) runtime/JavaScript/src/antlr4/error/ErrorListener.js:12 — runtime/JavaScript/src/antlr4/error/ErrorListener.js:12 · runtime/JavaScript/src/antlr4/error/ProxyErrorListener.js:17 — the two spans are one implementation copied and then locally edited — 65 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (6 lines × 2 locations) · ×1
  • Duplicated block (6 lines × 2 locations) runtime/JavaScript/src/antlr4/atn/LexerATNSimulator.js:289 — runtime/JavaScript/src/antlr4/atn/LexerATNSimulator.js:289 · runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:735 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (6 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (6 matched lines × 2 locations) runtime/JavaScript/src/antlr4/utils/stringHashCode.js:34 — runtime/JavaScript/src/antlr4/utils/stringHashCode.js:34 · runtime/JavaScript/src/antlr4/utils/stringHashCode.js:55 — the two spans are one implementation copied and then locally edited — 119 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R2 · Cyclomatic Complexity · Complex function reduceToSingleOperationPerIndex (cyclomatic 31, cognitive 58) · ×1
  • Complex function reduceToSingleOperationPerIndex (cyclomatic 31, cognitive 58) runtime/JavaScript/src/antlr4/TokenStreamRewriter.js:215 — reduceToSingleOperationPerIndex has cyclomatic complexity 31 and cognitive complexity 58; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function mergeArrays (cyclomatic 30, cognitive 50) · ×1
  • Complex function mergeArrays (cyclomatic 30, cognitive 50) runtime/JavaScript/src/antlr4/context/PredictionContextUtils.js:131 — mergeArrays has cyclomatic complexity 30 and cognitive complexity 50; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function computeReachSet (cyclomatic 26, cognitive 45) · ×1
  • Complex function computeReachSet (cyclomatic 26, cognitive 45) runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:698 — computeReachSet has cyclomatic complexity 26 and cognitive complexity 45; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function execATN (cyclomatic 22, cognitive 54) · ×1
  • Complex function execATN (cyclomatic 22, cognitive 54) runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:395 — execATN has cyclomatic complexity 22 and cognitive complexity 54; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function _LOOK (cyclomatic 22, cognitive 40) · ×1
  • Complex function _LOOK (cyclomatic 22, cognitive 40) runtime/JavaScript/src/antlr4/atn/LL1Analyzer.js:113 — _LOOK has cyclomatic complexity 22 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function canDropLoopEntryEdgeInLeftRecursiveRule (cyclomatic 19, cognitive 20) · ×1
  • Complex function canDropLoopEntryEdgeInLeftRecursiveRule (cyclomatic 19, cognitive 20) runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:1316 — canDropLoopEntryEdgeInLeftRecursiveRule has cyclomatic complexity 19 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function closure (cyclomatic 18, cognitive 33) · ×1
  • Complex function closure (cyclomatic 18, cognitive 33) runtime/JavaScript/src/antlr4/atn/LexerATNSimulator.js:354 — closure has cyclomatic complexity 18 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function mergeSingletons (cyclomatic 18, cognitive 32) · ×1
  • Complex function mergeSingletons (cyclomatic 18, cognitive 32) runtime/JavaScript/src/antlr4/context/PredictionContextUtils.js:292 — mergeSingletons has cyclomatic complexity 18 and cognitive complexity 32; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function closure_ (cyclomatic 17, cognitive 44) · ×1
  • Complex function closure_ (cyclomatic 17, cognitive 44) runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:1260 — closure_ has cyclomatic complexity 17 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function readEdges (cyclomatic 17, cognitive 40) · ×1
  • Complex function readEdges (cyclomatic 17, cognitive 40) runtime/JavaScript/src/antlr4/atn/ATNDeserializer.js:242 — readEdges has cyclomatic complexity 17 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function verifyATN (cyclomatic 17, cognitive 22) · ×1
  • Complex function verifyATN (cyclomatic 17, cognitive 22) runtime/JavaScript/src/antlr4/atn/ATNDeserializer.js:463 — verifyATN has cyclomatic complexity 17 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function getEpsilonTarget (cyclomatic 15, cognitive 20) · ×1
  • Complex function getEpsilonTarget (cyclomatic 15, cognitive 20) runtime/JavaScript/src/antlr4/atn/LexerATNSimulator.js:409 — getEpsilonTarget has cyclomatic complexity 15 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function execATNWithFullContext (cyclomatic 14, cognitive 25) · ×1
  • Complex function execATNWithFullContext (cyclomatic 14, cognitive 25) runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:589 — execATNWithFullContext has cyclomatic complexity 14 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function getText (cyclomatic 14, cognitive 21) · ×1
  • Complex function getText (cyclomatic 14, cognitive 21) runtime/JavaScript/src/antlr4/TokenStreamRewriter.js:144 — getText has cyclomatic complexity 14 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function nextToken (cyclomatic 13, cognitive 30) · ×1
  • Complex function nextToken (cyclomatic 13, cognitive 30) runtime/JavaScript/src/antlr4/Lexer.js:91 — nextToken has cyclomatic complexity 13 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function getCachedPredictionContext (cyclomatic 13, cognitive 19) · ×1
  • Complex function getCachedPredictionContext (cyclomatic 13, cognitive 19) runtime/JavaScript/src/antlr4/context/PredictionContextUtils.js:33 — getCachedPredictionContext has cyclomatic complexity 13 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function toString (cyclomatic 12, cognitive 18) · ×1
  • Complex function toString (cyclomatic 12, cognitive 18) runtime/JavaScript/src/antlr4/context/RuleContext.js:135 — toString has cyclomatic complexity 12 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function sync (cyclomatic 12, cognitive 9) · ×1
  • Complex function sync (cyclomatic 12, cognitive 9) runtime/JavaScript/src/antlr4/error/DefaultErrorStrategy.js:197 — sync has cyclomatic complexity 12 and cognitive complexity 9; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function closureCheckingStopState (cyclomatic 11, cognitive 29) · ×1
  • Complex function closureCheckingStopState (cyclomatic 11, cognitive 29) runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:1211 — closureCheckingStopState has cyclomatic complexity 11 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function applyPrecedenceFilter (cyclomatic 11, cognitive 18) · ×1
  • Complex function applyPrecedenceFilter (cyclomatic 11, cognitive 18) runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:946 — applyPrecedenceFilter has cyclomatic complexity 11 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function getNodeText (cyclomatic 11, cognitive 15) · ×1
  • Complex function getNodeText (cyclomatic 11, cognitive 15) runtime/JavaScript/src/antlr4/tree/Trees.js:44 — getNodeText has cyclomatic complexity 11 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function readStates (cyclomatic 11, cognitive 13) · ×1
  • Complex function readStates (cyclomatic 11, cognitive 13) runtime/JavaScript/src/antlr4/atn/ATNDeserializer.js:136 — readStates has cyclomatic complexity 11 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function removeRange (cyclomatic 11, cognitive 13) · ×1
  • Complex function removeRange (cyclomatic 11, cognitive 13) runtime/JavaScript/src/antlr4/misc/IntervalSet.js:105 — removeRange has cyclomatic complexity 11 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function getText (cyclomatic 11, cognitive 10) · ×1
  • Complex function getText (cyclomatic 11, cognitive 10) runtime/JavaScript/src/antlr4/BufferedTokenStream.js:347 — getText has cyclomatic complexity 11 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files · runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js · ×1
  • runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js: 1656 lines of code runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js:1 — runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js has 1656 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · runtime/JavaScript/src/antlr4/error/DefaultErrorStrategy.js · ×1
  • runtime/JavaScript/src/antlr4/error/DefaultErrorStrategy.js: 669 lines of code runtime/JavaScript/src/antlr4/error/DefaultErrorStrategy.js:1 — runtime/JavaScript/src/antlr4/error/DefaultErrorStrategy.js has 669 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · runtime/JavaScript/src/antlr4/atn/LexerATNSimulator.js · ×1
  • runtime/JavaScript/src/antlr4/atn/LexerATNSimulator.js: 600 lines of code runtime/JavaScript/src/antlr4/atn/LexerATNSimulator.js:1 — runtime/JavaScript/src/antlr4/atn/LexerATNSimulator.js has 600 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · runtime/JavaScript/src/antlr4/Parser.js · ×1
  • runtime/JavaScript/src/antlr4/Parser.js: 590 lines of code runtime/JavaScript/src/antlr4/Parser.js:1 — runtime/JavaScript/src/antlr4/Parser.js has 590 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · runtime/JavaScript/src/antlr4/atn/ATNDeserializer.js · ×1
  • runtime/JavaScript/src/antlr4/atn/ATNDeserializer.js: 556 lines of code runtime/JavaScript/src/antlr4/atn/ATNDeserializer.js:1 — runtime/JavaScript/src/antlr4/atn/ATNDeserializer.js has 556 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · runtime/JavaScript/spec/rewriter/TokenStreamRewriterSpec.js · ×1
  • runtime/JavaScript/spec/rewriter/TokenStreamRewriterSpec.js: 549 lines of code runtime/JavaScript/spec/rewriter/TokenStreamRewriterSpec.js:1 — runtime/JavaScript/spec/rewriter/TokenStreamRewriterSpec.js has 549 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · runtime/JavaScript/src/antlr4/atn/PredictionMode.js · ×1
  • runtime/JavaScript/src/antlr4/atn/PredictionMode.js: 544 lines of code runtime/JavaScript/src/antlr4/atn/PredictionMode.js:1 — runtime/JavaScript/src/antlr4/atn/PredictionMode.js has 544 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · runtime/JavaScript/src/antlr4/context/PredictionContextUtils.js · ×1
  • runtime/JavaScript/src/antlr4/context/PredictionContextUtils.js: 431 lines of code runtime/JavaScript/src/antlr4/context/PredictionContextUtils.js:1 — runtime/JavaScript/src/antlr4/context/PredictionContextUtils.js has 431 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · runtime/JavaScript/src/antlr4/TokenStreamRewriter.js · ×1
  • runtime/JavaScript/src/antlr4/TokenStreamRewriter.js: 405 lines of code runtime/JavaScript/src/antlr4/TokenStreamRewriter.js:1 — runtime/JavaScript/src/antlr4/TokenStreamRewriter.js has 405 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R7 · Dead Code · Dead file (~12 LoC) · ×1
  • Dead file (~12 LoC) runtime/JavaScript/src/antlr4/context/InterpreterRuleContext.js — no import path from any entry point (5 application, 66 tooling, 12 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~9 LoC) · ×1
  • Dead file (~9 LoC) runtime/JavaScript/src/antlr4/utils/titleCase.js — no import path from any entry point (5 application, 66 tooling, 12 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R8 · Dependency Hygiene · Unused dependency 'glob-parent' · ×1
  • Unused dependency 'glob-parent' — Declared in runtime/JavaScript/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
R8 · Dependency Hygiene · Unused dependency 'minimist' · ×1
  • Unused dependency 'minimist' — Declared in runtime/JavaScript/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
R8 · Dependency Hygiene · Unused dependency 'source-map-support' · ×1
  • Unused dependency 'source-map-support' — Declared in runtime/JavaScript/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
SC1 · Supply-chain hygiene · NuGet dependencies are not locked · ×1
  • NuGet dependencies are not locked — No packages.lock.json and no central package management — restores aren't reproducible or pinned (SSDF PW.4.4). Enable <RestorePackagesWithLockFile>true</RestorePackagesWithLockFile> (commit the lockfile) or adopt Directory.Packages.props. Advisory — never scored.
Minor — 121 finding(s)
D34 · Knowledge Freshness · Orphaned file · ×83
  • Orphaned file runtime/CSharp/src/Misc/IntervalSet.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file runtime/CSharp/src/TokenStreamRewriter.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file runtime/CSharp/src/Tree/Pattern/ParseTreePatternMatcher.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file runtime/CSharp/src/Misc/RuleDependencyChecker.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file runtime/CSharp/src/BufferedTokenStream.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file runtime/CSharp/src/Lexer.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file runtime/CSharp/src/Atn/SemanticContext.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file runtime/CSharp/src/UnbufferedCharStream.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file runtime/CSharp/src/ParserRuleContext.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file runtime/CSharp/src/IIntStream.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file runtime/CSharp/src/Recognizer.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file runtime/CSharp/src/UnbufferedTokenStream.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file runtime/CSharp/src/ParserInterpreter.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file runtime/CSharp/src/Atn/LexerActionExecutor.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file runtime/CSharp/src/ListTokenSource.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file runtime/CSharp/src/Atn/ATNConfigSet.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file runtime/CSharp/src/CommonToken.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file runtime/CSharp/src/Tree/Pattern/ParseTreeMatch.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file runtime/CSharp/src/Tree/Xpath/XPath.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file runtime/CSharp/src/RuleContext.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file runtime/CSharp/src/AntlrInputStream.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file runtime/CSharp/src/Atn/ATN.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file runtime/CSharp/src/Misc/IIntSet.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file runtime/CSharp/src/IParserErrorListener.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file runtime/CSharp/src/Sharpen/BitSet.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • + 58 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×11
  • Duplicated predicate runtime/CSharp/src/Atn/ATN.cs:246 — `ctx != null && ctx.invokingState >= 0 && following.Contains(TokenConstants.EPSILON)` appears character-identically in 2 files — runtime/CSharp/src/Atn/ATN.cs, runtime/CSharp/src/Parser.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate runtime/Dart/lib/src/atn/src/atn.dart:153 — `ctx != null && ctx.invokingState >= 0 && following.contains(Token.EPSILON)` appears character-identically in 2 files — runtime/Dart/lib/src/atn/src/atn.dart, runtime/Dart/lib/src/parser.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate runtime/Go/antlr/v4/atn.go:162 — `ctx != nil && ctx.GetInvokingState() >= 0 && following.contains(TokenEpsilon)` appears character-identically in 2 files — runtime/Go/antlr/v4/atn.go, runtime/Go/antlr/v4/parser.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate tool/src/org/antlr/v4/tool/Alternative.java:119 — `anyLabelDef!=null && (anyLabelDef.type==LabelType.RULE_LIST_LABEL || anyLabelDef.type==LabelType.TOKEN_LIST_LABEL)` appears character-identically in 2 files — tool/src/org/antlr/v4/tool/Alternative.java, tool/src/org/antlr/v4/tool/Rule.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate tool/src/org/antlr/v4/tool/Alternative.java:70 — `anyLabelDef!=null && anyLabelDef.type==LabelType.RULE_LABEL` appears character-identically in 2 files — tool/src/org/antlr/v4/tool/Alternative.java, tool/src/org/antlr/v4/tool/Rule.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate tool/src/org/antlr/v4/tool/Alternative.java:61 — `anyLabelDef!=null && anyLabelDef.type==LabelType.TOKEN_LABEL` appears character-identically in 2 files — tool/src/org/antlr/v4/tool/Alternative.java, tool/src/org/antlr/v4/tool/Rule.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate runtime/Java/src/org/antlr/v4/runtime/BufferedTokenStream.java:290 — `types==null || types.contains(t.getType())` appears character-identically in 2 files — runtime/Java/src/org/antlr/v4/runtime/BufferedTokenStream.java, tool/src/org/antlr/v4/tool/ast/GrammarAST.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate tool/src/org/antlr/v4/semantics/BasicSemanticChecks.java:497 — `valueText.equals("true") || valueText.equals("false")` appears character-identically in 2 files — tool/src/org/antlr/v4/semantics/BasicSemanticChecks.java, tool/src/org/antlr/v4/semantics/RuleCollector.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate runtime/JavaScript/src/antlr4/Parser.js:515 — `ctx !== null && ctx.invokingState >= 0 && following.contains(Token.EPSILON)` appears character-identically in 2 files — runtime/JavaScript/src/antlr4/Parser.js, runtime/JavaScript/src/antlr4/atn/ATN.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate runtime/JavaScript/src/antlr4/misc/HashMap.js:18 — `equalsFunction || standardEqualsFunction` appears character-identically in 2 files — runtime/JavaScript/src/antlr4/misc/HashMap.js, runtime/JavaScript/src/antlr4/misc/HashSet.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate runtime/JavaScript/src/antlr4/misc/HashMap.js:17 — `hashFunction || standardHashCodeFunction` appears character-identically in 2 files — runtime/JavaScript/src/antlr4/misc/HashMap.js, runtime/JavaScript/src/antlr4/misc/HashSet.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
D24 · Comment Value · redundant comment · ×6
  • redundant comment runtime/CSharp/src/DefaultErrorStrategy.cs:559 — "SINGLE TOKEN DELETION" repeats the code it sits on: 3 of its 3 words (single, token, deletion) are already in `IToken matchedSymbol = SingleTokenDeletion(recognizer);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment runtime/CSharp/src/DefaultErrorStrategy.cs:568 — "SINGLE TOKEN INSERTION" repeats the code it sits on: 3 of its 3 words (single, token, insertion) are already in `if (SingleTokenInsertion(recognizer))`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment runtime/JavaScript/src/antlr4/BufferedTokenStream.js:155 — "Get all tokens from start..stop inclusively///" repeats the code it sits on: 4 of its 5 words (get, tokens, start, stop) are already in `getTokens(start, stop, types)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment runtime/JavaScript/src/antlr4/Parser.js:209 — "Remove all parse listeners." repeats the code it sits on: 3 of its 3 words (remove, parse, listeners) are already in `removeParseListeners()`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment runtime/JavaScript/src/antlr4/error/DefaultErrorStrategy.js:412 — "SINGLE TOKEN DELETION" repeats the code it sits on: 3 of its 3 words (single, token, deletion) are already in `const matchedSymbol = this.singleTokenDeletion(recognizer)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment runtime/JavaScript/src/antlr4/error/DefaultErrorStrategy.js:420 — "SINGLE TOKEN INSERTION" repeats the code it sits on: 3 of its 3 words (single, token, insertion) are already in `if (this.singleTokenInsertion(recognizer))`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
D34 · Knowledge Freshness · Most significant orphaned file · ×3
  • Most significant orphaned file runtime/CSharp/src/Parser.cs:1 — One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
  • Most significant orphaned file runtime/CSharp/src/DefaultErrorStrategy.cs:1 — One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
  • Most significant orphaned file runtime/CSharp/src/Atn/PredictionMode.cs:1 — One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
AX6 · Interface segregation · Fat interface · ×2
  • Fat interface: ATNFactory (26 abstract methods) tool/src/org/antlr/v4/automata/ATNFactory.java:19 — `ATNFactory` declares 26 abstract methods: `action`, `action`, `alt`, `block`, `charSetLiteral`, `createATN`, `epsilon`, `label`, `lexerAltCommands`, `lexerCallCommand`, `lexerCommand`, `listLabel`, `newState`, `optional`, `plus`, `range`, `rule`, `ruleRef`, `sempred`, `set`, `setCurrentOuterAlt`, `setCurrentRuleName`, `star`, `stringLiteral`, `tokenRef`, `wildcard`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. Those 26 declarations carry 25 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 25 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: OutputModelFactory (35 abstract methods) tool/src/org/antlr/v4/codegen/OutputModelFactory.java:31 — `OutputModelFactory` declares 35 abstract methods: `action`, `alternative`, `epsilon`, `finishAlternative`, `getChoiceBlock`, `getCodeBlockLevel`, `getComplexChoiceBlock`, `getComplexEBNFBlock`, `getController`, `getCurrentBlock`, `getCurrentOuterMostAlt`, `getCurrentOuterMostAlternativeBlock`, `getCurrentRuleFunction`, `getEBNFBlock`, `getGenerator`, `getGrammar`, `getLL1ChoiceBlock`, `getLL1EBNFBlock`, `getLL1Test`, `getRoot`, `getTreeLevel`, `lexer`, `lexerFile`, `needsImplicitLabel`, `parser`, `parserFile`, `rule`, `rulePostamble`, `ruleRef`, `sempred`, `set`, `setController`, `stringRef`, `tokenRef`, `wildcard`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
X7 · Silent fallback defaults · Silent fallback default in catch · ×2
  • Silent fallback default in catch runtime/Swift/Sources/Antlr4/atn/ParserATNSimulator.swift:2053 — `getTextInInterval` turns every thrown error into `"<unknown>"` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
  • Silent fallback default in catch runtime/Swift/Sources/Antlr4/DiagnosticErrorListener.swift:138 — `getTextInInterval` turns every thrown error into `"<unknown>"` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
D16 · Bus Factor · Off-boarding risk · ×1
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 1 significant file(s) lose their only recent owner: runtime/CSharp/src/IVocabulary.cs. Pair on, review, or document these before any departure.
D19 · Documentation Quality · Documentation · ×1
  • Documentation: no build, run or usage example runtime/JavaScript/README.md:1 — `JavaScript` is a published package (`package.json` without `"private": true`) and neither `runtime/JavaScript/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
D21 · Naming Consistency · `InitERROR` spells `ERROR` where 44 names in the project spell it `Error` · ×1
  • `InitERROR` spells `ERROR` where 44 names in the project spell it `Error` runtime/CSharp/src/Atn/ATNSimulator.cs:22 — 44 of 45 names in project Antlr4 spell the token `Error` (44 of 45; unit: names in project Antlr4 containing `Error`). Peers: Antlr4.Runtime.BailErrorStrategy (runtime/CSharp/src/BailErrorStrategy.cs:44); Antlr4.Runtime.BaseErrorListener (runtime/CSharp/src/BaseErrorListener.cs:21); BaseErrorListener.SyntaxError (runtime/CSharp/src/BaseErrorListener.cs:23); Antlr4.Runtime.ConsoleErrorListener (runtime/CSharp/src/ConsoleErrorListener.cs:11); ConsoleErrorListener.SyntaxError (runtime/CSharp/src/ConsoleErrorListener.cs:38). Rename to `InitError`. [rule N6]
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Low CVE · ×1
  • REDACTED
D34 · Knowledge Freshness · Concentrated knowledge decay · ×1
  • Concentrated knowledge decay — 86 of 96 significant files have no living knowledge, while the repository is still being changed at a low rate (1 commit(s) in the last 90 days) — so this is one repo-wide knowledge-decay state, not 86 separate risks. Counted over 96 of the 179 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over. The code moved on without the people who understood these files: document them or schedule a read-through before the next change lands in them.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
M4 · Documentation accuracy · README/code drift · ×1
  • README/code drift doc/javascript-target.md:18 — doc/javascript-target.md names Node.js 14, but the repository declares engines `>=16`. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
P10 · Library API & versioning · Implementation type on the public API · ×1
  • Implementation type on the public API runtime/CSharp/src/Tree/ErrorNodeImpl.cs:22 — 2 public types in `Antlr4.Runtime.Tree` are marked as implementation by their own namespace, folder or name: `ErrorNodeImpl` (runtime/CSharp/src/Tree/ErrorNodeImpl.cs:22, name ends in `Impl`), `TerminalNodeImpl` (runtime/CSharp/src/Tree/TerminalNodeImpl.cs:9, name ends in `Impl`). While they are public, every consumer of the library can bind to them, so changing them is a breaking change for those consumers.
P3 · Security & performance tooling · No SAST · ×1
  • No SAST REDACTED:10 — No static application security testing detected. For this repository's stack, add spotbugs with find-sec-bugs (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 1 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
P3 · Security & performance tooling · No dependency-update automation · ×1
  • No dependency-update automation runtime/CSharp/tests/issue-2693/Test.csproj:18 — `runtime/CSharp/tests/issue-2693/Test.csproj` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
P6 · Release Hygiene · Changelog looks stale/thin · ×1
  • Changelog looks stale/thin — The changelog this check read carries 1 versioned entry, against a bar of 3. Counted as either the distinct `x.y.z` versions it names (a link's target is not counted) or its version-shaped section headings (`## [1.2.0]`, `## V14.x.x`, `## Updates in 8.0.x`), whichever is the larger — so a log sectioned by minor series counts its sections, not its individual patch numbers. Entries recorded somewhere this check does not read — release notes generated at tag time from a generator config it did not recognise, or a log kept outside the repository — are not counted here, and this row is about what is re-findable in the tree rather than about how often you release.
R7 · Dead Code · Unused export 'default' · ×1
  • Unused export 'default' runtime/JavaScript/src/antlr4/TokenSource.js:5 — Nothing imports this binding — it is safe to review for removal.
Minor — 7 finding(s)
D10 · Test Quality · Skipped (documented) · ×5
  • Skipped (documented): test_aex_bfx tool-testsuite/test/org/antlr/v4/test/tool/TestGraphNodes.java:396 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Disabled
  • Skipped (documented): testStartRuleWithoutEOF tool-testsuite/test/org/antlr/v4/test/tool/TestParserExec.java:57 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Disabled
  • Skipped (documented): testDeepLookahead tool-testsuite/test/org/antlr/v4/test/tool/TestParserProfiler.java:184 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Disabled
  • Skipped (documented): testSimpleLanguage tool-testsuite/test/org/antlr/v4/test/tool/TestParserProfiler.java:167 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Disabled
  • Skipped (documented): compileJdk tool-testsuite/test/org/antlr/v4/test/tool/TestPerformance.java:392 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Disabled
D24 · Comment Value · doc comments repeat the names · ×2
  • doc comments repeat the names runtime/CSharp/src/Atn/ATNDeserializer.cs:467 — 13 of 205 documented parameters and 5 of 593 summaries in `Antlr4` only repeat the member or parameter name (e.g. "The ATN." for `atn`). 1 documentation tag(s) are empty. Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names runtime/JavaScript/src/antlr4/atn/ATNDeserializer.js:440 — 8 of 98 documented parameters and 0 of 193 summaries in `antlr4` only repeat the member or parameter name (e.g. "The ATN." for `atn`). 2 documentation tag(s) are empty. Delete the restating tags, or add what the name does not say.

Appendix B — Reproduction & audit trail

Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-7b4ae7c11c5a4742b69d0b31b1e00442/history.json --exit-code 0 --source .3artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-7b4ae7c11c5a4742b69d0b31b1e00442/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .29artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .19artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .6artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 1 file(s) — `runtime/Swift/Sources/Antlr4/atn/PredictionContext.swift` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .0artifacts/raw/trivy-fs.json

Run 01a1d53e-b548-7b19-af3c-506be0a60eed · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.

⬇ Findings, MITRE CWE-tagged .sarif⬇ Health changelog .md