Public report of bazelbuild/bazel, published 24 October 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.10.5). Watchdog 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, 24 October 2026, 11:05 UTC · Survey ID cd_97b555129263465c9fc3517ec5032ef3

bazelbuild/bazel

Measured 24 October 2026, 10:28 UTC, at code version 48d6db7

No regression since the last survey Test reliability: not measured

A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.

Test reliability is not measured: The suite could not be re-run, but the repository declares tests of its own unreliable.

CAI score 60out of 100 At risk 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 very large codebase: 595,527 lines of product code in 119 projects, tests not counted · Estimated rebuild effort: about 10.2 person-years · Weakest lens: Maturity, 55

Findings by how serious they are

42 critical 5676 serious 416 minor

15 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks 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

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
24 October 2026, 10:28 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 Watchdog. It is open to any tool that implements it, and today Watchdog is the only one that does.

A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.

The score is deterministic, which means the same code always gets the same score. Watchdog works 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 ▸

62of 65 dimensions measured by tools. The other 3 are advisory notes from an AI model, which explain the code but don't count towards the score.
6106of 6134 findings point to an exact file and line, so you can open each one in the code. The other 28 concern the repository as a whole, such as missing documentation.
65dimensions across 6 lenses, read from 595,527 lines of product code in 119 projects.
Chapters

Executive summary

bazelbuild/bazel scores 60 out of 100, but it is rated At risk while a critical security finding is open; the score itself is unchanged.

The weakest lens counts most in the score, and here that is Maturity, which scores 55 and is rated Adequate. Its Architecture documentation dimension scores 0 out of 10, and until that reaches 4, Maturity can't be rated higher than Adequate. The first actions are to resolve the 1 Documentation finding(s) in Documentation Quality and to resolve the 1 Orphaned knowledge finding(s) in Knowledge Freshness, and if Maturity rose to 70, the score would rise from 60 to about 64.

42 findings are critical: 17 in Test Quality, eight in Secrets (history), five in Static Analysis (SAST), three in Dependency Vulnerabilities, three in REDACTED Scanning, three in Test Reliability, one in Change Coupling, one in Knowledge Freshness and one in License Compliance.

Watchdog couldn't measure 14 dimensions in this code, among them Code Coverage, Dependency Hygiene and ADR Quality, so they are left out of the score. The product code is 595,527 lines, which would take an estimated 10.2 person-years, around €1,500,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.
Maturity 55 · counts for 46%Production Readiness 60 · counts for 25%Code Health 65 · counts for 14%Security and Compliance 67 · counts for 8%Performance 71 · counts for 4%Architecture 91 · counts for 2%

If Maturity rose from 55 to 70, the lowest score rated Strong, the score would rise from 60 to about 64.

Code composition: what the lines of code are
Product code 52%Tests 48%
New since the last survey: 83 findings

These 83 critical or serious findings weren't in the previous survey, on 10 October 2026.

  • Cyclomatic Complexity · NodeDependencyHandler.reduce (cyclomatic 21) src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/FileDependencySerializer.java
  • Cyclomatic Complexity · JavaUtil.javaSegmentIndexImpl (cyclomatic 19) src/main/java/com/google/devtools/build/lib/rules/java/JavaUtil.java
  • Cyclomatic Complexity · ActionExecutionFunction.checkCacheAndExecuteIfNeeded (cyclomatic 17) src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java
  • Cyclomatic Complexity · ConfigExpander.expandConfigOptions (cyclomatic 17) src/main/java/com/google/devtools/build/lib/runtime/ConfigExpander.java
  • Cyclomatic Complexity · CommonPrerequisiteValidator.validateDirectPrerequisiteVisibility (cyclomatic 17) src/main/java/com/google/devtools/build/lib/analysis/CommonPrerequisiteValidator.java
  • Cyclomatic Complexity · PathFragment.subFragmentImpl (cyclomatic 16) src/main/java/com/google/devtools/build/lib/vfs/PathFragment.java
  • Cyclomatic Complexity · ActionExecutionFunction.addDiscoveredInputs (cyclomatic 16) src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java
  • Cyclomatic Complexity · ConfiguredTargetFactory.createConfiguredTarget (cyclomatic 16) src/main/java/com/google/devtools/build/lib/analysis/ConfiguredTargetFactory.java
  • Cognitive Complexity · NodeDependencyHandler.reduce (cognitive 29) src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/FileDependencySerializer.java
  • Cognitive Complexity · ActionExecutionFunction.addDiscoveredInputs (cognitive 27) src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java
  • Cognitive Complexity · JavaUtil.javaSegmentIndexImpl (cognitive 27) src/main/java/com/google/devtools/build/lib/rules/java/JavaUtil.java
  • Cognitive Complexity · Eval.execFor (cognitive 26) src/main/java/net/starlark/java/eval/Eval.java
  • Cognitive Complexity · ConfigExpander.expandConfigOptions (cognitive 23) src/main/java/com/google/devtools/build/lib/runtime/ConfigExpander.java
  • Cognitive Complexity · ActionRunner.actuallyCompleteAction (cognitive 18) src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java
  • Cognitive Complexity · JavaCompileAction.createFullOutputDeps (cognitive 18) src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileAction.java
  • Cognitive Complexity · DefaultNestedSetBuilder.addTransitiveImpl (cognitive 17) src/main/java/com/google/devtools/build/lib/collect/nestedset/NestedSetBuilder.java
  • Cognitive Complexity · ArgumentProcessor.addNamedArg (cognitive 16) src/main/java/net/starlark/java/eval/BuiltinFunction.java
  • Cognitive Complexity · DependencyResolutionHelpers.resolveAttributes (cognitive 16) src/main/java/com/google/devtools/build/lib/analysis/DependencyResolutionHelpers.java
  • God Classes · TooManyMethods: StarlarkFunction src/main/java/net/starlark/java/eval/StarlarkFunction.java
  • God Classes · FileTooLong: runtime/BlazeOptionHandler.java src/main/java/com/google/devtools/build/lib/runtime/BlazeOptionHandler.java
  • God Classes · FileTooLong: repository/RepositoryOptions.java src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryOptions.java
  • God Classes · ClassTooLong: NestedSet src/main/java/com/google/devtools/build/lib/collect/nestedset/NestedSet.java
  • God Classes · TooManyMethods: CriticalPathComponent src/main/java/com/google/devtools/build/lib/metrics/criticalpath/CriticalPathComponent.java
  • God Classes · FileTooLong: analysis/CommonPrerequisiteValidator.java src/main/java/com/google/devtools/build/lib/analysis/CommonPrerequisiteValidator.java
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) src/main/java/com/google/devtools/build/lib/bazel/commands/FetchCommand.java
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) src/main/java/com/google/devtools/build/lib/runtime/commands/AqueryCommand.java
  • Code Duplication · Duplicated block (14–16 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/BzlCompileFunction.java
  • Code Duplication · Duplicated block (14 lines × 2) src/main/java/com/google/devtools/build/lib/analysis/ConfiguredAspect.java
  • Code Duplication · Duplicated block (8 lines × 2) src/main/java/com/google/devtools/common/options/InvocationPolicyEnforcer.java
  • Cohesion (LCOM4) · Low cohesion: Builder (LCOM4 5) src/main/java/com/google/devtools/build/lib/analysis/ConfiguredRuleClassProvider.java
  • Cohesion (LCOM4) · Low cohesion: TypeTable (LCOM4 4) src/main/java/net/starlark/java/syntax/TypeTable.java
  • Test Quality · No assertions: labelFlagDepsFailRefinedEnvironmentCheckWhenIncompatible src/test/java/com/google/devtools/build/lib/analysis/constraints/ConstraintsTest.java
  • Test Quality · No assertions: testGetReachableLabelsWithDefaultValues_noDefaultValue src/test/java/com/google/devtools/build/lib/analysis/select/AggregatingAttributeMapperTest.java
  • Test Quality · No assertions (empty test): testAttributeTypeChecking src/test/java/com/google/devtools/build/lib/analysis/select/NonconfigurableAttributeMapperTest.java
  • Test Quality · No assertions (empty test): testVisitation src/test/java/com/google/devtools/build/lib/analysis/select/NonconfigurableAttributeMapperTest.java
  • Test Quality · No assertions (empty test): testOptionConversionCrosstoolTop src/test/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttrTransitionProviderTest.java
  • Test Quality · No assertions (empty test): testOptionConversionDynamicMode src/test/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttrTransitionProviderTest.java
  • Test Quality · No assertions: testAspectSubruleImplicitDep_visibility src/test/java/com/google/devtools/build/lib/analysis/starlark/StarlarkSubruleTest.java
  • Test Quality · No assertions: testSubruleImplicitDep_transitiveSubruleVisibility src/test/java/com/google/devtools/build/lib/analysis/starlark/StarlarkSubruleTest.java
  • Test Quality · No assertions: testSubruleImplicitDep_visibleOnlyToConsumingRulePackage_fails src/test/java/com/google/devtools/build/lib/analysis/starlark/StarlarkSubruleTest.java
  • Test Quality · No assertions: testSubruleImplicitDep_visibleToSubrulePackage_passes src/test/java/com/google/devtools/build/lib/analysis/starlark/StarlarkSubruleTest.java
  • Test Quality · No assertions: testInvalidModuleInjection src/test/java/com/google/devtools/build/lib/bazel/repository/RepositoryOptionsTest.java
  • Test Quality · No assertions: testInvalidModuleOverride src/test/java/com/google/devtools/build/lib/bazel/repository/RepositoryOptionsTest.java
  • Test Quality · No assertions (empty test): testGraphOrderOfWildcards src/test/java/com/google/devtools/build/lib/query2/engine/GraphlessQueryTest.java
  • Test Quality · No assertions: actionTemplateExpansionRewound_symlinkToTreeLost src/test/java/com/google/devtools/build/lib/skyframe/rewinding/RewindingTest.java
  • Test Quality · No assertions: changedRewoundOutputDetected src/test/java/com/google/devtools/build/lib/skyframe/rewinding/RewindingTest.java
  • Test Quality · No assertions: changedRewoundOutputFromPreviousBuildDetected src/test/java/com/google/devtools/build/lib/skyframe/rewinding/RewindingTest.java
  • Test Quality · No assertions: deterministicRewoundOutputCheckSucceeds src/test/java/com/google/devtools/build/lib/skyframe/rewinding/RewindingTest.java
  • Test Quality · No assertions: omittedRewoundOutputCheckSucceeds src/test/java/com/google/devtools/build/lib/skyframe/rewinding/RewindingTest.java
  • Test Quality · No assertions: sharedRewoundOutputCheckIsBestEffort src/test/java/com/google/devtools/build/lib/skyframe/rewinding/RewindingTest.java
  • Test Quality · No assertions: sharedRewoundOutputCheckSucceeds src/test/java/com/google/devtools/build/lib/skyframe/rewinding/RewindingTest.java
  • Test Quality · No assertions: testDirectoryWithSubdirectoryMovedOutAndRecreated src/test/java/com/google/devtools/build/lib/skyframe/LocalDiffAwarenessTest.java
  • Test Quality · No assertions: testAbsoluteSymlinkRelativePathThrowsEvalError src/test/java/com/google/devtools/build/lib/rules/cpp/StarlarkCcCommonTest.java
  • Test Quality · No assertions: testForLoopIterationLock src/test/java/net/starlark/java/eval/EvaluationTest.java
  • Test Quality · No assertions: testForLoopOverSequences src/test/java/net/starlark/java/eval/EvaluationTest.java
  • Test Quality · No assertions: testJavaFunctionMutatingEmptyKwargs src/test/java/net/starlark/java/eval/StarlarkEvaluationTest.java
  • Test Quality · No assertions: testFlagGuardedMethods src/test/java/net/starlark/java/eval/StarlarkFlagGuardingTest.java
  • Test Quality · No assertions: testNonExperimentalOrIncompatibleGuardedParam src/test/java/net/starlark/java/eval/StarlarkFlagGuardingTest.java
  • REDACTED Scanning · REDACTED
  • REDACTED Scanning · REDACTED
  • Churn × Complexity Hotspots · Hotspot: src/main/java/com/google/devtools/build/lib/collect/nestedset/NestedSet.java src/main/java/com/google/devtools/build/lib/collect/nestedset/NestedSet.java
  • Churn × Complexity Hotspots · Hotspot: src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java
  • Churn × Complexity Hotspots · Hotspot: src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java
  • Churn × Complexity Hotspots · Hotspot: src/main/java/com/google/devtools/build/skyframe/AbstractParallelEvaluator.java src/main/java/com/google/devtools/build/skyframe/AbstractParallelEvaluator.java
  • Churn × Complexity Hotspots · Hotspot: src/main/java/com/google/devtools/build/lib/vfs/WindowsOsPathPolicy.java src/main/java/com/google/devtools/build/lib/vfs/WindowsOsPathPolicy.java
  • Churn × Complexity Hotspots · Hotspot: src/main/java/com/google/devtools/build/lib/rules/java/JavaHeaderCompileAction.java src/main/java/com/google/devtools/build/lib/rules/java/JavaHeaderCompileAction.java
  • Churn × Complexity Hotspots · Hotspot: src/main/java/com/google/devtools/build/lib/buildtool/SymlinkForest.java src/main/java/com/google/devtools/build/lib/buildtool/SymlinkForest.java
  • Churn × Complexity Hotspots · Hotspot: src/main/java/com/google/devtools/build/lib/rules/java/JavaUtil.java src/main/java/com/google/devtools/build/lib/rules/java/JavaUtil.java
  • Explicit Debt · TodoComment src/main/java/com/google/devtools/build/lib/analysis/RuleDefinitionEnvironment.java
  • Explicit Debt · TodoComment src/main/java/com/google/devtools/build/lib/bazel/rules/java/BazelJavaSemantics.java
  • Explicit Debt · TodoComment src/main/java/com/google/devtools/build/lib/rules/java/JavaSemantics.java
  • Explicit Debt · TodoComment src/main/java/com/google/devtools/build/lib/rules/java/JavaHeaderCompileAction.java
  • Explicit Debt · TodoComment src/main/java/com/google/devtools/build/lib/rules/java/JavaHeaderCompileAction.java
  • Explicit Debt · TodoComment src/main/java/com/google/devtools/build/lib/skyframe/TreeArtifactValue.java
  • Explicit Debt · TodoComment src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/FrontierSerializer.java
  • Explicit Debt · TodoComment src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/FileDependencySerializer.java
  • Explicit Debt · TodoComment src/main/java/net/starlark/java/syntax/Types.java
  • Dependency Vulnerabilities · REDACTED
  • Knowledge Freshness · Orphaned knowledge src/main/java/com/google/devtools/build/skyframe/InvalidatingNodeVisitor.java
  • Change Coupling · Change-coupling hub: BuildTool.java → Project.java, ProjectValue.java, FlagSetValue.java, RemoteAnalysisCacheDeps.java, RemoteAnalysisCachingEventListener.java, RemoteAnalysisCachingOptions.java src/main/java/com/google/devtools/build/lib/buildtool/BuildTool.java
  • Change Coupling · Change coupling: RunfilesSupport.java ↔ PyBuiltins.java src/main/java/com/google/devtools/build/lib/analysis/RunfilesSupport.java
  • Supply-chain Provenance & Signing · REDACTED

Watchdog compares 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: 1449 findings

These 1449 critical or serious findings were in the previous survey, on 10 October 2026, and are gone from this one. The first 100 are listed here.

  • Cyclomatic Complexity · NodeDependencyHandler.getValue (cyclomatic 32) src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/FileDependencySerializer.java
  • Cyclomatic Complexity · SkyfocusExecutor.prepareActiveDirectories (cyclomatic 24) src/main/java/com/google/devtools/build/lib/skyframe/SkyfocusExecutor.java
  • Cyclomatic Complexity · JavaUtil.javaSegmentIndex (cyclomatic 20) src/main/java/com/google/devtools/build/lib/rules/java/JavaUtil.java
  • Cyclomatic Complexity · BzlCompileFunction.isFileAllowlisted (cyclomatic 19) src/main/java/com/google/devtools/build/lib/skyframe/BzlCompileFunction.java
  • Cyclomatic Complexity · AnalysisPhaseRunner.evaluateProjectFile (cyclomatic 19) src/main/java/com/google/devtools/build/lib/buildtool/AnalysisPhaseRunner.java
  • Cyclomatic Complexity · InfoCommand.exec (cyclomatic 18) src/main/java/com/google/devtools/build/lib/runtime/commands/InfoCommand.java
  • Cyclomatic Complexity · Eval.newFunction (cyclomatic 16) src/main/java/net/starlark/java/eval/Eval.java
  • Cyclomatic Complexity · BzlCompileFunction.registerAllowlistDepIfOversized (cyclomatic 16) src/main/java/com/google/devtools/build/lib/skyframe/BzlCompileFunction.java
  • Cyclomatic Complexity · BuildTool.buildTargets (cyclomatic 16) src/main/java/com/google/devtools/build/lib/buildtool/BuildTool.java
  • Cognitive Complexity · SkyfocusExecutor.prepareActiveDirectories (cognitive 47) src/main/java/com/google/devtools/build/lib/skyframe/SkyfocusExecutor.java
  • Cognitive Complexity · NodeDependencyHandler.getValue (cognitive 33) src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/FileDependencySerializer.java
  • Cognitive Complexity · InfoCommand.exec (cognitive 32) src/main/java/com/google/devtools/build/lib/runtime/commands/InfoCommand.java
  • Cognitive Complexity · JavaUtil.javaSegmentIndex (cognitive 28) src/main/java/com/google/devtools/build/lib/rules/java/JavaUtil.java
  • Cognitive Complexity · ShellQuotedReader.readArg (cognitive 27) src/main/java/com/google/devtools/common/options/ShellQuotedParamsFilePreProcessor.java
  • Cognitive Complexity · AnalysisPhaseRunner.evaluateProjectFile (cognitive 23) src/main/java/com/google/devtools/build/lib/buildtool/AnalysisPhaseRunner.java
  • Cognitive Complexity · SkyfocusNodeVisitor.run (cognitive 21) src/main/java/com/google/devtools/build/lib/skyframe/SkyframeFocuser.java
  • Cognitive Complexity · Eval.execStatements (cognitive 20) src/main/java/net/starlark/java/eval/Eval.java
  • Cognitive Complexity · SkyframeFocuser.run (cognitive 20) src/main/java/com/google/devtools/build/lib/skyframe/SkyframeFocuser.java
  • Cognitive Complexity · BzlCompileFunction.isFileAllowlisted (cognitive 20) src/main/java/com/google/devtools/build/lib/skyframe/BzlCompileFunction.java
  • Cognitive Complexity · TarFileWriter.add_file (cognitive 18) tools/build_defs/pkg/archive.py
  • Cognitive Complexity · CommandEnvironment.beforeCommand (cognitive 16) src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java
  • Cognitive Complexity · IndexRegistry.createLocalPathRepoSpec (cognitive 16) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/IndexRegistry.java
  • God Classes · MethodTooLong: SkyfocusExecutor.prepareActiveDirectories src/main/java/com/google/devtools/build/lib/skyframe/SkyfocusExecutor.java
  • God Classes · MethodTooLong: FrontierSerializer.serializeAndUploadFrontier src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/FrontierSerializer.java
  • God Classes · FileTooLong: skyframe/BzlCompileFunction.java src/main/java/com/google/devtools/build/lib/skyframe/BzlCompileFunction.java
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) src/main/java/com/google/devtools/build/lib/bazel/commands/FetchCommand.java
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) src/main/java/com/google/devtools/build/lib/runtime/commands/AqueryCommand.java
  • Code Duplication · Duplicated block (19–20 lines × 3) src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/FileDependencySerializer.java
  • Code Duplication · Duplicated block (14–16 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/BzlCompileFunction.java
  • Code Duplication · Duplicated block (11 lines × 3) src/main/java/com/google/devtools/build/lib/skyframe/BzlCompileFunction.java
  • Code Duplication · Duplicated block (10 lines × 2) src/main/java/com/google/devtools/build/lib/analysis/ConfiguredAspect.java
  • Code Duplication · Duplicated block (10 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/FrontierSerializer.java
  • Code Duplication · Duplicated block (5 lines × 2) src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfigurationValue.java
  • Cohesion (LCOM4) · Low cohesion: Builder (LCOM4 6) src/main/java/com/google/devtools/build/lib/analysis/ConfiguredRuleClassProvider.java
  • Test Quality · No assertions: testRule src/test/java/com/google/devtools/build/docgen/RuleLinkExpanderTest.java
  • Test Quality · No assertions: testRuleAndAttribute src/test/java/com/google/devtools/build/docgen/RuleLinkExpanderTest.java
  • Test Quality · No assertions: testRuleArgs src/test/java/com/google/devtools/build/docgen/RuleLinkExpanderTest.java
  • Test Quality · No assertions: testRuleExamples src/test/java/com/google/devtools/build/docgen/RuleLinkExpanderTest.java
  • Test Quality · No assertions: testRuleHeadingLink src/test/java/com/google/devtools/build/docgen/RuleLinkExpanderTest.java
  • Test Quality · No assertions: testRuleImplicitOutputsj src/test/java/com/google/devtools/build/docgen/RuleLinkExpanderTest.java
  • Test Quality · No assertions: testStaticPageHeadingLink_pageReplacedBySinglePageBE src/test/java/com/google/devtools/build/docgen/RuleLinkExpanderTest.java
  • Test Quality · No assertions: testStaticPageHeadingLink_separatePage src/test/java/com/google/devtools/build/docgen/RuleLinkExpanderTest.java
  • Test Quality · No assertions: testStaticPageRef_pageReplacedBySinglePageBE src/test/java/com/google/devtools/build/docgen/RuleLinkExpanderTest.java
  • Test Quality · No assertions: testStaticPageRef_separatePage src/test/java/com/google/devtools/build/docgen/RuleLinkExpanderTest.java
  • Test Quality · No assertions: testUpperCaseRule src/test/java/com/google/devtools/build/docgen/RuleLinkExpanderTest.java
  • Test Quality · No assertions: testStarlarkRuleClassBuiltInItemsAreDocumented src/test/java/com/google/devtools/build/docgen/StarlarkDocumentationTest.java
  • Test Quality · No assertions: testSaveDiscoverInputs src/test/java/com/google/devtools/build/lib/actions/cache/CompactPersistentActionCacheTest.java
  • Test Quality · No assertions: testSaveNoDiscoverInputs src/test/java/com/google/devtools/build/lib/actions/cache/CompactPersistentActionCacheTest.java
  • Test Quality · No assertions: testCategories src/test/java/com/google/devtools/build/lib/actions/ActionExecutionStatusReporterTest.java
  • Test Quality · No assertions: testDynamicUpdate src/test/java/com/google/devtools/build/lib/actions/ActionExecutionStatusReporterTest.java
  • Test Quality · No assertions: testGroups src/test/java/com/google/devtools/build/lib/actions/ActionExecutionStatusReporterTest.java
  • Test Quality · No assertions: testNoProgressMessage src/test/java/com/google/devtools/build/lib/actions/ActionExecutionStatusReporterTest.java
  • Test Quality · No assertions: testOrdering src/test/java/com/google/devtools/build/lib/actions/ActionExecutionStatusReporterTest.java
  • Test Quality · No assertions: testSingleAction src/test/java/com/google/devtools/build/lib/actions/ActionExecutionStatusReporterTest.java
  • Test Quality · No assertions: testTruncation src/test/java/com/google/devtools/build/lib/actions/ActionExecutionStatusReporterTest.java
  • Test Quality · No assertions: getMetadata_missingFileWithinTree_returnsNull src/test/java/com/google/devtools/build/lib/actions/ActionInputMapTest.java
  • Test Quality · No assertions: getters_missingTree_returnNull src/test/java/com/google/devtools/build/lib/actions/ActionInputMapTest.java
  • Test Quality · No assertions: putTreeArtifact_mixedTreeAndFiles_addsTreeAndChildren src/test/java/com/google/devtools/build/lib/actions/ActionInputMapTest.java
  • Test Quality · No assertions: putTreeArtifact_multipleTreesUnderSameDirectory_addsAllTrees src/test/java/com/google/devtools/build/lib/actions/ActionInputMapTest.java
  • Test Quality · No assertions: putTreeArtifact_multipleTrees_addsAllTreesAndChildren src/test/java/com/google/devtools/build/lib/actions/ActionInputMapTest.java
  • Test Quality · No assertions: put_treeFileArtifact_addsEntry src/test/java/com/google/devtools/build/lib/actions/ActionInputMapTest.java
  • Test Quality · No assertions: testCanWriteExecutableFile src/test/java/com/google/devtools/build/lib/analysis/actions/BinaryFileWriteActionTest.java
  • Test Quality · No assertions: testCanWriteNonExecutableFile src/test/java/com/google/devtools/build/lib/analysis/actions/BinaryFileWriteActionTest.java
  • Test Quality · No assertions: testDestinationArtifactIsOutput src/test/java/com/google/devtools/build/lib/analysis/actions/BinaryFileWriteActionTest.java
  • Test Quality · No assertions: testNoInputs src/test/java/com/google/devtools/build/lib/analysis/actions/BinaryFileWriteActionTest.java
  • Test Quality · No assertions: testCanWriteExecutableFile src/test/java/com/google/devtools/build/lib/analysis/actions/FileWriteActionTest.java
  • Test Quality · No assertions: testCanWriteNonExecutableFile src/test/java/com/google/devtools/build/lib/analysis/actions/FileWriteActionTest.java
  • Test Quality · No assertions: testDestinationArtifactIsOutput src/test/java/com/google/devtools/build/lib/analysis/actions/FileWriteActionTest.java
  • Test Quality · No assertions: testNoInputs src/test/java/com/google/devtools/build/lib/analysis/actions/FileWriteActionTest.java
  • Test Quality · No assertions: testArtifactTemplateExpansion src/test/java/com/google/devtools/build/lib/analysis/actions/TemplateExpansionActionTest.java
  • Test Quality · No assertions: testWithSpecialCharacters src/test/java/com/google/devtools/build/lib/analysis/actions/TemplateExpansionActionTest.java
  • Test Quality · No assertions: executionInfoModifier_multipleExpressions src/test/java/com/google/devtools/build/lib/analysis/config/ExecutionInfoModifierTest.java
  • Test Quality · No assertions: executionInfoModifier_multipleOptions src/test/java/com/google/devtools/build/lib/analysis/config/ExecutionInfoModifierTest.java
  • Test Quality · No assertions: testParsing src/test/java/com/google/devtools/build/lib/analysis/config/PerLabelOptionsTest.java
  • Test Quality · No assertions: testConverter src/test/java/com/google/devtools/build/lib/analysis/config/RunUnderConverterTest.java
  • Test Quality · No assertions: testAttributeTypeChecking src/test/java/com/google/devtools/build/lib/analysis/select/NonconfigurableAttributeMapperTest.java
  • Test Quality · No assertions: testVisitation src/test/java/com/google/devtools/build/lib/analysis/select/NonconfigurableAttributeMapperTest.java
  • Test Quality · No assertions: add_all_name src/test/java/com/google/devtools/build/lib/analysis/starlark/FlagPerLineTest.java
  • Test Quality · No assertions: add_all_noname src/test/java/com/google/devtools/build/lib/analysis/starlark/FlagPerLineTest.java
  • Test Quality · No assertions: add_joined_name src/test/java/com/google/devtools/build/lib/analysis/starlark/FlagPerLineTest.java
  • Test Quality · No assertions: add_joined_noname src/test/java/com/google/devtools/build/lib/analysis/starlark/FlagPerLineTest.java
  • Test Quality · No assertions: add_name src/test/java/com/google/devtools/build/lib/analysis/starlark/FlagPerLineTest.java
  • Test Quality · No assertions: add_noname src/test/java/com/google/devtools/build/lib/analysis/starlark/FlagPerLineTest.java
  • Test Quality · No assertions: args_combinedOmittedAddAllAndAdd src/test/java/com/google/devtools/build/lib/analysis/starlark/FlagPerLineTest.java
  • Test Quality · No assertions: testFunctionSplitTransitionCheckAttrDep src/test/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttrTransitionProviderTest.java
  • Test Quality · No assertions: testFunctionSplitTransitionCheckAttrDeps src/test/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttrTransitionProviderTest.java
  • Test Quality · No assertions: testNoOpTransitionLeavesSameConfig_native_directRead src/test/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttrTransitionProviderTest.java
  • Test Quality · No assertions: testNoOpTransitionLeavesSameConfig_native_setToSame src/test/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttrTransitionProviderTest.java
  • Test Quality · No assertions: testNoOpTransitionLeavesSameConfig_starlark_directRead src/test/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttrTransitionProviderTest.java
  • Test Quality · No assertions: testNoOpTransitionLeavesSameConfig_starlark_setToDefault src/test/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttrTransitionProviderTest.java
  • Test Quality · No assertions: testNoOpTransitionLeavesSameConfig_starlark_setToSame src/test/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttrTransitionProviderTest.java
  • Test Quality · No assertions: testOptionConversionCrosstoolTop src/test/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttrTransitionProviderTest.java
  • Test Quality · No assertions: testOptionConversionDynamicMode src/test/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttrTransitionProviderTest.java
  • Test Quality · No assertions: testSubruleFunctionSymbol_notVisibleInBUILD src/test/java/com/google/devtools/build/lib/analysis/starlark/StarlarkSubruleTest.java
  • Test Quality · No assertions: testSharding src/test/java/com/google/devtools/build/lib/analysis/test/TestActionBuilderTest.java
  • Test Quality · No assertions: testShardingDisabled src/test/java/com/google/devtools/build/lib/analysis/test/TestActionBuilderTest.java
  • Test Quality · No assertions: testShardingForced src/test/java/com/google/devtools/build/lib/analysis/test/TestActionBuilderTest.java
  • Test Quality · No assertions: testDefaultTimeout src/test/java/com/google/devtools/build/lib/analysis/test/TestTimeoutConverterTest.java
  • Test Quality · No assertions: testIncorrectStrings src/test/java/com/google/devtools/build/lib/analysis/test/TestTimeoutConverterTest.java
Rebuild cost: about €1,500,000 · Estimate
Cost to rebuild€490,000 to €2,500,000, for 8,197 to 26,005 hours of work, about 10.2 person-years for 6 to 20 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.
SizeVery large: 595,527 lines of product code

How the estimate is made: Watchdog prices 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. For this code, every line is priced as straight logic, which keeps the estimate on the low side.

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 Documentation finding(s) in Documentation Quality — start with command-line-reference-suffix.html.
Raises the score by about 3 points · Low effort · Documentation Quality
2
Resolve the 1 Orphaned knowledge finding(s) in Knowledge Freshness — start with InvalidatingNodeVisitor.java.
Raises the score by about 3 points · Low effort · Knowledge Freshness
3
Resolve the 3 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (3).
Raises the score by about 2 points · Low effort · REDACTED Scanning

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 €1,500,000 to build again, about 10.2 person-years of work. Its weakest lens is Maturity, at 55 (Adequate). Maturity is about how well the project explains and looks after itself, which decides whether a new developer, or a new supplier, can take over. Because the weakest lens counts most in the score, work on Maturity also moves the score most.
Based on: the rebuild estimate · the Maturity grade · how much each lens counts
What to do: Start with the Maturity actions in Top priorities.
If you do one thing first · First action
Resolve the 1 Documentation finding(s) in Documentation Quality. Of all the actions in this report, it raises the score most for the work it takes: about 3 points for low effort, because it clears the 1 Documentation Quality 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 — a layering smell or cycle. A clean layered graph has none.

arch //src/main/cpp/util:blaze_exit_code util:blaze_exit_code //src/main/cpp/util:errors util:errors //src/main/cpp/util:strings util:strings //src/main/cpp/util:errors->//src/main/cpp/util:strings //src/main/cpp/util:filesystem util:filesystem //src/main/cpp/util:filesystem->//src/main/cpp/util:blaze_exit_code //src/main/cpp/util:filesystem->//src/main/cpp/util:errors //src/main/cpp/util:logging util:logging //src/main/cpp/util:filesystem->//src/main/cpp/util:logging //src/main/cpp/util:filesystem->//src/main/cpp/util:strings //src/main/cpp/util:logging->//src/main/cpp/util:blaze_exit_code //src/main/cpp/util:logging->//src/main/cpp/util:strings //src/main/cpp/util:strings->//src/main/cpp/util:blaze_exit_code //src/main/cpp:archive_utils cpp:archive_utils //src/main/cpp:archive_utils->//src/main/cpp/util:blaze_exit_code //src/main/cpp:archive_utils->//src/main/cpp/util:errors //src/main/cpp:archive_utils->//src/main/cpp/util:filesystem //src/main/cpp:archive_utils->//src/main/cpp/util:logging //src/main/cpp:blaze_util cpp:blaze_util //src/main/cpp:archive_utils->//src/main/cpp:blaze_util //third_party/ijar:zip ijar:zip //src/main/cpp:archive_utils->//third_party/ijar:zip //src/main/cpp:bazel_startup_options cpp:bazel_startup_options //src/main/cpp:bazel_startup_options->//src/main/cpp/util:blaze_exit_code //src/main/cpp:bazel_startup_options->//src/main/cpp/util:filesystem //src/main/cpp:bazel_startup_options->//src/main/cpp/util:logging //src/main/cpp:bazel_startup_options->//src/main/cpp:blaze_util //src/main/cpp:startup_options cpp:startup_options //src/main/cpp:bazel_startup_options->//src/main/cpp:startup_options //src/main/cpp:workspace_layout cpp:workspace_layout //src/main/cpp:bazel_startup_options->//src/main/cpp:workspace_layout //src/main/cpp:blaze_util->//src/main/cpp/util:blaze_exit_code //src/main/cpp:blaze_util->//src/main/cpp/util:errors //src/main/cpp:blaze_util->//src/main/cpp/util:filesystem //src/main/cpp:blaze_util->//src/main/cpp/util:logging //src/main/cpp:blaze_util->//src/main/cpp/util:strings //src/main/native/windows:lib-process windows:lib-process //src/main/cpp:blaze_util->//src/main/native/windows:lib-process //src/main/cpp:client cpp:client //src/main/cpp:client->//src/main/cpp/util:blaze_exit_code //src/main/cpp:client->//src/main/cpp/util:errors //src/main/cpp:client->//src/main/cpp/util:filesystem //src/main/cpp:client->//src/main/cpp/util:logging //src/main/cpp:client->//src/main/cpp/util:strings //src/main/cpp:client->//src/main/cpp:archive_utils //src/main/cpp:client->//src/main/cpp:bazel_startup_options //src/main/cpp:client->//src/main/cpp:blaze_util //src/main/cpp:option_processor cpp:option_processor //src/main/cpp:client->//src/main/cpp:option_processor //src/main/cpp:client->//src/main/cpp:startup_options //src/main/cpp:client->//src/main/cpp:workspace_layout //src/main/cpp:client->//third_party/ijar:zip //src/main/cpp:option_processor->//src/main/cpp/util:blaze_exit_code //src/main/cpp:option_processor->//src/main/cpp/util:filesystem //src/main/cpp:option_processor->//src/main/cpp/util:logging //src/main/cpp:option_processor->//src/main/cpp/util:strings //src/main/cpp:option_processor->//src/main/cpp:blaze_util //src/main/cpp:rc_file cpp:rc_file //src/main/cpp:option_processor->//src/main/cpp:rc_file //src/main/cpp:option_processor->//src/main/cpp:startup_options //src/main/cpp:option_processor->//src/main/cpp:workspace_layout //src/main/cpp:rc_file->//src/main/cpp/util:filesystem //src/main/cpp:rc_file->//src/main/cpp/util:logging //src/main/cpp:rc_file->//src/main/cpp/util:strings //src/main/cpp:rc_file->//src/main/cpp:blaze_util //src/main/cpp:rc_file->//src/main/cpp:workspace_layout //src/main/cpp:startup_options->//src/main/cpp/util:blaze_exit_code //src/main/cpp:startup_options->//src/main/cpp/util:errors //src/main/cpp:startup_options->//src/main/cpp/util:filesystem //src/main/cpp:startup_options->//src/main/cpp/util:logging //src/main/cpp:startup_options->//src/main/cpp/util:strings //src/main/cpp:startup_options->//src/main/cpp:blaze_util //src/main/cpp:startup_options->//src/main/cpp:workspace_layout //src/main/cpp:workspace_layout->//src/main/cpp/util:filesystem //src/main/cpp:workspace_layout->//src/main/cpp:blaze_util //src/tools/launcher/util:util util:util //src/tools/launcher/util:util->//src/main/cpp/util:filesystem //src/tools/launcher:launcher launcher:launcher //src/tools/launcher:launcher->//src/tools/launcher/util:util //src/tools/launcher:launcher_base launcher:launcher_base //src/tools/launcher:launcher->//src/tools/launcher:launcher_base //src/tools/launcher:launcher_base->//src/main/cpp/util:filesystem //src/tools/launcher:launcher_base->//src/main/native/windows:lib-process //src/tools/launcher:launcher_base->//src/tools/launcher/util:util //src/tools/one_version:one_version_main one_version:one_version_main //src/tools/singlejar:output_jar singlejar:output_jar //third_party/ijar:zip->//src/main/cpp/util:errors //third_party/ijar:zip->//src/main/cpp/util:filesystem //third_party/ijar:zip->//src/main/cpp/util:logging //third_party/ijar:zip->//src/main/cpp/util:strings __more__ +99 more projects

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.

269 modules, with 1644 dependencies between them. 3 loops run through 124 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 229 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 net.starlark.java.syntax2 com.google.devtools.build.lib.events3 com.google.devtools.common.options4 net.starlark.java.eval5 proguard.classfile.visitor6 com.google.devtools.build.skyframe7 proguard.classfile.constant.visitor8 com.google.devtools.build.lib.vfs9 proguard.classfile.editor10 com.google.devtools.build.lib.skyframe.config11 com.google.devtools.build.lib.util12 proguard.classfile.util13 com.google.devtools.build.lib.bazel.bzlmod14 com.google.devtools.build.lib.buildeventstream15 com.google.devtools.build.lib.exec16 com.google.devtools.build.lib.query2.common17 proguard.classfile.attribute.visitor18 com.google.devtools.build.lib.pkgcache19 com.google.devtools.build.lib.skyframe.serialization.analysis20 proguard.classfile.attribute21 com.google.devtools.build.lib.query222 proguard.classfile23 com.google.devtools.build.lib.buildtool24 com.google.devtools.build.lib.skyframe25 com.google.devtools.build.lib.packages26 com.google.devtools.build.lib.analysis.starlark27 com.google.devtools.build.lib.analysis.test28 com.google.devtools.build.lib.runtime29 com.google.devtools.build.lib.skyframe.serialization30 com.google.devtools.build.lib.collect.nestedset31 com.google.devtools.build.lib.cmdline32 com.google.devtools.build.lib.analysis.platform33 com.google.devtools.build.lib.analysis.config34 com.google.devtools.build.lib.analysis.actions35 com.google.devtools.build.lib.analysis36 com.google.devtools.build.lib.remote37 com.google.devtools.build.lib.actions38 com.google.devtools.build.lib.rules.cpp39 com.google.devtools.build.lib.runtime.commands40 com.google.devtools.build.lib.bazel
1 net.starlark.java.syntax
2 com.google.devtools.build.lib.events3
3 com.google.devtools.common.options1
4 net.starlark.java.eval97
5 proguard.classfile.visitor11223170259
6 com.google.devtools.build.skyframe265192
7 proguard.classfile.constant.visitor253413
8 com.google.devtools.build.lib.vfs312515115
9 proguard.classfile.editor35164570212201
10 com.google.devtools.build.lib.skyframe.config28341232891622
11 com.google.devtools.build.lib.util111712
12 proguard.classfile.util15116104481
13 com.google.devtools.build.lib.bazel.bzlmod18115684221488403
14 com.google.devtools.build.lib.buildeventstream23713123
15 com.google.devtools.build.lib.exec10651636112332120
16 com.google.devtools.build.lib.query2.common42263117711
17 proguard.classfile.attribute.visitor3915954
18 com.google.devtools.build.lib.pkgcache126832133261
19 com.google.devtools.build.lib.skyframe.serialization.analysis564210221812838316
20 proguard.classfile.attribute552649
21 com.google.devtools.build.lib.query2312656641922221
22 proguard.classfile20364
23 com.google.devtools.build.lib.buildtool81114221102523821722181110202417
24 com.google.devtools.build.lib.skyframe23641117543226214032537121196362241224129127310
25 com.google.devtools.build.lib.packages562921403322061641451052
26 com.google.devtools.build.lib.analysis.starlark991153411257183322242976
27 com.google.devtools.build.lib.analysis.test371310134111911121011832158
28 com.google.devtools.build.lib.runtime1277465625371021132523134441183671
29 com.google.devtools.build.lib.skyframe.serialization103713113
30 com.google.devtools.build.lib.collect.nestedset8315214
31 com.google.devtools.build.lib.cmdline27713211511
32 com.google.devtools.build.lib.analysis.platform1281411310331
33 com.google.devtools.build.lib.analysis.config58251613191157411351712
34 com.google.devtools.build.lib.analysis.actions367331181263190
35 com.google.devtools.build.lib.analysis8116385293302222135154451115481124611140
36 com.google.devtools.build.lib.remote1739100951414223111278
37 com.google.devtools.build.lib.actions51131711132136620424211710722
38 com.google.devtools.build.lib.rules.cpp135311253012863169616611141
39 com.google.devtools.build.lib.runtime.commands3443921312415256912875
40 com.google.devtools.build.lib.bazel17867422241941
Uses a module listed above itPart of a loopThe module itself
1 net.starlark.java.syntax2 com.google.devtools.build.lib.events3 com.google.devtools.common.options4 net.starlark.java.eval5 proguard.classfile.visitor6 com.google.devtools.build.skyframe7 proguard.classfile.constant.visitor8 com.google.devtools.build.lib.vfs9 proguard.classfile.editor10 com.google.devtools.build.lib.skyframe.config11 com.google.devtools.build.lib.util12 proguard.classfile.util13 com.google.devtools.build.lib.bazel.bzlmod14 com.google.devtools.build.lib.buildeventstream15 com.google.devtools.build.lib.exec16 com.google.devtools.build.lib.query2.common17 proguard.classfile.attribute.visitor18 com.google.devtools.build.lib.pkgcache19 com.google.devtools.build.lib.skyframe.serialization.analysis20 proguard.classfile.attribute21 com.google.devtools.build.lib.query222 proguard.classfile23 com.google.devtools.build.lib.buildtool24 com.google.devtools.build.lib.skyframe25 com.google.devtools.build.lib.packages26 com.google.devtools.build.lib.analysis.starlark27 com.google.devtools.build.lib.analysis.test28 com.google.devtools.build.lib.runtime29 com.google.devtools.build.lib.skyframe.serialization30 com.google.devtools.build.lib.collect.nestedset31 com.google.devtools.build.lib.cmdline32 com.google.devtools.build.lib.analysis.platform33 com.google.devtools.build.lib.analysis.config34 com.google.devtools.build.lib.analysis.actions35 com.google.devtools.build.lib.analysis36 com.google.devtools.build.lib.remote37 com.google.devtools.build.lib.actions38 com.google.devtools.build.lib.rules.cpp39 com.google.devtools.build.lib.runtime.commands40 com.google.devtools.build.lib.bazelnet.starlark.java.syntax1com.google.devtools.build.lib.events2com.google.devtools.common.options3net.starlark.java.eval4proguard.classfile.visitor5com.google.devtools.build.skyframe6proguard.classfile.constant.visitor7com.google.devtools.build.lib.vfs8proguard.classfile.editor9com.google.devtools.build.lib.skyframe.config10com.google.devtools.build.lib.util11proguard.classfile.util12com.google.devtools.build.lib.bazel.bzlmod13com.google.devtools.build.lib.buildeventstream14com.google.devtools.build.lib.exec15com.google.devtools.build.lib.query2.common16proguard.classfile.attribute.visitor17com.google.devtools.build.lib.pkgcache18com.google.devtools.build.lib.skyframe.serialization.analysis19proguard.classfile.attribute20com.google.devtools.build.lib.query221proguard.classfile22com.google.devtools.build.lib.buildtool23com.google.devtools.build.lib.skyframe24com.google.devtools.build.lib.packages25com.google.devtools.build.lib.analysis.starlark26com.google.devtools.build.lib.analysis.test27com.google.devtools.build.lib.runtime28com.google.devtools.build.lib.skyframe.serialization29com.google.devtools.build.lib.collect.nestedset30com.google.devtools.build.lib.cmdline31com.google.devtools.build.lib.analysis.platform32com.google.devtools.build.lib.analysis.config33com.google.devtools.build.lib.analysis.actions34com.google.devtools.build.lib.analysis35com.google.devtools.build.lib.remote36com.google.devtools.build.lib.actions37com.google.devtools.build.lib.rules.cpp38com.google.devtools.build.lib.runtime.commands39com.google.devtools.build.lib.bazel4031971122317025926519225341331251511535164570212201283412328916221117121511610448118115684221488403237131231065163611233212042263117711391595412683213326156421022181283831655264931265664192222120364811142211025238217221811102024172364111754322621403253712119636224122412912731056292140332206164145105299115341125718332224297637131013411191112101183215812774656253710211325231344411836711037131138315214277132115111281411310331582516131911574113517123673311812631908116385293302222135154451115481124611140173910095141422311127851131711132136620424211710722135311253012863169616611141344392131241525691287517867422241941+229 more modules (most-connected shown)

At a glance — Code Health · 65% · Adequate · gated by X5 ·

At a glance — Architecture · 91% · Adequate · gated by D26 ·

At a glance — Maturity · 55% · Adequate · gated by M2 ·

At a glance — Readiness · 60% · Adequate · gated by P4 ·

At a glance — Security · 67% · Adequate · gated by D28 ·

At a glance — Performance · 71% · Strong ·

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
A07:2025 — Authentication Failures12High / Critical
A03:2025 — Software Supply Chain Failures7High / Critical
A05:2025 — Injection5High / Critical

Roadmap

Begin by documenting significant design decisions in the docs/adr folder and updating the README with clear instructions for running tests. Next, address the specific documentation quality issue in the command-line reference and resolve the orphaned knowledge finding for InvalidatingNodeVisitor.java. Finally, immediately remediate the three leaked secrets found in REDACTED to secure the codebase.

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

Do thisHelpsEffortDimension
Resolve the 1 Documentation finding(s) in Documentation Quality — start with command-line-reference-suffix.html.+3.2 ptsLowDocumentation Quality
Resolve the 1 Orphaned knowledge finding(s) in Knowledge Freshness — start with InvalidatingNodeVisitor.java.+2.7 ptsLowKnowledge Freshness
Resolve the 3 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (3).+2.4 ptsLowREDACTED Scanning
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.+4.6 ptsMediumArchitecture documentation
Resolve the 1 Banned license finding(s) in License Compliance.+1.7 ptsLowLicense Compliance
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.+2.8 ptsMediumDocumentation (README)
Automate the release in CI — a deploy stage for a service (Helm/Kubernetes manifests or an equivalent rollout), or a tag-triggered publish job for an artifact — so releases are repeatable and reversible.+1.9 ptsMediumDeployment & Rollback
Resolve the 17 No assertions (empty test) finding(s) in Test Quality — start with PostAnalysisQueryTest.java (9), NonconfigurableAttributeMapperTest.java (2), StarlarkAttrTransitionProviderTest.java (2).+1.7 ptsMediumTest Quality

File quality

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

FileScoreBandWorst signal
src/test/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttrTransitionProviderTest.java1.0SlopTest Quality: No assertions (empty test): testOptionConversionCrosstoolTop
src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java1.5SlopChange Coupling: Boundary-crossing change coupling: RemoteModule.java ↔ OnDiskBlobStoreCache.java
src/test/java/com/google/devtools/build/lib/query2/testutil/PostAnalysisQueryTest.java3.2SlopTest Quality: No assertions (empty test): boundedDepsWithError
REDACTED5.1MixedREDACTED Scanning: Leaked secret: REDACTED
REDACTED5.1MixedDependency Vulnerabilities: Critical vulnerability: REDACTED
src/test/java/com/google/devtools/build/lib/testutil/TestInterruptingBugReporterTest.java5.4MixedTest Quality: No assertions (empty test): passing
src/test/java/com/google/devtools/build/lib/analysis/select/NonconfigurableAttributeMapperTest.java5.5MixedTest Quality: No assertions (empty test): testAttributeTypeChecking
src/main/java/com/google/devtools/build/lib/analysis/RunfilesSupport.java5.7MixedGod Classes: ClassTooLong: RunfilesSupport
REDACTED5.8MixedSecrets (history): REDACTED: REDACTED
src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnCache.java5.9MixedCyclomatic Complexity: RemoteSpawnCache.lookup (cyclomatic 29)
src/main/java/com/google/devtools/build/lib/skyframe/CompletionFunction.java5.9MixedCyclomatic Complexity: CompletionFunction.compute (cyclomatic 23)
src/main/java/com/google/devtools/build/lib/skyframe/serialization/ObjectCodecRegistry.java5.9MixedCognitive Complexity: ObjectCodecRegistry.<init> (cognitive 26)
src/main/java/net/starlark/java/eval/EvalUtils.java6.0MixedExplicit Debt: TodoComment
src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleClassFunctions.java6.0MixedExplicit Debt: TodoComment
src/main/java/net/starlark/java/syntax/Lexer.java6.0MixedExplicit Debt: TodoComment
src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java6.0MixedExplicit Debt: TodoComment
src/main/java/com/google/devtools/build/lib/bazel/BazelRepositoryModule.java6.0MixedExplicit Debt: TodoComment
src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttrModule.java6.0MixedExplicit Debt: TodoComment
src/main/java/com/google/devtools/build/lib/skyframe/GlobFunctionWithMultipleRecursiveFunctions.java6.0MixedExplicit Debt: TodoComment
src/main/java/com/google/devtools/build/lib/rules/cpp/CcCommon.java6.0MixedExplicit Debt: TodoComment

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 — 42

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 — 5676

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 — 416

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

Could not be resolved — 15

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

Watchdog 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. 62 of 65 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 3 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.

Every figure here is one of three 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; ◐ Advisory — an LLM prose judgement. 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; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.

What we checked — 65 dimensions across the health lenses
D1D2D3D4D5D6D9D10D13D14D15D16D17D19D21D26D28D29D30D34D35D36D37D43D44AX10AX3AX5AX6AX8AX9IC1M1M2M3M4P1P2P3P4P6PF1PF2X1X12X13X14X15X16X17X18X19X20X21X22X23X24X25X26X27X28X29X3X30X5

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, 6106 of 6134 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, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — 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
Watchdog 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 · trivySecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3✓ deterministic
LLM (sampled · advisory)Documentation quality, ADR conformance, naming — sampled over a bounded sample; advisory, never a deterministic measurementLocal LLM◐ LLM · sampled · advisory

Every finding is locatable in findings.md. Run 01a16d74-1c86-7710-a843-bf7e9a6e55c3.

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.

  • D8 Code Coverage — not measured this run — Watchdog 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. Coverage NOT MEASURED: test source is present (.java, .py) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo. To have real coverage read, produce a coverage report in a standard format (JaCoCo XML — `mvn jacoco:report` or the Gradle `jacocoTestReport` task, or `coverage run -m pytest` then `coverage xml`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures. You can widen what we reach: optional: produce a coverage report in a standard format (JaCoCo XML — `mvn jacoco:report` or the Gradle `jacocoTestReport` task, or `coverage run -m pytest` then `coverage xml`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then the real number is read on the next scan.
  • D10 Test Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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 15,327 test(s) behind this row are the ones the code-model census could read, and this repository also carries at least 56 test source file(s) (.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 — Watchdog 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 repository declares 3 of its own test(s) unreliable. The built-in reliability runner does not support this repository's ecosystem (.java, .py), so the suite was not re-run and no reliability score is given — these are the repository's own declarations, not our measurement.
  • D12 Dependency Hygiene — not measured this run — Watchdog 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. Not scored — 4 Maven/Gradle manifest(s) were read, stating a version for 0 dependency(ies) and leaving 0 to a parent or an imported BOM, but no build resolved the dependency graph, so the outdated signal was not established. NOT a finding that these dependencies are current or healthy.
  • D20 ADR Quality — not measured this run — Watchdog 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. The ADR expectation is gated on whether a repository ships a deployable product. Our repo-kind classifier reads .NET project files and the host and package markers of the other ecosystems it knows (a Go `package main`, a Cargo binary, a package.json `bin`, `start` script or application dev server such as Vite or Next, Python console scripts or a Django/WSGI entry point, a Spring Boot / WAR / Gradle application build, a Rack or Rails app, a Composer project, an OTP release or escript, a Dockerfile, a Procfile, a Platform.sh `.platform/routes.yaml`, and the corresponding published-package manifests, including an OTP `*.app.src`, a Drupal module's `*.info` and a Claude Code `.claude-plugin/plugin.json`), and found none here, so we could not tell what kind of repository this is and did not assess its ADR log. This is a gap in our analyzer, not a finding about this repository.
  • D22 Internal API Consistency — not measured this run — Watchdog 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 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is a COLLECTOR gap, not an environment fault: no published-package marker D22 reads admitted any project here, so this ecosystem's public API has no collector, and the remedy is to write one — no change to the scan image can close it.
  • D27 Navigability — not measured this run — Watchdog 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. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog 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. `src/main/java/net/starlark/java/eval/Printer.java`, `src/main/java/net/starlark/java/eval/Starlark.java`, `src/main/java/net/starlark/java/eval/StarlarkFunction.java`, `src/main/java/net/starlark/java/syntax/Parser.java`, `src/main/java/net/starlark/java/syntax/Resolver.java`, … (+1 more) 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.
  • AX1 Captive dependencies — not measured this run — Watchdog 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 reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository defines its own container in src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java, whose lifetimes are not modelled yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • C1 Data Protection — not measured this run — Watchdog 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. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
  • C2 Access Controls — not measured this run — Watchdog 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. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
  • C3 Audit Trail — not measured this run — Watchdog 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. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
  • C4 Data Retention — not measured this run — Watchdog 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. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
  • C5 Data-Subject Rights — not measured this run — Watchdog 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. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
  • ED5 Idempotency — not measured this run — Watchdog 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 decides whether a handler's mutation is safe to re-run by recognising its persistence writes (a database save, a repository write, an event publish) and its guards. Those markers are .NET member names, so in this repository's language a write such as `repository.save(order)` is not recognised and a same-named call on an unrelated library type could be. The handlers were found; their idempotency was neither confirmed nor ruled out.
  • GD1 Unfinished & placeholder code — not measured this run — Watchdog 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 reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and no C#, F#, JavaScript/TypeScript, Dart, Ruby or Scala was found, and this repository's Java, Python, c, cpp, objectivec is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • M4 Documentation accuracy — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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. 702 further occurrence(s) are not listed individually; the score already reflects all 742.
  • P1 CI/CD gates — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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. A CI pipeline exists and the word "test" appears, but no explicit test-runner invocation (your stack's test command, or a test job) was matched — so either the gate runs tests through a step this pass could not recognise, or "test" is incidental here (a path, "latest", a reporter). Which of the two it is cannot be settled from this dimension's evidence; the coverage dimensions report whether a suite exists at all. You can widen what we reach: name the test runner explicitly in the pipeline step (your stack's test command, or a job named for the suite) so the gate is unambiguous to a reader and to this pass.
  • 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.
  • S1 Web-Security Posture — not measured this run — Watchdog 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. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.

Repo exclusion declarations: 1 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.

Limitations & what we did not check

Watchdog assesses the repository exactly as committed, and only the repository. By design it does 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.
  • D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
  • 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 is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
  • D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • 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 REDACTED, 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.
  • 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 Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, 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: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
  • 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.

The LLM boundary

LLM-set scores this run (3): D19, D21, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.

Dimensions

D1 · Cyclomatic Complexity5.9 / 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 5.9 / 10 · rule-coverage 100% · ceiling Prevented

245 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was EvalUtils.binaryOp at 111. A further 6 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being Lexer.scanIdentifier at 65 — they are counted neither in the figure above nor in this dimension's score. 3 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: src/main/java/com/google/devtools/build/lib/profiler/memory/AllocationTracker.java (AllocationTracker.isValueClass at 32), src/main/java/com/google/devtools/build/lib/analysis/config/AutoCpuConverter.java (AutoCpuConverter.convert at 20), src/main/java/com/google/devtools/build/docgen/RuleDocumentationAttribute.java (RuleDocumentationAttribute.getAttributeInfoType at 16). They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

EvalUtils.binaryOp (cyclomatic 111)src/main/java/net/starlark/java/eval/EvalUtils.java:59
StarlarkRuleClassFunctions.createRule (cyclomatic 83)src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleClassFunctions.java:709
Lexer.scanWord (cyclomatic 79)src/main/java/com/google/devtools/build/lib/query2/engine/Lexer.java:170
Lexer.tokenize (cyclomatic 62)src/main/java/net/starlark/java/syntax/Lexer.java:694
BlazeCommandDispatcher.execExclusively (cyclomatic 60)src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java:376

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

What to do

  1. Bring the 4 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with EvalUtils.binaryOp (cyclomatic 111), StarlarkRuleClassFunctions.createRule (cyclomatic 83), Lexer.scanWord (cyclomatic 79). — 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 4 together lifts Cyclomatic Complexity from 5.9 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
  2. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D2 · Cognitive Complexity5.4 / 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.4 / 10 · rule-coverage 100% · ceiling Prevented

553 method(s) exceeded the cognitive complexity threshold of 15; the worst was EvalUtils.binaryOp at 174.

EvalUtils.binaryOp (cognitive 174)src/main/java/net/starlark/java/eval/EvalUtils.java:59
BazelRepositoryModule.beforeCommand (cognitive 143)src/main/java/com/google/devtools/build/lib/bazel/BazelRepositoryModule.java:279
StarlarkRuleClassFunctions.createRule (cognitive 134)src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleClassFunctions.java:709
PatchUtil.applyInternal (cognitive 101)src/main/java/com/google/devtools/build/lib/bazel/repository/decompressor/PatchUtil.java:448
ChunkingSession.nextChunkSize (cognitive 95)src/main/java/com/google/devtools/build/lib/remote/chunking/RepMaxCdcChunker.java:219

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

What to do

  1. Bring the 3 bodies over 120 down to 120 or less in Cognitive Complexity — start with EvalUtils.binaryOp (cognitive 174), BazelRepositoryModule.beforeCommand (cognitive 143), StarlarkRuleClassFunctions.createRule (cognitive 134). — 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 3 together lifts Cognitive Complexity from 5.4 to about 5.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
  2. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D3 · God Classes8.1 / 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.1 / 10 · rule-coverage 100% · ceiling Prevented

462 god class(es) detected.

ClassTooLong: SkyframeExecutor · ×128src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java:329
FileTooLong: skyframe/SkyframeExecutor.java · ×126src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java
TooManyMethods: SkyframeExecutor · ×123src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java:329
MethodTooLong: RemoteModule.setup · ×85src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java:414

What to do

  1. Resolve the 128 ClassTooLong finding(s) in God Classes — start with SkyframeExecutor.java, CcModuleApi.java, StarlarkBaseExternalContext.java. — One of this dimension's main actionable groups (128 warning-level).
  2. Resolve the 126 FileTooLong finding(s) in God Classes — start with SkyframeExecutor.java, CcModuleApi.java, StarlarkBaseExternalContext.java. — One of this dimension's main actionable groups (126 warning-level).
  3. Resolve the 123 TooManyMethods finding(s) in God Classes — start with RuleContext.java (2), Attribute.java (2), RuleClass.java (2). — One of this dimension's main actionable groups (123 warning-level).
  4. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D4 · Code Duplication9.8 / 10Stronggated by 251 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

245 duplicated block group(s) detected. A further 6 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 1 of the 251 are in trees this repository does not ship — vendored, example/demo, 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.

Duplicated block (9 lines × 2) · ×25src/main/java/com/google/devtools/build/lib/bazel/bzlmod/BazelModTidyFunction.java:97
Duplicated block (7 lines × 2) · ×23src/main/java/com/google/devtools/build/lib/actions/cache/CompactPersistentActionCache.java:1020
Duplicated block (8 lines × 2) · ×20src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkActionFactory.java:977
Duplicated block (11 lines × 2) · ×17src/main/java/com/google/devtools/build/lib/bazel/bzlmod/VendorFileFunction.java:162
Duplicated block (10 lines × 2) · ×17src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkCustomCommandLine.java:1066

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

What to do

  1. Resolve the 25 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with BazelModTidyFunction.java, ModuleFileGlobals.java, VendorCommand.java. — One of this dimension's main actionable groups (25 warning-level).
  2. Resolve the 23 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with SkyQueryEnvironment.java (3), CompactPersistentActionCache.java, PostAnalysisQueryEnvironment.java. — One of this dimension's main actionable groups (23 warning-level).
  3. Resolve the 20 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with CppCompileAction.java (2), StarlarkActionFactory.java, ModuleFileFunction.java. — One of this dimension's main actionable groups (20 warning-level).
  4. Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

D5 · Coupling9.9 / 10Stronggated by 1 serious finding✓ 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 9.9 / 10 · rule-coverage 100% · ceiling Prevented

119 production modules (Gradle+Bazel), 0 dependency cycle(s), 1 unstable depended-on module(s). Read from the build's own module declarations; edges a convention plugin adds from buildSrc or build-logic are not visible there, and main-sequence distance (abstractness) is not computed for these modules yet.

Unstable project //src/main/cpp:rc_file

What to do

  1. Resolve the 1 Unstable project //src/main/cpp finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
  2. Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D6 · Cohesion (LCOM4)9.8 / 10Stronggated by 31 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.8 / 10 · rule-coverage 100% · ceiling Verified

31 of 1636 classes have LCOM4 above 3.

Low cohesion: Builder (LCOM4 16) · ×31src/main/java/com/google/devtools/build/lib/actions/SpawnResult.java:620

What to do

  1. Resolve the 31 Low cohesion finding(s) in Cohesion (LCOM4) — start with SpawnResult.java, StarlarkCustomCommandLine.java, AbstractPackageLoader.java. — One of this dimension's main actionable groups (31 warning-level).
  2. Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.

Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.

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

15879 test methods: 15879 unit, 0 integration, 0 BDD, 0 e2e. The Python suite contributes 552 test function(s) across 50 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.md.

D10 · Test Quality7.7 / 10Adequategated by 17 critical findings✓ 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.7 / 10 · rule-coverage 100% · ceiling Prevented

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

No assertions (empty test): testAttributeTypeChecking · ×17src/test/java/com/google/devtools/build/lib/analysis/select/NonconfigurableAttributeMapperTest.java:82
No assertions: testSleep · ×2289examples/java-native/src/test/java/com/example/myproject/TestSleep.java:8
Skipped (documented): createKey_platformFlags_accumulate · ×90src/test/java/com/google/devtools/build/lib/analysis/producers/BuildConfigurationKeyMapProducerTest.java:247

What to do

  1. Resolve the 2289 No assertions finding(s) in Test Quality — start with StarlarkRuleClassFunctionsTest.java (113), StarlarkEvaluationTest.java (103), StarlarkIntegrationTest.java (76). — One of this dimension's main actionable groups (2289 warning-level).
  2. Resolve the 17 No assertions (empty test) finding(s) in Test Quality — start with PostAnalysisQueryTest.java (9), NonconfigurableAttributeMapperTest.java (2), StarlarkAttrTransitionProviderTest.java (2). — One of this dimension's main actionable groups (17 issue-level).
  3. Enforce Test Quality in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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 3 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
  2. Enforce REDACTED Scanning in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D14 · License Compliance8.0 / 10Adequategated by 1 critical finding✓ Tool-verified

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 8.0 / 10 · rule-coverage 100% · ceiling Verified

1 of 13 shipped Python distribution(s) use a banned license. Licences were resolved from PyPI over the distributions a consumer installs — this repository's 13 declared runtime requirement(s) closed transitively over each distribution's published `requires_dist` (0 reached that way). Requirements it states ONLY under an extra, a PEP 735 dependency group, a Poetry dev group or a dev-named requirements file are excluded: pip does not install any of them for a consumer. ★ This repository commits no dependency lockfile that this pass reads, so each licence is the one PyPI publishes for the distribution's CURRENT release rather than for a pinned version.

Banned license: frozendict

What to do

  1. Resolve the 1 Banned license finding(s) in License Compliance. — One of this dimension's main actionable groups (1 issue-level).
  2. Enforce License Compliance in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

D15 · Churn × Complexity Hotspots9.9 / 10Stronggated by 56 serious findings✓ 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 9.9 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java (24×50=1200); src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java (9×60=540); src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkActionFactory.java (12×39=468)

Hotspot: src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java · ×56src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java:414

What to do

  1. Resolve the 56 Hotspot finding(s) in Churn × Complexity Hotspots — start with RemoteModule.java, BlazeCommandDispatcher.java, StarlarkActionFactory.java. — One of this dimension's main actionable groups (56 warning-level).

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

D16 · Bus Factor9.1 / 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.1 / 10 · rule-coverage 100% · ceiling Documented

188 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is src/main/java/com/google/devtools/build/lib/worker/WorkRequestHandler.java. Counted over 2176 of the 3282 production source files in this repository: 1098 are under the ~2,400-byte size floor this dimension measures over, and the remaining 8 have no attributable history left to measure.

Off-boarding risk: anonymized user #1 · ×13
Further sole-owners (lower concentration)

✓ On the Gold path — maintain.

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

D17 · Explicit Debt9.4 / 10Stronggated by 1766 serious 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 9.4 / 10 · rule-coverage 100% · ceiling Prevented

1799 deducted task-comment markers across 595527 LoC (0.3/KLoC) → score 9.4. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.

TodoComment · ×1757scripts/ctexplain/lib_test.py:66
HackComment · ×8scripts/docs/docs2mdx.py:369
TodoComment repeated across 10 filessrc/main/java/com/google/devtools/build/lib/skyframe/serialization/SharedValueDeserializationContext.java:229

What to do

  1. Resolve the 1757 TodoComment finding(s) in Explicit Debt — start with TypeCheckerTest.java (49), Package.java (18), StarlarkRuleClassFunctions.java (16). — One of this dimension's main actionable groups (1757 warning-level).
  2. Resolve the 8 HackComment finding(s) in Explicit Debt — start with FileHandlerQuerier.java (2), docs2mdx.py, NestedSet.java. — One of this dimension's main actionable groups (8 warning-level).
  3. Resolve the 1 TodoComment repeated across 10 files finding(s) in Explicit Debt — start with SharedValueDeserializationContext.java. — One of this dimension's main actionable groups (1 warning-level).
  4. Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D19 · Documentation QualityStrong◐ Sampled · advisory

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

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.

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

The repository has an excellent root README that describes itself as 'Fast, Correct - Choose two' and documents the project's speed, multi-language support, scalability, extensibility, and security-vulnerability-reporting process. It also links to a comprehensive architecture/Docs directory (34 markdown files) covering Bazel's command-line reference, rule reference, query, extension, test-encyclopedia, community-users pages, plus the specific release-documentation scripts, Chocolatey package creation docs, Windows installer generator, remote-worker guide, workspace-log parser, and Jacoco upgrade steps. The READMEs for each subdirectory (examples/cpp/, examples/java-native/) are focused on their own directories rather than the repository root, which is consistent with the project's structure. The repository's READMEs are mostly test-data directories (22 of 56 total documents), with a few scattered architecture/CLI-reference HTML docs and one Bazel shell script README. The visible content is thin: the only non-test-README document is an HTML CLI reference covering options syntax, boolean flags, short forms, tristate defaults, and tags for each option (e.g. --connect_timeout_secs=30), but it does not explain what the project is or how to use its test-data directories.

Documentation: no project overviewdocs/command-line-reference-suffix.html

What to do

  1. Resolve the 1 Documentation finding(s) in Documentation Quality — start with command-line-reference-suffix.html. — 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 ConsistencyExemplary◐ Sampled · advisory

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

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.

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

0 naming inconsistencies across 0 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

D26 · Project Cohesion0.0 / 10Critical✓ Tool-verified

What it measures: Whether each project is a focused, coherent unit rather than an oversized grab-bag.

Method: Project size overshoot penalties (LoC / public-type count / namespace count, 2-of-3 flag) weighted by log magnitude. Exhaustive across projects, deterministic, LLM-independent.

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

1 of 1 build units (Python) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion

What to do

  1. Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).

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

D28 · Secrets (history)0.0 / 10Critical✓ 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 0.0 / 10 · rule-coverage 100% · ceiling Documented

24 finding(s): 0 critical, 24 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 5 REDACTED finding(s) in Secrets (history) — start with REDACTED (2), REDACTED, REDACTED. — One of this dimension's main actionable groups (5 issue-level).
  2. Resolve the 3 High secret finding(s) in Secrets (history) — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 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)4.2 / 10Weak✓ 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 4.2 / 10 · rule-coverage 100% · ceiling Documented

5 finding(s): 0 critical, 5 high, 0 medium, 0 low. semgrep hit a parse error in 28 file(s) — `docs/command-line-reference-prefix.html` (lines 1–67), `examples/shell/bin.sh` (line 34), `examples/shell/lib.sh` (line 34), `examples/shell/test.sh` (line 34), `scripts/bash_completion_test.sh` (line 27), … (+23 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.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-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. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).

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

D30 · Dependency Vulnerabilities7.5 / 10Adequategated by 3 critical findings✓ 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.

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

3 finding(s): 1 critical, 2 high, 0 medium, 0 low.

REDACTED
REDACTED

What to do

  1. Resolve the 2 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
  2. Resolve the 1 Critical 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.

D34 · Knowledge Freshness9.2 / 10Adequategated by 1 critical finding✓ 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 9.2 / 10 · rule-coverage 100% · ceiling Documented

175 of 2184 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is src/main/java/com/google/devtools/build/skyframe/InvalidatingNodeVisitor.java. Counted over 2184 of the 3282 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned knowledgesrc/main/java/com/google/devtools/build/skyframe/InvalidatingNodeVisitor.java:1
Orphaned file · ×174src/main/java/com/google/devtools/build/lib/skyframe/PackageFunctionWithMultipleGlobDeps.java:1
Further orphaned files (smaller)

What to do

  1. Resolve the 1 Orphaned knowledge finding(s) in Knowledge Freshness — start with InvalidatingNodeVisitor.java. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 174 Orphaned file finding(s) in Knowledge Freshness — start with PackageFunctionWithMultipleGlobDeps.java, ModuleArg.java, RecursivePackageProviderBackedTargetPatternResolver.java. — One of this dimension's main actionable groups (174 recommendation-level).
  3. Resolve the 1 Further orphaned files (smaller) 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 Coupling9.9 / 10Adequategated by 1 critical finding✓ 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 9.9 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: AnalysisPhaseRunner.java↔FlagSetValue.java 76%; BuildTool.java↔FlagSetValue.java 71%; BuildTool.java↔RemoteAnalysisCachingEventListener.java 67%

Boundary-crossing change coupling: RemoteModule.java ↔ OnDiskBlobStoreCache.javasrc/main/java/com/google/devtools/build/lib/remote/RemoteModule.java:1
Change coupling: AnalysisPhaseRunner.java ↔ FlagSetValue.java · ×11src/main/java/com/google/devtools/build/lib/buildtool/AnalysisPhaseRunner.java:1
Change-coupling hub: BuildTool.java → Project.java, ProjectValue.java, FlagSetValue.java, RemoteAnalysisCacheDeps.java, RemoteAnalysisCachingEventListener.java, RemoteAnalysisCachingOptions.javasrc/main/java/com/google/devtools/build/lib/buildtool/BuildTool.java

What to do

  1. Resolve the 1 Boundary-crossing change coupling finding(s) in Change Coupling — start with RemoteModule.java. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 11 Change coupling finding(s) in Change Coupling — start with AnalysisPhaseRunner.java, Project.java, RemoteSpawnCache.java. — One of this dimension's main actionable groups (11 warning-level).
  3. Resolve the 1 Change-coupling hub finding(s) in Change Coupling — start with BuildTool.java. — One of this dimension's main actionable groups (1 warning-level).

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

D36 · Supply-chain Provenance & Signing5.0 / 10Adequate✓ Tool-verified

What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.

Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.

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

2/4 supply-chain integrity signals present (provenance, signing, SBOM, pinned actions).

REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).

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

D37 · Vulnerability-disclosure Policy10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.

Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.

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

A vulnerability-disclosure policy (SECURITY.md) is published with a reporting contact.

✓ On the Gold path — maintain.

Detailed fixes: d37_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. Scored 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. SCORED, not informational.

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-Life10.0 / 10Exemplary✓ 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 10.0 / 10 · rule-coverage 100% · ceiling Documented

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 0 platform declaration(s) and 13 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.

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

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

AX10 · Code composition9.5 / 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. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.

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.

What to do

  • The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
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.

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.

  • `VerificationTypeVisitor` declares 27 abstract methods: `visitDoubleType`, `visitFloatType`, `visitIntegerType`, `visitLongType`, `visitNullType`, `visitObjectType`, `visitStackDoubleType`, `visitStackFloatType`, `visitStackIntegerType`, `visitStackLongType`, `visitStackNullType`, `visitStackObjectType`, `visitStackTopType`, `visitStackUninitializedThisType`, `visitStackUninitializedType`, `visitTopType`, `visitUninitializedThisType`, `visitUninitializedType`, `visitVariablesDoubleType`, `visitVariablesFloatType`, `visitVariablesIntegerType`, `visitVariablesLongType`, `visitVariablesNullType`, `visitVariablesObjectType`, `visitVariablesTopType`, `visitVariablesUninitializedThisType`, `visitVariablesUninitializedType`. 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. — third_party/java/proguard/proguard6.2.2/src/proguard/classfile/attribute/preverification/visitor/VerificationTypeVisitor.java:34
  • `AttributeVisitor` declares 46 abstract methods: `visitAnnotationDefaultAttribute`, `visitBootstrapMethodsAttribute`, `visitCodeAttribute`, `visitConstantValueAttribute`, `visitDeprecatedAttribute`, `visitDeprecatedAttribute`, `visitDeprecatedAttribute`, `visitEnclosingMethodAttribute`, `visitExceptionsAttribute`, `visitInnerClassesAttribute`, `visitLineNumberTableAttribute`, `visitLocalVariableTableAttribute`, `visitLocalVariableTypeTableAttribute`, `visitMethodParametersAttribute`, `visitModuleAttribute`, `visitModuleMainClassAttribute`, `visitModulePackagesAttribute`, `visitNestHostAttribute`, `visitNestMembersAttribute`, `visitRuntimeInvisibleAnnotationsAttribute`, `visitRuntimeInvisibleAnnotationsAttribute`, `visitRuntimeInvisibleAnnotationsAttribute`, `visitRuntimeInvisibleParameterAnnotationsAttribute`, `visitRuntimeInvisibleTypeAnnotationsAttribute`, `visitRuntimeInvisibleTypeAnnotationsAttribute`, `visitRuntimeInvisibleTypeAnnotationsAttribute`, `visitRuntimeInvisibleTypeAnnotationsAttribute`, `visitRuntimeVisibleAnnotationsAttribute`, `visitRuntimeVisibleAnnotationsAttribute`, `visitRuntimeVisibleAnnotationsAttribute`, `visitRuntimeVisibleParameterAnnotationsAttribute`, `visitRuntimeVisibleTypeAnnotationsAttribute`, `visitRuntimeVisibleTypeAnnotationsAttribute`, `visitRuntimeVisibleTypeAnnotationsAttribute`, `visitRuntimeVisibleTypeAnnotationsAttribute`, `visitSignatureAttribute`, `visitSignatureAttribute`, `visitSignatureAttribute`, `visitSourceDirAttribute`, `visitSourceFileAttribute`, and 6 more. 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 46 declarations carry 30 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 30 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. — third_party/java/proguard/proguard6.2.2/src/proguard/classfile/attribute/visitor/AttributeVisitor.java:35
  • `ConstantVisitor` declares 18 abstract methods: `visitClassConstant`, `visitDoubleConstant`, `visitDynamicConstant`, `visitFieldrefConstant`, `visitFloatConstant`, `visitIntegerConstant`, `visitInterfaceMethodrefConstant`, `visitInvokeDynamicConstant`, `visitLongConstant`, `visitMethodHandleConstant`, `visitMethodTypeConstant`, `visitMethodrefConstant`, `visitModuleConstant`, `visitNameAndTypeConstant`, `visitPackageConstant`, `visitPrimitiveArrayConstant`, `visitStringConstant`, `visitUtf8Constant`. 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. — third_party/java/proguard/proguard6.2.2/src/proguard/classfile/constant/visitor/ConstantVisitor.java:33
  • `Clazz` declares 38 abstract methods: `accept`, `addSubClass`, `attributeAccept`, `attributesAccept`, `constantPoolEntriesAccept`, `constantPoolEntryAccept`, `extendsOrImplements`, `extendsOrImplements`, `extends_`, `extends_`, `fieldAccept`, `fieldsAccept`, `findField`, `findMethod`, `getAccessFlags`, `getClassName`, `getInterface`, `getInterfaceCount`, `getInterfaceName`, `getName`, `getName`, `getRefClassName`, `getRefName`, `getRefType`, `getString`, `getStringString`, `getSuperClass`, `getSuperName`, `getTag`, `getType`, `hierarchyAccept`, `interfaceConstantsAccept`, `mayHaveImplementations`, `methodAccept`, `methodsAccept`, `subclassesAccept`, `superClassConstantAccept`, `thisClassConstantAccept`. 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 38 declarations carry 35 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 35 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. — third_party/java/proguard/proguard6.2.2/src/proguard/classfile/Clazz.java:33
  • `NodeEntry` declares 38 abstract methods: `addExternalDep`, `addReverseDepAndCheckIfDone`, `addSingletonTemporaryDirectDep`, `addTemporaryDirectDepGroup`, `addTemporaryDirectDepsInGroups`, `checkIfDoneForDirtyReverseDep`, `forceRebuild`, `getAllDirectDepsForIncompleteNode`, `getAllRemainingDirtyDirectDeps`, `getAllReverseDepsForNodeBeingDeleted`, `getDirectDeps`, `getErrorInfo`, `getInProgressReverseDeps`, `getLifecycleState`, `getNextDirtyDirectDeps`, `getResetDirectDeps`, `getReverseDepsForDoneEntry`, `getTemporaryDirectDeps`, `getValue`, `getValueMaybeWithMetadata`, `getVersion`, `hasAtLeastOneDep`, `hasUnsignaledDeps`, `isChanged`, `isDirty`, `isDone`, `isReadyToEvaluate`, `markClean`, `markDirty`, `markRebuilding`, `noDepsLastBuild`, `removeReverseDep`, `removeReverseDepsFromDoneEntryDueToDeletion`, `removeUnfinishedDeps`, `resetEvaluationFromScratch`, `setValue`, `signalDep`, `toValue`. 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. — src/main/java/com/google/devtools/build/skyframe/NodeEntry.java:34
  • `MemoizingEvaluator` declares 19 abstract methods: `cleanupInterningPools`, `delete`, `deleteDirty`, `dumpCount`, `dumpDeps`, `dumpFunctionGraph`, `dumpKeys`, `dumpRdeps`, `dumpSummary`, `dumpValues`, `evaluate`, `getDoneValues`, `getExistingEntryAtCurrentlyEvaluatingVersion`, `getExistingErrorForTesting`, `getExistingValue`, `getInMemoryGraph`, `getValues`, `injectGraphTransformerForTesting`, `isRewinding`. 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. — src/main/java/com/google/devtools/build/skyframe/MemoizingEvaluator.java:37
  • `JavaInfoApi<FileT, JavaOutputT, JavaPluginDataT>` declares 17 abstract methods: `getCompilationInfoProvider`, `getCompileTimeJars`, `getCompileTimeJavaDependencies`, `getFullCompileTimeJars`, `getGenJarsProvider`, `getJavaConstraintsStarlark`, `getJavaModuleFlagsInfo`, `getOutputJars`, `getRuntimeOutputJars`, `getSourceJars`, `getTransitiveCompileTimeJars`, `getTransitiveFullCompileJars`, `getTransitiveNativeLibrariesForStarlark`, `getTransitiveRuntimeJars`, `getTransitiveSourceJars`, `headerCompilationDirectDeps`, `isNeverlink`. 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. — src/main/java/com/google/devtools/build/lib/starlarkbuildapi/java/JavaInfoApi.java:34
  • `JavaConfigurationApi` declares 21 abstract methods: `autoCreateJavaTestDeployJars`, `bytecodeOptimizationPassActions`, `enforceOneVersionOnJavaTests`, `enforceProguardFileExtension`, `explicitJavaTestDepsStarlark`, `getBytecodeOptimizerMnemonic`, `getDefaultJavacFlagsForStarlarkAsList`, `getDefaultJavacFlagsStarlark`, `getDefaultJvmFlags`, `getDisallowJavaImportExportsInStarlark`, `getGenerateJavaDepsStarlark`, `getPlugins`, `getReduceJavaClasspathStarlark`, `getStrictJavaDepsName`, `getUseHeaderCompilationDirectDepsInStarlark`, `getUseIjarsInStarlark`, `multiReleaseDeployJars`, `runAndroidLint`, `splitBytecodeOptimizationPass`, `starlarkOneVersionEnforcementLevel`, `useHeaderCompilationStarlark`. 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. — src/main/java/com/google/devtools/build/lib/starlarkbuildapi/java/JavaConfigurationApi.java:32
  • `CppConfigurationApi<InvalidConfigurationExceptionT>` declares 24 abstract methods: `appleGenerateDsym`, `buildTestDwpIsActivatedStarlark`, `csFdoInstrumentStarlark`, `customMalloc`, `disableNocoptsStarlark`, `fdoInstrumentStarlark`, `fissionActiveForCurrentCompilationModeStarlark`, `forcePicStarlark`, `generateLlvmLcovStarlark`, `getConlyopts`, `getCopts`, `getCxxopts`, `getExperimentalLinkStaticLibrariesOnce`, `getLibcTopLabelStarlark`, `getLinkopts`, `getObjcopts`, `getSaveTempsForStarlark`, `getStripOptsStarlark`, `objcGenerateLinkmap`, `objcShouldStripBinary`, `processHeadersInDependenciesStarlark`, `saveFeatureStateStarlark`, `shareNativeDepsStarlark`, `shouldStripBinariesForStarlark`. 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. — src/main/java/com/google/devtools/build/lib/starlarkbuildapi/cpp/CppConfigurationApi.java:33
  • `CcCompilationContextApi<FileT>` declares 25 abstract methods: `getDirectModuleMapsForStarlark`, `getHeaderInfo`, `getNonCodeInputsForStarlark`, `getStarlarkDefines`, `getStarlarkDirectModularHeaders`, `getStarlarkDirectPrivateHeaders`, `getStarlarkDirectPublicHeaders`, `getStarlarkDirectTextualHeaders`, `getStarlarkExportingModuleMaps`, `getStarlarkExternalIncludeDirs`, `getStarlarkFrameworkIncludeDirs`, `getStarlarkHeaders`, `getStarlarkIncludeDirs`, `getStarlarkModuleFiles`, `getStarlarkModuleMap`, `getStarlarkModulesInfoFiles`, `getStarlarkNonTransitiveDefines`, `getStarlarkPicModuleFiles`, `getStarlarkPicModulesInfoFiles`, `getStarlarkQuoteIncludeDirs`, `getStarlarkSystemIncludeDirs`, `getStarlarkTransitiveModules`, `getStarlarkTransitivePicModules`, `getStarlarkValidationArtifacts`, `getStarlarkVirtualToOriginalHeaders`. 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. — src/main/java/com/google/devtools/build/lib/starlarkbuildapi/cpp/CcCompilationContextApi.java:35
  • `AndroidConfigurationApi` declares 20 abstract methods: `apkSigningMethodV1`, `apkSigningMethodV2`, `apkSigningMethodV4`, `compressJavaResources`, `desugarJava8`, `desugarJava8Libs`, `fixedResourceNeverlinking`, `getDexoptsSupportedInDexSharder`, `getExportsManifestDefault`, `getJavaResourcesFromOptimizedJar`, `getOutputDirectoryName`, `incrementalDexingShardsAfterProguard`, `persistentBusyboxTools`, `persistentDexDesugar`, `persistentMultiplexBusyboxTools`, `persistentMultiplexDexDesugar`, `useAndroidResourceCycleShrinking`, `useAndroidResourceNameObfuscation`, `useAndroidResourcePathShortening`, `useAndroidResourceShrinking`. 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. — src/main/java/com/google/devtools/build/lib/starlarkbuildapi/android/AndroidConfigurationApi.java:32
  • `StarlarkRuleContextApi<ConstraintValueT>` declares 36 abstract methods: `actions`, `aspectIds`, `callParent`, `checkPlaceholders`, `createdActions`, `execGroups`, `expandLocation`, `expandMakeVariables`, `getAttr`, `getBinDirectory`, `getBuildFileRelativePath`, `getBuildSettingValue`, `getConfiguration`, `getDisabledFeatures`, `getExecutable`, `getFeatures`, `getFile`, `getFiles`, `getFragments`, `getGenfilesDirectory`, `getLabel`, `getSplitAttr`, `getStableWorkspaceStatus`, `getVolatileWorkspaceStatus`, `getWorkspaceName`, `instrumentCoverage`, `outputs`, `packageRelativeLabel`, `resolveCommand`, `resolveTools`, `rule`, `runfiles`, `targetPlatformHasConstraint`, `tokenize`, `toolchains`, `var`. 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. — src/main/java/com/google/devtools/build/lib/starlarkbuildapi/StarlarkRuleContextApi.java:58
  • `StarlarkAttrModuleApi` declares 17 abstract methods: `boolAttribute`, `dormantLabelAttribute`, `dormantLabelListAttribute`, `intAttribute`, `intListAttribute`, `labelAttribute`, `labelKeyedStringDictAttribute`, `labelListAttribute`, `labelListDictAttribute`, `licenseAttribute`, `outputAttribute`, `outputListAttribute`, `stringAttribute`, `stringDictAttribute`, `stringKeyedLabelDictAttribute`, `stringListAttribute`, `stringListDictAttribute`. 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. — src/main/java/com/google/devtools/build/lib/starlarkbuildapi/StarlarkAttrModuleApi.java:57
  • `QueryEnvironment<T>` declares 30 abstract methods: `buildTransitiveClosure`, `createEvaluateExpression`, `createMinDepthUniquifier`, `createThreadSafeMutableSet`, `createUniquifier`, `eval`, `execute`, `executeAsync`, `getAccessor`, `getFunctions`, `getFwdDeps`, `getLabelPrinter`, `getNodesOnPath`, `getOrCreate`, `getReverseDeps`, `getSiblingTargetsInPackage`, `getTargetsMatchingPattern`, `getTransitiveClosure`, `getTransitiveLoadFilesHelper`, `handleError`, `immediateCancelledFuture`, `immediateFailedFuture`, `immediateSuccessfulFuture`, `isSettingEnabled`, `transformAsync`, `transitiveLoadFiles`, `whenAllSucceed`, `whenAllSucceedCall`, `whenSucceedsCall`, `whenSucceedsOrIsCancelledCall`. 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. — src/main/java/com/google/devtools/build/lib/query2/engine/QueryEnvironment.java:47
  • `TraceProfilerService` declares 28 abstract methods: `clear`, `completeTask`, `createTimeSeries`, `getProfileElapsedTime`, `getServerProcessCpuTime`, `getSlowestTasks`, `getTasksHistograms`, `isActive`, `isProfiling`, `logCounters`, `logEvent`, `logEventAtTime`, `logSimpleTask`, `logSimpleTask`, `logSimpleTaskDuration`, `markPhase`, `nanoTimeMaybe`, `profile`, `profile`, `profile`, `profileAction`, `profileAsync`, `profileFuture`, `registerCounterSeriesCollector`, `setVfsTypeHeuristics`, `start`, `stop`, `unregisterCounterSeriesCollector`. 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 28 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. — src/main/java/com/google/devtools/build/lib/profiler/TraceProfilerService.java:51
  • `SpawnExecutionContext` declares 16 abstract methods: `checkForLostInputs`, `getActionFileSystem`, `getClientEnv`, `getContext`, `getDigest`, `getFileOutErr`, `getId`, `getInputMapping`, `getInputMetadataProvider`, `getTimeout`, `isRewindingEnabled`, `lockOutputFiles`, `prefetchInputs`, `report`, `setDigest`, `speculating`. 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. — src/main/java/com/google/devtools/build/lib/exec/SpawnRunner.java:141
  • `ActionConstructionContext` declares 22 abstract methods: `getActionKeyContext`, `getActionOwner`, `getActionOwner`, `getAnalysisEnvironment`, `getBinDirectory`, `getBinOrGenfilesDirectory`, `getConfiguration`, `getDerivedArtifact`, `getExecutionPlatform`, `getExecutionPlatform`, `getGenfilesDirectory`, `getImplicitOutputArtifact`, `getPackageDirectory`, `getPackageRelativeArtifact`, `getRelatedArtifact`, `getRuleErrorConsumer`, `getShareableArtifact`, `getTreeArtifact`, `getUniqueDirectory`, `getUniqueDirectoryArtifact`, `getUniqueDirectoryArtifact`, `getUniqueDirectoryArtifact`. 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 22 declarations carry 18 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 18 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. — src/main/java/com/google/devtools/build/lib/analysis/actions/ActionConstructionContext.java:37
  • `AnalysisEnvironment` declares 20 abstract methods: `declareStampSettingDep`, `getActionKeyContext`, `getConstantMetadataArtifact`, `getDerivedArtifact`, `getEventHandler`, `getFilesetArtifact`, `getLocalGeneratingAction`, `getMainRepoMapping`, `getOrphanArtifacts`, `getRegisteredActions`, `getRunfilesArtifact`, `getSkyframeEnv`, `getStableWorkspaceStatusArtifact`, `getStarlarkDefinedBuiltins`, `getStarlarkSemantics`, `getSymlinkArtifact`, `getTreeArtifact`, `getTreeArtifactsConflictingWithFiles`, `getVolatileWorkspaceStatusArtifact`, `hasErrors`. 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. — src/main/java/com/google/devtools/build/lib/analysis/AnalysisEnvironment.java:40
  • `SpawnResult` declares 18 abstract methods: `exitCode`, `failureDetail`, `getDetailMessage`, `getExecutorHostName`, `getMemoryInKb`, `getMetrics`, `getNumBlockInputOperations`, `getNumBlockOutputOperations`, `getNumInvoluntaryContextSwitches`, `getRunnerName`, `getRunnerSubtype`, `getStartTime`, `getSystemTimeInMs`, `getUserTimeInMs`, `getWallTimeInMs`, `isCacheHit`, `status`, `wasRemote`. 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. — src/main/java/com/google/devtools/build/lib/actions/SpawnResult.java:38
  • `ActionAnalysisMetadata` declares 19 abstract methods: `describe`, `getClientEnvironmentVariables`, `getExecProperties`, `getExecutionPlatform`, `getInputFilesForExtraAction`, `getInputs`, `getKey`, `getMandatoryInputs`, `getMandatoryOutputs`, `getMnemonic`, `getOriginalInputs`, `getOutputs`, `getOwner`, `getPrimaryInput`, `getPrimaryOutput`, `getSchedulingDependencies`, `getTools`, `isShareable`, `prettyPrint`. 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. — src/main/java/com/google/devtools/build/lib/actions/ActionAnalysisMetadata.java:27

What to do

  • Split fat interfaces into focused role-interfaces so clients depend only on what they use.
AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.

Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.

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.

IC1 · Incompleteness & stubs10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Unfinished work detected by code SHAPE, not keywords, in this repository's Java: methods that only throw a "not implemented" exception, methods that take inputs and return a constant or do nothing, dead `if (false)` branches, and skeleton classes most of whose methods are holes.

Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, guards that return what the code already falls through to, tests an earlier guard already decided, comparisons against NaN, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.

  • A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something. (×36) — src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/MainTest.java:33, src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/internal/junit4/JUnit4TestXmlListenerTest.java:268, src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4/JUnit4TestModelBuilderTest.java:172, …
  • `testPass` has an empty body — confirm it's an intentional no-op and not an unfinished method. (×2) — src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/testbed/JUnit4TestbridgeExercises.java:29, src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/testbed/JUnit4TestbridgeOomExercises.java:27
  • `ensureRegistered` has an empty body — confirm it's an intentional no-op and not an unfinished method. — src/main/java/com/google/devtools/build/lib/vfs/bazel/BazelHashFunctions.java:44

What to do

  • Clear the softer debt: re-enable or delete @Disabled/@Ignore tests, decide whether each empty method or UnsupportedOperationException is deliberate (and say so in a comment), and replace @SuppressWarnings("all") with targeted, justified suppressions.
M1 · Documentation (README)6.7 / 10Adequate✓ Tool-verified

Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.

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

  • 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.
  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
M2 · Architecture documentation0.0 / 10Critical✓ 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.
  • No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.

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.
  • Add a C4 context/container diagram (Structurizr, PlantUML or Mermaid) or an architecture.md overview.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repo is organised deliberately — src/test separation and consistent project naming.

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

M4 · Documentation accuracy8.5 / 10Strong◐ Sampled · advisory

Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).

Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.

  • docs/help.mdx links to `/community/experts`, but `community/experts` does not exist. 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. — docs/help.mdx:45
  • docs/help.mdx links to `/release`, but `release` does not exist. 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. — docs/help.mdx:49
  • docs/about/faq.mdx links to `/help`, but `help` does not exist. 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. — docs/about/faq.mdx:7
  • docs/about/faq.mdx links to `/reference/be/overview`, but `reference/be/overview` does not exist. 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. — docs/about/faq.mdx:17
  • docs/about/faq.mdx links to `/remote/rbe`, but `remote/rbe` does not exist. 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. — docs/about/faq.mdx:45
  • docs/about/faq.mdx links to `/remote/caching`, but `remote/caching` does not exist. 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. — docs/about/faq.mdx:45
  • docs/about/faq.mdx links to `/start/`, but `start` does not exist. 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. — docs/about/faq.mdx:111
  • docs/about/faq.mdx links to `/release/`, but `release` does not exist. 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. — docs/about/faq.mdx:142
  • docs/about/faq.mdx links to `/run/scripts#exit-codes`, but `run/scripts` does not exist. 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. — docs/about/faq.mdx:158
  • docs/about/faq.mdx links to `/extending/concepts`, but `extending/concepts` does not exist. 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. — docs/about/faq.mdx:164
  • docs/about/faq.mdx links to `/contribute/`, but `contribute` does not exist. 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. — docs/about/faq.mdx:168
  • docs/about/intro.mdx links to `/rules`, but `rules` does not exist. 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. — docs/about/intro.mdx:37
  • docs/about/intro.mdx links to `/install`, but `install` does not exist. 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. — docs/about/intro.mdx:45
  • docs/about/intro.mdx links to `/concepts/build-ref#workspaces`, but `concepts/build-ref` does not exist. 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. — docs/about/intro.mdx:47
  • docs/about/intro.mdx links to `/reference/command-line-reference`, but `reference/command-line-reference` does not exist. 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. — docs/about/intro.mdx:67
  • docs/about/intro.mdx links to `/reference/test-encyclopedia`, but `reference/test-encyclopedia` does not exist. 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. — docs/about/intro.mdx:71
  • docs/about/intro.mdx links to `/query/guide`, but `query/guide` does not exist. 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. — docs/about/intro.mdx:71
  • docs/about/intro.mdx links to `/concepts/dependencies`, but `concepts/dependencies` does not exist. 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. — docs/about/intro.mdx:81
  • docs/about/intro.mdx links to `/extending/concepts#evaluation-model`, but `extending/concepts` does not exist. 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. — docs/about/intro.mdx:82
  • docs/about/intro.mdx links to `/basics/hermeticity`, but `basics/hermeticity` does not exist. 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. — docs/about/intro.mdx:91
  • docs/about/intro.mdx links to `/start/`, but `start` does not exist. 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. — docs/about/intro.mdx:105
  • docs/about/intro.mdx links to `/start/cpp`, but `start/cpp` does not exist. 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. — docs/about/intro.mdx:108
  • docs/about/intro.mdx links to `/start/java`, but `start/java` does not exist. 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. — docs/about/intro.mdx:109
  • docs/about/intro.mdx links to `/start/android-app`, but `start/android-app` does not exist. 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. — docs/about/intro.mdx:110
  • docs/about/intro.mdx links to `/start/ios-app`, but `start/ios-app` does not exist. 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. — docs/about/intro.mdx:111
  • docs/about/vision.mdx links to `/extending/toolchains`, but `extending/toolchains` does not exist. 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. — docs/about/vision.mdx:87
  • docs/about/why.mdx links to `/remote/rbe`, but `remote/rbe` does not exist. 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. — docs/about/why.mdx:18
  • docs/about/why.mdx links to `/basics/hermeticity`, but `basics/hermeticity` does not exist. 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. — docs/about/why.mdx:31
  • docs/about/why.mdx links to `/rules/language`, but `rules/language` does not exist. 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. — docs/about/why.mdx:42
  • docs/about/why.mdx links to `/docs/user-manual#running-tests`, but `docs/user-manual` does not exist. 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. — docs/about/why.mdx:49
  • docs/about/why.mdx links to `/remote/bep`, but `remote/bep` does not exist. 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. — docs/about/why.mdx:54
  • docs/about/why.mdx links to `/external/overview`, but `external/overview` does not exist. 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. — docs/about/why.mdx:67
  • docs/about/why.mdx links to `/extending/platforms`, but `extending/platforms` does not exist. 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. — docs/about/why.mdx:76
  • docs/about/why.mdx links to `/community/users`, but `community/users` does not exist. 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. — docs/about/why.mdx:81
  • docs/about/why.mdx links to `/community/experts`, but `community/experts` does not exist. 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. — docs/about/why.mdx:83
  • docs/about/why.mdx links to `/rules`, but `rules` does not exist. 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. — docs/about/why.mdx:85
  • docs/basics/artifact-based-builds.mdx links to `/extending/rules`, but `extending/rules` does not exist. 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. — docs/basics/artifact-based-builds.mdx:187
  • docs/basics/artifact-based-builds.mdx links to `/docs/sandboxing`, but `docs/sandboxing` does not exist. 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. — docs/basics/artifact-based-builds.mdx:214
  • docs/basics/dependencies.mdx links to `/images/transitive-dependencies.png`, but `images/transitive-dependencies.png` does not exist. 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. — docs/basics/dependencies.mdx:110
  • docs/basics/dependencies.mdx links to `/external/overview`, but `external/overview` does not exist. 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. — docs/basics/dependencies.mdx:232

What to do

  • Reconcile the README with reality: docs/help.mdx links to `/community/experts`, but `community/experts` does not exist; docs/help.mdx links to `/release`, but `release` does not exist; docs/about/faq.mdx links to `/help`, but `help` does not exist; docs/about/faq.mdx links to `/reference/be/overview`, but `reference/be/overview` does not exist; docs/about/faq.mdx links to `/remote/rbe`, but `remote/rbe` does not exist.
P1 · CI/CD gates8.5 / 10Strong✓ Tool-verified

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.

What to do

  • Run the test suite in CI via an explicit runner step (`pytest` for the toolchain this pipeline already uses) and gate merges on it.
P2 · Observability7.5 / 10Strong✓ Tool-verified

Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.

Method: Filesystem/Roslyn scan: structured-logging frameworks (Serilog, NLog), OpenTelemetry, and health-check endpoint patterns. Exhaustive, deterministic.

  • Only 1/2 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`.

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
P3 · Security & performance tooling6.0 / 10Adequate✓ 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.

  • `scorecard.yml` run(s) a static-analysis scan, but no workflow that runs one is triggered by a pull request (or a merge queue, or an unfiltered push) — the scan fires on a schedule or a manual dispatch only. A vulnerable change therefore merges clean and is reported on the next scheduled run, by which time it is on the default branch and the only remedy is a follow-up fix. Add the pull-request trigger to the workflow that runs the scan so the finding arrives before the merge rather than after it.

What to do

  • Trigger your SAST workflow on pull requests — a scan that only runs on a cron reports history, it does not gate.
  • Dependabot is configured but does not watch `pip`, `maven`, `gradle` — add those `package-ecosystem` entries to REDACTED so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback3.0 / 10Weak✓ 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.

  • No release automation was found in CI — neither a deploy stage (Helm/Kubernetes/compose manifests, an orchestrated rollout) nor a publish job that ships the built artifact. Releases appear to be run by hand, which is slower, less repeatable and harder to reverse.

What to do

  • Automate the release in CI — a deploy stage for a service (Helm/Kubernetes manifests or an equivalent rollout), or a tag-triggered publish job for an artifact — so releases are repeatable and reversible.
P6 · Release Hygiene10.0 / 10Exemplary✓ 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.

PF1 · Benchmark discipline8.5 / 10Strong✓ Tool-verified

Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.

Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.

  • A JMH/Jetpack Benchmark suite exists but nothing turns on its allocation measurement — allocations (the main way hot code pressures a garbage collector or allocator) aren't being measured. — src/test/java/com/google/devtools/build/lib/remote/ChunkedTransferBenchmark.java

What to do

  • Run JMH with the GC profiler (`-prof gc`, or addProfiler(GCProfiler.class)) so allocation rate regressions are visible, not just time.
PF2 · Allocation hygiene6.1 / 10Adequate✓ Tool-verified

Readiness · Performance — Whether the code is written to minimise allocations so it doesn't pressure its host's memory manager — buffer/slice views over copies, object pooling, stack or value-type allocation, and buffer writers. Reward-only: credited where present, never penalised where a simpler style is fine.

Method: Production-source scan: density (per 1k LoC) of allocation-aware APIs — in .NET Span/Memory, ArrayPool/ObjectPool, stackalloc, ValueTask, value-type structs, IBufferWriter, string.Create, SkipLocalsInit; off .NET, with comments and strings blanked, Go's sync.Pool, preallocated slices/maps, Grow, strconv.Append* and buf[:0] reuse; the JVM's NIO buffer views, MemorySegment, primitive collections, pools and literal presizes (plus Kotlin primitive arrays and value classes, Scala AnyVal and @specialized); Swift's reserveCapacity, ContiguousArray, withUnsafe* access and ~Copyable. Activated off .NET on the same floor (400 lines, and benchmarks or 8 uses); Rust and garbage-collected scripting languages are not applicable. Reward-only. Deterministic, syntax/text detection.

What to do

  • Raise allocation-aware density on the hot paths — currently 84 use(s) across 653,384 production line(s) (~0.1/1k). More of the idioms below on the allocation-heavy paths climbs this toward 10.
  • Java: on hot paths, work through buffer views (ByteBuffer/LongBuffer slices, MemorySegment) instead of copies, avoid boxing with primitive collections (fastutil, Eclipse Collections, HPPC, Trove), presize collections and StringBuilders, and pool expensive buffers (Netty's pooled allocator, commons-pool).
X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.

Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.

X12 · Unreachable branch10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.

Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.

X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.

Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.

X14 · Bypassable address classification10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.

Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.

X15 · Unvalidated length from an untrusted reader2.7 / 10Weak✓ Tool-verified

Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.

Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.

  • `length` is read from the bytes being parsed at line 189 (`readInt`), then used to size a `new byte[]` at line 193 — and nowhere in its scope is `length` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `length` against the bytes actually remaining and a maximum the format allows before allocating. — src/main/java/com/google/devtools/build/lib/actions/cache/PersistentStringIndexer.java:193
  • `size` is read from the bytes being parsed at line 210 (`readInt`), then used to size a `new byte[]` at line 214 — and nowhere in its scope is `size` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `size` against the bytes actually remaining and a maximum the format allows before allocating. — src/main/java/com/google/devtools/build/lib/actions/cache/CompactPersistentActionCache.java:214

What to do

  • Each finding names the read that takes the length from the input and the site that spends it, and states that the value is never compared in between. Confirm from the two, then bound the length against the remaining stream before using it.
X16 · Unfloored truncation loop10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.

Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.

X17 · Uncapped recursion over a caller-supplied document10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.

Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.

X18 · Disposal-pattern correctness10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.

Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.

X19 · Unrestored process-global state10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.

Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.

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 `NullPointerException` (Java, Kotlin, Scala), `ArgumentError.notNull` (Dart) or `ArgumentNullException` (F#'s `nullArg`) 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.

X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.

Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.

X22 · Contradicted release guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.

Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.

X23 · Unguarded diagnostic materialisation10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.

Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.

X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.

Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.

X25 · Inert configuration knob10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.

Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.

X26 · Unsynchronised callback handoff10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.

Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.

X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether an enhanced `for` leaves the collection it is walking alone — a body that adds to or removes from the very collection the loop is iterating invalidates the fail-fast iterator it is holding, so the next `next()` throws `ConcurrentModificationException` and the remaining elements are never seen. Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen.

Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.

X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.

Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.

X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.

Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.

X3 · Exception handling8.0 / 10Strong✓ Tool-verified

Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.

Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.

  • `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — src/main/java/com/google/devtools/build/lib/collect/nestedset/NestedSet.java:500
  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×3) — src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java:2158, src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java:2177, src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java:2182

What to do

  • Swallowed exception (caught, then discarded)
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.

Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.

X5 · Nullable reference types2.0 / 10Critical✓ Tool-verified

Other · Code Health — Whether Java packages are null-marked and not undermined by heavy nullness suppression — a package under `@NullMarked` (or `@NonNullApi`, `@ParametersAreNonnullByDefault`, `@NonNullByDefault`, or a NullAway/Checker Framework configuration naming it) makes an unannotated reference exclude null, and `@SuppressWarnings("NullAway")`, `("nullness")`, `("null")` and `castToNonNull(…)` are what silence it.

Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.

  • 0/224 of this repository's Java package directories are under a non-null default: a `REDACTED` declaring `@NullMarked` (JSpecify) or `@NonNullApi`, `@ParametersAreNonnullByDefault`, `@NonNullByDefault`, `@DefaultQualifier(NonNull.class)`; a `module-info.java` declaring `@NullMarked`; every type in it `@NullMarked`; or a build that runs NullAway with the package in `AnnotatedPackages`, or the Checker Framework's `NullnessChecker`. Elsewhere every reference admits null and no checker warns on the dereference that throws a `NullPointerException`.

What to do

  • Declare the default where Java declares it: `@NullMarked` (org.jspecify.annotations) in each package's `REDACTED`, or once in `module-info.java`, and run NullAway (Error Prone) or the Checker Framework so the declaration is enforced. Then annotate the real exceptions `@Nullable` and resolve the suppressions rather than adding to them: a `@SuppressWarnings("NullAway")` or `castToNonNull(x)` on a value the checker could show to be null is a `NullPointerException` waiting for the path that makes it true — where the value genuinely cannot be null, say something the checker can see instead (a null check, `Objects.requireNonNull`, a non-null field initialised in the constructor).

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 Health65%Adequate — gated by X5Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture91%Adequate — gated by D26Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity55%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness60%Adequate — gated by P4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security67%Adequate — gated by D28Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance71%StrongStrongest area.
Unscored — 4 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.

  • D11 Test Reliability — 3 observation(s) recorded · This repository declares 3 of its own test(s) unreliable. The built-in reliability runner does not support this repository's ecosystem (.java, .py), so the suite was not re-run and no reliability score is given — these are the repository's own declarations, not our measurement.
  • X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X6 Hand-rolled structured-format parsing — 1 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 — 4 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.

  • C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 45 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.
  • AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
  • AX1 Captive dependencies — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No Go request handler (a net/http, Gin, Echo, Fiber or fasthttp handler, or a gRPC service method) is declared as a method or function, and no handler function literal writes a value captured from outside it, so no state is shared between request goroutines. No class in this Java code is a Spring, JSR-330 or CDI singleton bean. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads.
  • AX4 Dependency direction — not applicable to a CQRS architecture (the inward-dependency rule is for layered/clean styles)
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AXB1 Runtime evidence locked — no reproducible boot — This repository has nothing the runtime tiers could boot or serve — no markup, no UI framework or web-server dependency, no UI component source, no native UI project and no API definition — nothing here is a surface to boot — so runtime a11y/egress/header evidence has no subject here. Not applicable: this is neither a gap in the scan nor a finding about your code.
  • C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • D12 Dependency Hygiene — Not scored — 4 Maven/Gradle manifest(s) were read, stating a version for 0 dependency(ies) and leaving 0 to a parent or an imported BOM, but no build resolved the dependency graph, so the outdated signal was not established. NOT a finding that these dependencies are current or healthy.
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D20 ADR Quality — Repository kind not determined
  • D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — No inline comments to assess — comment value is not applicable here.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.java), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — 6 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • 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 project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage not included — suite not readable by the collector
  • DM1 Domain Modelling — applicable but not scored (2 signals for this style, 2 needed — the count is met but a required primary signal is absent): 830 value object(s); 56 domain event(s); its domain events are published by services or handlers — no domain entity raises one
  • ED1 Event-Driven — not scored — this repository shows only 1 of the 3 signals this lens looks for (11 CQRS handler(s))
  • ED5 Idempotency — Not assessed, and this one is on us: 6 command handler(s) or message consumer(s) were found here, but this check does not yet recognise persistence writes in this repository's language. Idempotency was neither confirmed nor ruled out — this is a limit of the analyzer, not a finding about your code.
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
  • 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'.
  • P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JVM, Python source, so there is no service whose uptime a failing dependency could take down
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (JaCoCo XML — `mvn jacoco:report` or the Gradle `jacocoTestReport` task) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
  • PF3 Async & latency hygiene — Not applicable: Go has no async/await function colour, so there is no asynchronous code for a blocking call to stall.
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • X2 Cancellation propagation — no C# was loaded; this repository's Java and Python were read, and no request in it can be cancelled by a caller — a Java request off Android takes no token: it is cancelled through the handle it returns (Future.cancel, Call.cancel, a Disposable), ambiently (io.grpc.Context) or by interrupting its thread, not through a parameter; a Python request takes no token: asyncio cancels the task and trio or anyio the scope that made it, from outside the call, and requests, httpx, aiohttp and gRPC take a timeout, not a cancellation
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X4 Structured logging — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's Java was read, and it logs through none that an assembled message defeats: java.util.logging's level methods, log4j 1, commons-logging, JBoss Logging and Flogger take one finished message (as log4net does in C#), or it makes no call through a named logger at all. Calls made through SLF4J or log4j 2 (`org.slf4j.Logger`, `org.apache.logging.log4j.Logger`, Lombok's `@Slf4j`) would be judged.
  • 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 — 42 finding(s)
D10 · Test Quality · No assertions (empty test) · ×17
  • No assertions (empty test): testAttributeTypeChecking src/test/java/com/google/devtools/build/lib/analysis/select/NonconfigurableAttributeMapperTest.java:82 — Test method has an empty body — it asserts nothing and exercises no code.
  • No assertions (empty test): testVisitation src/test/java/com/google/devtools/build/lib/analysis/select/NonconfigurableAttributeMapperTest.java:88 — Test method has an empty body — it asserts nothing and exercises no code.
  • No assertions (empty test): testOptionConversionCrosstoolTop src/test/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttrTransitionProviderTest.java:3089 — Test method has an empty body — it asserts nothing and exercises no code.
  • No assertions (empty test): testOptionConversionDynamicMode src/test/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttrTransitionProviderTest.java:3084 — Test method has an empty body — it asserts nothing and exercises no code.
  • No assertions (empty test): passing src/test/java/com/google/devtools/build/lib/testutil/TestInterruptingBugReporterTest.java:55 — Test method has an empty body — it asserts nothing and exercises no code.
  • No assertions (empty test): globMissingFile src/test/java/com/google/devtools/build/lib/buildtool/DanglingSymlinkTest.java:137 — Test method has an empty body — it asserts nothing and exercises no code.
  • No assertions (empty test): testGraphOrderOfWildcards src/test/java/com/google/devtools/build/lib/query2/engine/GraphlessQueryTest.java:85 — Test method has an empty body — it asserts nothing and exercises no code.
  • No assertions (empty test): boundedDepsWithError src/test/java/com/google/devtools/build/lib/query2/testutil/PostAnalysisQueryTest.java:1307 — Test method has an empty body — it asserts nothing and exercises no code.
  • No assertions (empty test): labelPointsToMultipleConfiguredTargets src/test/java/com/google/devtools/build/lib/query2/testutil/PostAnalysisQueryTest.java:1030 — Test method has an empty body — it asserts nothing and exercises no code.
  • No assertions (empty test): testDefaultVisibilityReturnedInDeps_nonEmptyDependencyFilter src/test/java/com/google/devtools/build/lib/query2/testutil/PostAnalysisQueryTest.java:1334 — Test method has an empty body — it asserts nothing and exercises no code.
  • No assertions (empty test): testEqualityOfOrderedThreadSafeImmutableSet src/test/java/com/google/devtools/build/lib/query2/testutil/PostAnalysisQueryTest.java:1101 — Test method has an empty body — it asserts nothing and exercises no code.
  • No assertions (empty test): testGraphOrderOfWildcards src/test/java/com/google/devtools/build/lib/query2/testutil/PostAnalysisQueryTest.java:1312 — Test method has an empty body — it asserts nothing and exercises no code.
  • No assertions (empty test): testNodepDeps_false src/test/java/com/google/devtools/build/lib/query2/testutil/PostAnalysisQueryTest.java:1329 — Test method has an empty body — it asserts nothing and exercises no code.
  • No assertions (empty test): testVisibleWithNonPackageGroupVisibility src/test/java/com/google/devtools/build/lib/query2/testutil/PostAnalysisQueryTest.java:1318 — Test method has an empty body — it asserts nothing and exercises no code.
  • No assertions (empty test): testVisibleWithPackageGroupWithNonPackageGroupIncludes src/test/java/com/google/devtools/build/lib/query2/testutil/PostAnalysisQueryTest.java:1324 — Test method has an empty body — it asserts nothing and exercises no code.
  • No assertions (empty test): testWildcardsDontLoadUnnecessaryPackages src/test/java/com/google/devtools/build/lib/query2/testutil/PostAnalysisQueryTest.java:1303 — Test method has an empty body — it asserts nothing and exercises no code.
  • No assertions (empty test): testBadPermissionsThrowsExceptionOnStatIfFound src/test/java/com/google/devtools/build/lib/vfs/JavaIoFileSystemTest.java:57 — Test method has an empty body — it asserts nothing and exercises no code.
D28 · Secrets (history) · REDACTED · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D11 · Test Reliability · Test declared unreliable · ×3
  • Test declared unreliable: testSimple src/test/java/com/google/devtools/build/lib/skyframe/MacOSXFsEventsDiffAwarenessTest.java:170 — This test is disabled or skipped with a reason naming unreliability — the repository's own words: "Test is flaky; see https://github.com/bazelbuild/bazel/issues/10776". A test that is skipped for flakiness is neither passing nor protecting the code it covers; either stabilise it or delete it, but do not leave it disabled indefinitely. (Found by reading the repository's own test source — the suite itself was not re-run, since the reliability runner does not support this ecosystem.)
  • Test declared unreliable: testRenameDirectory src/test/java/com/google/devtools/build/lib/skyframe/MacOSXFsEventsDiffAwarenessTest.java:186 — This test is disabled or skipped with a reason naming unreliability — the repository's own words: "Test is flaky; see https://github.com/bazelbuild/bazel/issues/10776". A test that is skipped for flakiness is neither passing nor protecting the code it covers; either stabilise it or delete it, but do not leave it disabled indefinitely. (Found by reading the repository's own test source — the suite itself was not re-run, since the reliability runner does not support this ecosystem.)
  • Test declared unreliable: testStress src/test/java/com/google/devtools/build/lib/skyframe/MacOSXFsEventsDiffAwarenessTest.java:201 — This test is disabled or skipped with a reason naming unreliability — the repository's own words: "Test is flaky; see https://github.com/bazelbuild/bazel/issues/10776". A test that is skipped for flakiness is neither passing nor protecting the code it covers; either stabilise it or delete it, but do not leave it disabled indefinitely. (Found by reading the repository's own test source — the suite itself was not re-run, since the reliability runner does not support this ecosystem.)
D13 · REDACTED Scanning · Leaked secret · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D28 · Secrets (history) · High secret · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · High CVE · ×2
  • REDACTED
  • REDACTED
D14 · License Compliance · Banned license · ×1
  • Banned license: frozendict — `frozendict` 2.4.7 is published on PyPI under `LGPL-3.0`, which this policy bans, and it is in the SHIPPED closure of this repository — so it is installed by everything that depends on this repository, not just by its test environment. A distribution offering SEVERAL licences is a choice and is only charged when every one of them is banned. Replace the package, or record an accepted exception.
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
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Critical vulnerability · ×1
  • REDACTED
D34 · Knowledge Freshness · Orphaned knowledge · ×1
  • Orphaned knowledge src/main/java/com/google/devtools/build/skyframe/InvalidatingNodeVisitor.java:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
D35 · Change Coupling · Boundary-crossing change coupling · ×1
  • Boundary-crossing change coupling: RemoteModule.java ↔ OnDiskBlobStoreCache.java src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java:1 — `src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java` (context main) and `src/tools/remote/src/main/java/com/google/devtools/build/remote/worker/OnDiskBlobStoreCache.java` (context tools) sit in DIFFERENT parts of the tree yet change together 58% of the time (11 of the 19 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `b6bc367c` Revert "Automated rollback of commit bcb1c38." (https://github.com/b…; `6fec0932` Skip chunk downloads by lazily indexing output files (https://github.…; `8da3f0da` Automated rollback of commit bcb1c3827921403c54f34ebcece42ec6ebbb0cb7. — run `git show` on any of them.
Serious — 5676 finding(s)
D10 · Test Quality · No assertions · ×2289
  • No assertions: testSleep examples/java-native/src/test/java/com/example/myproject/TestSleep.java:8 — 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: testInheritedAttributeGeneratesSignature src/test/java/com/google/devtools/build/docgen/RuleDocumentationTest.java:92 — 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: testSignatureContainsCommonAttribute src/test/java/com/google/devtools/build/docgen/RuleDocumentationTest.java:84 — 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: equals_returnsTrueForIdenticalRootAndDetectsDifferencesOnEachField src/test/java/com/google/devtools/build/lib/actions/ArtifactRootTest.java:199 — 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: equalsAndHashCode src/test/java/com/google/devtools/build/lib/actions/FileContentsProxyTest.java:92 — 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: testNoActionConflictWhenUnregisteringSharedAction src/test/java/com/google/devtools/build/lib/actions/MapBasedActionGraphTest.java:78 — 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: testSharedActionStressTest src/test/java/com/google/devtools/build/lib/actions/MapBasedActionGraphTest.java:170 — 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: testSmoke src/test/java/com/google/devtools/build/lib/actions/MapBasedActionGraphTest.java:49 — 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: testCPULoadScheduling_allowsExplicitZeroCpuWithNoCpuCapacity src/test/java/com/google/devtools/build/lib/actions/ResourceManagerTest.java:968 — 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: testCPULoadScheduling_success src/test/java/com/google/devtools/build/lib/actions/ResourceManagerTest.java:789 — 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: testMemoryLoadScheduling_success src/test/java/com/google/devtools/build/lib/actions/ResourceManagerTest.java:813 — 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: testScaledCpuRequestSucceeds src/test/java/com/google/devtools/build/lib/actions/ResourceManagerTest.java:862 — 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: testEquals src/test/java/com/google/devtools/build/lib/actions/ResourceSetTest.java:63 — 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: testComputesConsistentKeys src/test/java/com/google/devtools/build/lib/analysis/actions/BinaryFileWriteActionTest.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: actionInputsVary_checkComputeKeyResults src/test/java/com/google/devtools/build/lib/analysis/actions/BuildInfoFileWriteActionTest.java:201 — 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: testComputesConsistentKeys src/test/java/com/google/devtools/build/lib/analysis/actions/FileWriteActionTest.java:58 — 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: testComputeKey src/test/java/com/google/devtools/build/lib/analysis/actions/ParamFileWriteActionTest.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: starlarkRule_heuristicPathMappingNotAllowedViaExecutionRequirements src/test/java/com/google/devtools/build/lib/analysis/actions/PathMappersTest.java:242 — 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: testComputeKey src/test/java/com/google/devtools/build/lib/analysis/actions/SpawnActionTest.java:379 — 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: testComputeKey src/test/java/com/google/devtools/build/lib/analysis/actions/SymlinkTreeActionTest.java:48 — 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: testAbsentPackage src/test/java/com/google/devtools/build/lib/analysis/allowlisting/AllowlistTest.java:70 — 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: testCatchAll src/test/java/com/google/devtools/build/lib/analysis/allowlisting/AllowlistTest.java:85 — 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: testDirectPackage src/test/java/com/google/devtools/build/lib/analysis/allowlisting/AllowlistTest.java:36 — 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: testEmptyPackageGroup src/test/java/com/google/devtools/build/lib/analysis/allowlisting/AllowlistTest.java:102 — 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: testIncludes src/test/java/com/google/devtools/build/lib/analysis/allowlisting/AllowlistTest.java:119 — 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.
  • + 2264 more in this group — see findings.md.
D17 · Explicit Debt · TodoComment · ×1757
  • TodoComment scripts/ctexplain/lib_test.py:66 — # TODO: Bazel no longer has the concept of a host config. Fix the test. — 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 scripts/ctexplain/bazel_api.py:137 — # TODO(gregce): have cquery --output=jsonproto support --show_config_fragments — 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 scripts/docs/mdx_fixes.py:38 — # TODO(fwe): Replace escaped HTML. — 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 src/java_tools/buildjar/java/com/google/devtools/build/buildjar/VanillaJavaBuilder.java:205 — // TODO(cushon): support manifest protos & genjar — 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 src/java_tools/buildjar/java/com/google/devtools/build/buildjar/ReducedClasspathJavaLibraryBuilder.java:99 — // TODO(cushon): warn for transitive classpath fallback — 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 src/java_tools/buildjar/java/com/google/devtools/build/buildjar/OptionsParser.java:188 — // TODO(#970): Consider whether we want to use --sourcepath for resolving of #970.
  • TodoComment src/java_tools/buildjar/java/com/google/devtools/build/buildjar/JavaLibraryBuildRequest.java:298 — // TODO(cushon): This is being modified after parsing to add files from source jars. — 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 src/java_tools/buildjar/java/com/google/devtools/build/buildjar/JavaLibraryBuildRequest.java:323 — // TODO(bazel-team): This might be modified by a JavaLibraryBuilder to enable specific — 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 src/java_tools/buildjar/java/com/google/devtools/build/buildjar/instrumentation/JacocoInstrumentationProcessor.java:102 — // TODO(bazel-team): filter with coverage_instrumentation_filter? — 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 src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/BlazeJavacMain.java:118 — // TODO(cushon): where is this used when a diagnostic listener is registered? Consider removing — 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 src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/BlazeJavacMain.java:225 — // TODO(cushon): remove after the next javac update — 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 src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/BlazeJavacMain.java:228 — // TODO(cushon): remove after the next javac update — 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 src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins/dependency/StrictJavaDepsPlugin.java:299 — // TODO(#29770): what if Target-Label is absent from the manifest?
  • TodoComment src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins/dependency/DependencyModule.java:318 — // TODO(b/71936047): it should be an error for requiredClasspath to contain paths that are not — 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 src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/statistics/BlazeJavacStatistics.java:85 — // TODO(glorioso): We really need to think out more about what data to collect/store 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 src/java_tools/import_deps_checker/java/com/google/devtools/build/importdeps/Main.java:182 — // TODO(cushon): make --jdeps_output mandatory — 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 src/java_tools/import_deps_checker/java/com/google/devtools/build/importdeps/DepsCheckerClassVisitor.java:112 — // TODO(kmb): Consider removing this entirely so we don't have to track members at all — 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 src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/MainTest.java:33 — // TODO(cushon): re-enable after cl/210237269 — 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 src/java_tools/junitrunner/java/com/google/testing/junit/runner/BazelTestRunner.java:181 — // TODO(kush): Use a new classloader for the following instantiation. — 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 src/java_tools/junitrunner/java/com/google/testing/junit/runner/internal/junit4/JUnit4TestXmlListener.java:83 — // TODO(bazel-team) There's a known issue in the JUnit4 ParentRunner that — 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 src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4RunnerModule.java:53 — // TODO(bazel-team): Change the provider method to return ByteSink or CharSink — 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 src/java_tools/junitrunner/java/com/google/testing/junit/runner/model/TestCaseNode.java:178 — // TODO(bazel-team): Use AtomicReference instead of a synchronized 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 src/java_tools/junitrunner/java/com/google/testing/junit/runner/model/AntXmlResultWriter.java:126 — // TODO(bazel-team) - where to get this from? — 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 src/java_tools/junitrunner/java/com/google/testing/junit/runner/model/AntXmlResultWriter.java:129 — // TODO(bazel-team) - where to get this from? — 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 src/java_tools/junitrunner/java/com/google/testing/junit/runner/model/AntXmlResultWriter.java:145 — // TODO(bazel-team) - do we want to report the package name here? Could we simply get it from — 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.
  • + 1732 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×128
  • ClassTooLong: SkyframeExecutor src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java:329 — ClassTooLong — 2709 significant lines (blank, comment-only and punctuation-only lines excluded), 204 methods. The bar is 400 significant lines; this is 2309 over it, 6.77× 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: CcModuleApi src/main/java/com/google/devtools/build/lib/starlarkbuildapi/cpp/CcModuleApi.java:47 — ClassTooLong — 1954 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods. The bar is 400 significant lines; this is 1554 over it, 4.89× 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: StarlarkBaseExternalContext src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkBaseExternalContext.java:116 — ClassTooLong — 1806 significant lines (blank, comment-only and punctuation-only lines excluded), 54 methods. The bar is 400 significant lines; this is 1406 over it, 4.52× 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: BazelRulesModule src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRulesModule.java:38 — ClassTooLong — 1452 significant lines (blank, comment-only and punctuation-only lines excluded), 3 methods. The bar is 400 significant lines; this is 1052 over it, 3.63× 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: BlazeRuntime src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java:173 — ClassTooLong — 1321 significant lines (blank, comment-only and punctuation-only lines excluded), 64 methods. The bar is 400 significant lines; this is 921 over it, 3.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: RemoteExecutionService src/main/java/com/google/devtools/build/lib/remote/RemoteExecutionService.java:171 — ClassTooLong — 1310 significant lines (blank, comment-only and punctuation-only lines excluded), 51 methods. The bar is 400 significant lines; this is 910 over it, 3.28× 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: SkyframeActionExecutor src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java:144 — ClassTooLong — 1307 significant lines (blank, comment-only and punctuation-only lines excluded), 71 methods. The bar is 400 significant lines; this is 907 over it, 3.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.
  • ClassTooLong: StarlarkCustomCommandLine src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkCustomCommandLine.java:132 — ClassTooLong — 1236 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. The bar is 400 significant lines; this is 836 over it, 3.09× 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: PackageFunction src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java:120 — ClassTooLong — 1158 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 758 over it, 2.90× 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: RuleContext src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java:129 — ClassTooLong — 1150 significant lines (blank, comment-only and punctuation-only lines excluded), 121 methods. The bar is 400 significant lines; this is 750 over it, 2.88× 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: CcStarlarkInternal src/main/java/com/google/devtools/build/lib/rules/cpp/CcStarlarkInternal.java:89 — ClassTooLong — 1131 significant lines (blank, comment-only and punctuation-only lines excluded), 44 methods. The bar is 400 significant lines; this is 731 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.
  • ClassTooLong: StarlarkActionFactoryApi src/main/java/com/google/devtools/build/lib/starlarkbuildapi/StarlarkActionFactoryApi.java:40 — ClassTooLong — 1118 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. The bar is 400 significant lines; this is 718 over it, 2.80× 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: StarlarkRuleFunctionsApi src/main/java/com/google/devtools/build/lib/starlarkbuildapi/StarlarkRuleFunctionsApi.java:41 — ClassTooLong — 1085 significant lines (blank, comment-only and punctuation-only lines excluded), 8 methods. The bar is 400 significant lines; this is 685 over it, 2.71× 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: RemoteModule src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java:132 — ClassTooLong — 1012 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods. The bar is 400 significant lines; this is 612 over it, 2.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.
  • ClassTooLong: BuildLanguageOptions src/main/java/com/google/devtools/build/lib/packages/semantics/BuildLanguageOptions.java:77 — ClassTooLong — 1010 significant lines (blank, comment-only and punctuation-only lines excluded), 73 methods. The bar is 400 significant lines; this is 610 over it, 2.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.
  • ClassTooLong: ModuleFileGlobals src/main/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleFileGlobals.java:62 — ClassTooLong — 989 significant lines (blank, comment-only and punctuation-only lines excluded), 21 methods. The bar is 400 significant lines; this is 589 over it, 2.47× 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: ActionExecutionFunction src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java:138 — ClassTooLong — 972 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods. The bar is 400 significant lines; this is 572 over it, 2.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.
  • ClassTooLong: SkyframeBuildView src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java:139 — ClassTooLong — 958 significant lines (blank, comment-only and punctuation-only lines excluded), 33 methods. The bar is 400 significant lines; this is 558 over it, 2.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.
  • ClassTooLong: StarlarkActionFactory src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkActionFactory.java:109 — ClassTooLong — 943 significant lines (blank, comment-only and punctuation-only lines excluded), 40 methods. The bar is 400 significant lines; this is 543 over it, 2.36× 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: TypeChecker src/main/java/net/starlark/java/syntax/TypeChecker.java:48 — ClassTooLong — 938 significant lines (blank, comment-only and punctuation-only lines excluded), 48 methods. The bar is 400 significant lines; this is 538 over it, 2.35× 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: Package src/main/java/com/google/devtools/build/lib/packages/Package.java:98 — ClassTooLong — 927 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods. The bar is 400 significant lines; this is 527 over it, 2.32× 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: RemoteOptions src/main/java/com/google/devtools/build/lib/remote/options/RemoteOptions.java:48 — ClassTooLong — 884 significant lines (blank, comment-only and punctuation-only lines excluded), 101 methods. The bar is 400 significant lines; this is 484 over it, 2.21× 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: StarlarkAttrModule src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttrModule.java:92 — ClassTooLong — 875 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. The bar is 400 significant lines; this is 475 over it, 2.19× 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: CoreOptions src/main/java/com/google/devtools/build/lib/analysis/config/CoreOptions.java:66 — ClassTooLong — 869 significant lines (blank, comment-only and punctuation-only lines excluded), 92 methods. The bar is 400 significant lines; this is 469 over it, 2.17× 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: RunCommand src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java:120 — ClassTooLong — 841 significant lines (blank, comment-only and punctuation-only lines excluded), 30 methods. The bar is 400 significant lines; this is 441 over it, 2.10× 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.
  • + 103 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×126
  • FileTooLong: skyframe/SkyframeExecutor.java src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java — FileTooLong — 3014 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: SkyframeExecutor (329-4640). The bar is 500 significant lines; this is 2514 over it, 6.03× 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: cpp/CcModuleApi.java src/main/java/com/google/devtools/build/lib/starlarkbuildapi/cpp/CcModuleApi.java — FileTooLong — 1983 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: CcModuleApi (47-2121). The bar is 500 significant lines; this is 1483 over it, 3.97× 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: starlark/StarlarkBaseExternalContext.java src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkBaseExternalContext.java — FileTooLong — 1903 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: StarlarkBaseExternalContext (116-2426). The bar is 500 significant lines; this is 1403 over it, 3.81× 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: starlark/StarlarkRuleClassFunctions.java src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleClassFunctions.java — FileTooLong — 1637 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1137 over it, 3.27× 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: rules/BazelRulesModule.java src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRulesModule.java — FileTooLong — 1472 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: BazelRulesModule (38-1712). The bar is 500 significant lines; this is 972 over it, 2.94× 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: runtime/BlazeRuntime.java src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java — FileTooLong — 1469 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: BlazeRuntime (173-2186). The bar is 500 significant lines; this is 969 over it, 2.94× 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: remote/RemoteExecutionService.java src/main/java/com/google/devtools/build/lib/remote/RemoteExecutionService.java — FileTooLong — 1460 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: RemoteExecutionService (171-2306). The bar is 500 significant lines; this is 960 over it, 2.92× 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: cpp/CppCompileAction.java src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java — FileTooLong — 1430 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 930 over it, 2.86× 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: skyframe/SkyframeActionExecutor.java src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java — FileTooLong — 1430 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: SkyframeActionExecutor (144-2196). The bar is 500 significant lines; this is 930 over it, 2.86× 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: starlark/StarlarkCustomCommandLine.java src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkCustomCommandLine.java — FileTooLong — 1300 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: StarlarkCustomCommandLine (132-1970). The bar is 500 significant lines; this is 800 over it, 2.60× 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: skyframe/PackageFunction.java src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java — FileTooLong — 1257 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: PackageFunction (120-1882). The bar is 500 significant lines; this is 757 over it, 2.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: starlarkbuildapi/StarlarkAttrModuleApi.java src/main/java/com/google/devtools/build/lib/starlarkbuildapi/StarlarkAttrModuleApi.java — FileTooLong — 1253 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: returns (46-1375). The bar is 500 significant lines; this is 753 over it, 2.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: analysis/RuleContext.java src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java — FileTooLong — 1247 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: RuleContext (129-2310). The bar is 500 significant lines; this is 747 over it, 2.49× 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: packages/RuleClass.java src/main/java/com/google/devtools/build/lib/packages/RuleClass.java — FileTooLong — 1229 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 729 over it, 2.46× 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: cpp/CcStarlarkInternal.java src/main/java/com/google/devtools/build/lib/rules/cpp/CcStarlarkInternal.java — FileTooLong — 1201 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: CcStarlarkInternal (89-1478). The bar is 500 significant lines; this is 701 over it, 2.40× 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: syntax/Types.java src/main/java/net/starlark/java/syntax/Types.java — FileTooLong — 1177 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 677 over it, 2.35× 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: packages/Attribute.java src/main/java/com/google/devtools/build/lib/packages/Attribute.java — FileTooLong — 1169 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 669 over it, 2.34× 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: query2/SkyQueryEnvironment.java src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java — FileTooLong — 1155 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 655 over it, 2.31× 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: starlarkbuildapi/StarlarkActionFactoryApi.java src/main/java/com/google/devtools/build/lib/starlarkbuildapi/StarlarkActionFactoryApi.java — FileTooLong — 1140 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: StarlarkActionFactoryApi (40-1248). The bar is 500 significant lines; this is 640 over it, 2.28× 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: remote/RemoteModule.java src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java — FileTooLong — 1125 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: RemoteModule (132-1499). The bar is 500 significant lines; this is 625 over it, 2.25× 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: starlarkbuildapi/StarlarkRuleFunctionsApi.java src/main/java/com/google/devtools/build/lib/starlarkbuildapi/StarlarkRuleFunctionsApi.java — FileTooLong — 1105 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: StarlarkRuleFunctionsApi (41-1268). The bar is 500 significant lines; this is 605 over it, 2.21× 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: skyframe/SkyframeBuildView.java src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java — FileTooLong — 1075 significant lines (blank, comment-only and punctuation-only lines excluded), about 89% of them inside a single declaration: SkyframeBuildView (139-1590). The bar is 500 significant lines; this is 575 over it, 2.15× 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: skyframe/ActionExecutionFunction.java src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java — FileTooLong — 1074 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: ActionExecutionFunction (138-1684). The bar is 500 significant lines; this is 574 over it, 2.15× 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: semantics/BuildLanguageOptions.java src/main/java/com/google/devtools/build/lib/packages/semantics/BuildLanguageOptions.java — FileTooLong — 1040 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: BuildLanguageOptions (77-1253). The bar is 500 significant lines; this is 540 over it, 2.08× 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: starlark/StarlarkActionFactory.java src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkActionFactory.java — FileTooLong — 1034 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: StarlarkActionFactory (109-1391). The bar is 500 significant lines; this is 534 over it, 2.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.
  • + 101 more in this group — see findings.md.
D3 · God Classes · TooManyMethods · ×123
  • TooManyMethods: SkyframeExecutor src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java:329 — TooManyMethods — 204 methods. The bar is 30 methods; this is 174 over it, 6.80× 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: RuleContext src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java:129 — TooManyMethods — 121 methods. The bar is 30 methods; this is 91 over it, 4.03× 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: RemoteOptions src/main/java/com/google/devtools/build/lib/remote/options/RemoteOptions.java:48 — TooManyMethods — 101 methods. The bar is 30 methods; this is 71 over it, 3.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: CppCompileAction src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java:121 — TooManyMethods — 99 methods. The bar is 30 methods; this is 69 over it, 3.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: BuildConfigurationValue src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfigurationValue.java:89 — TooManyMethods — 97 methods. The bar is 30 methods; this is 67 over it, 3.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: CppConfiguration src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java:52 — TooManyMethods — 93 methods. The bar is 30 methods; this is 63 over it, 3.10× 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: CoreOptions src/main/java/com/google/devtools/build/lib/analysis/config/CoreOptions.java:66 — TooManyMethods — 92 methods. The bar is 30 methods; this is 62 over it, 3.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: SkyQueryEnvironment src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java:152 — TooManyMethods — 90 methods. The bar is 30 methods; this is 60 over it, 3.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: CommandEnvironment src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java:102 — TooManyMethods — 88 methods. The bar is 30 methods; this is 58 over it, 2.93× 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: Path src/main/java/com/google/devtools/build/lib/vfs/Path.java:56 — TooManyMethods — 76 methods. The bar is 30 methods; this is 46 over it, 2.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: BuildLanguageOptions src/main/java/com/google/devtools/build/lib/packages/semantics/BuildLanguageOptions.java:77 — TooManyMethods — 73 methods. The bar is 30 methods; this is 43 over it, 2.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: CppOptions src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java:42 — TooManyMethods — 73 methods. The bar is 30 methods; this is 43 over it, 2.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 src/main/java/net/starlark/java/syntax/Parser.java:33 — TooManyMethods — 73 methods. The bar is 30 methods; this is 43 over it, 2.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: SkyframeActionExecutor src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java:144 — TooManyMethods — 71 methods. The bar is 30 methods; this is 41 over it, 2.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: StarlarkRuleContext src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleContext.java:129 — TooManyMethods — 69 methods. The bar is 30 methods; this is 39 over it, 2.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: RemoteExternalOverlayFileSystem src/main/java/com/google/devtools/build/lib/remote/RemoteExternalOverlayFileSystem.java:91 — TooManyMethods — 69 methods. The bar is 30 methods; this is 39 over it, 2.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: Artifact src/main/java/com/google/devtools/build/lib/actions/Artifact.java:122 — TooManyMethods — 68 methods. The bar is 30 methods; this is 38 over it, 2.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: Attribute src/main/java/com/google/devtools/build/lib/packages/Attribute.java:81 — TooManyMethods — 67 methods. The bar is 30 methods; this is 37 over it, 2.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: Builder src/main/java/com/google/devtools/build/lib/packages/RuleClass.java:336 — TooManyMethods — 67 methods. The bar is 30 methods; this is 37 over it, 2.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: BuildGraveyardOptions src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRulesModule.java:50 — TooManyMethods — 66 methods. The bar is 30 methods; this is 36 over it, 2.20× 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: AbstractAction src/main/java/com/google/devtools/build/lib/actions/AbstractAction.java:69 — TooManyMethods — 64 methods. The bar is 30 methods; this is 34 over it, 2.13× 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: Rule src/main/java/com/google/devtools/build/lib/packages/Rule.java:76 — TooManyMethods — 64 methods. The bar is 30 methods; this is 34 over it, 2.13× 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: BlazeRuntime src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java:173 — TooManyMethods — 64 methods. The bar is 30 methods; this is 34 over it, 2.13× 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: CommonCommandOptions src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java:48 — TooManyMethods — 63 methods. The bar is 30 methods; this is 33 over it, 2.10× 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: UiEventHandler src/main/java/com/google/devtools/build/lib/runtime/UiEventHandler.java:93 — TooManyMethods — 63 methods. The bar is 30 methods; this is 33 over it, 2.10× 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.
  • + 98 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×85
  • MethodTooLong: RemoteModule.setup src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java:414 — MethodTooLong — setup runs 430 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 330 over it, 4.30× 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: BlazeCommandDispatcher.execExclusively src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java:376 — MethodTooLong — execExclusively runs 382 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 282 over it, 3.82× 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: ModCommand.execInternal src/main/java/com/google/devtools/build/lib/bazel/commands/ModCommand.java:217 — MethodTooLong — execInternal runs 345 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 245 over it, 3.45× 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: BazelRepositoryModule.beforeCommand src/main/java/com/google/devtools/build/lib/bazel/BazelRepositoryModule.java:279 — MethodTooLong — beforeCommand runs 329 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 229 over it, 3.29× 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: SkyframeBuildView.analyzeAndExecuteTargets src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java:620 — MethodTooLong — analyzeAndExecuteTargets runs 241 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 141 over it, 2.41× 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: Evaluate.runCore src/main/java/com/google/devtools/build/skyframe/AbstractParallelEvaluator.java:418 — MethodTooLong — runCore runs 240 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 140 over it, 2.40× 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: BuildView.update src/main/java/com/google/devtools/build/lib/analysis/BuildView.java:224 — MethodTooLong — update runs 231 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 131 over it, 2.31× 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: EvalUtils.binaryOp src/main/java/net/starlark/java/eval/EvalUtils.java:59 — MethodTooLong — binaryOp runs 217 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 117 over it, 2.17× 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: PackageFunction.compute src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java:368 — MethodTooLong — compute runs 202 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 102 over it, 2.02× 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: PackageFunction.loadPackage src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java:994 — MethodTooLong — loadPackage runs 199 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 99 over it, 1.99× 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: StandaloneTestStrategy.runTestAttempt src/main/java/com/google/devtools/build/lib/exec/StandaloneTestStrategy.java:651 — MethodTooLong — runTestAttempt runs 198 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 98 over it, 1.98× 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: SkyframeExecutor.skyFunctions src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java:778 — MethodTooLong — skyFunctions runs 196 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 96 over it, 1.96× 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: ActionGraphTextOutputFormatterCallback.writeText src/main/java/com/google/devtools/build/lib/query2/aquery/ActionGraphTextOutputFormatterCallback.java:167 — MethodTooLong — writeText 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: SingleExtensionEvalFunction.compute src/main/java/com/google/devtools/build/lib/bazel/bzlmod/SingleExtensionEvalFunction.java:99 — MethodTooLong — compute runs 173 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 73 over it, 1.73× 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: ParallelEvaluator.bubbleErrorUp src/main/java/com/google/devtools/build/skyframe/ParallelEvaluator.java:293 — MethodTooLong — bubbleErrorUp runs 169 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 69 over it, 1.69× 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: PatchUtil.applyInternal src/main/java/com/google/devtools/build/lib/bazel/repository/decompressor/PatchUtil.java:448 — MethodTooLong — applyInternal runs 164 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 64 over it, 1.64× 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: NodePrinter.printExpr src/main/java/net/starlark/java/syntax/NodePrinter.java:313 — MethodTooLong — printExpr runs 163 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 63 over it, 1.63× 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: BlazeRuntime.newRuntime src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java:1408 — MethodTooLong — newRuntime runs 161 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 61 over it, 1.61× 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: SourceFileReader.readDocsFromComments src/main/java/com/google/devtools/build/docgen/SourceFileReader.java:85 — MethodTooLong — readDocsFromComments runs 158 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 58 over it, 1.58× 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: BuildEventServiceUploader.publishBuildEvents src/main/java/com/google/devtools/build/lib/buildeventservice/BuildEventServiceUploader.java:458 — MethodTooLong — publishBuildEvents runs 158 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 58 over it, 1.58× 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: JavaCompilationHelper.createCompileAction src/main/java/com/google/devtools/build/lib/rules/java/JavaCompilationHelper.java:140 — MethodTooLong — createCompileAction runs 156 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 56 over it, 1.56× 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: BuildDriverFunction.compute src/main/java/com/google/devtools/build/lib/skyframe/BuildDriverFunction.java:157 — MethodTooLong — compute runs 156 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 56 over it, 1.56× 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: SkyframeBuildView.configureTargets src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java:402 — MethodTooLong — configureTargets runs 154 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 54 over it, 1.54× 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: RemoteSpawnCache.lookup src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnCache.java:84 — MethodTooLong — lookup runs 153 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 53 over it, 1.53× 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: RemoteAnalysisCacheFactory.create src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/RemoteAnalysisCacheFactory.java:80 — MethodTooLong — create runs 152 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 52 over it, 1.52× 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.
  • + 60 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×56
  • Hotspot: src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java:414 — src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 50 in RemoteModule.setup at line 414. 2 of those changes were fix/bug commits, and the other 22 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:28:31 -07:00' --until='2026-10-23 22:28:31 -07:00' --full-history --no-merges -- src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java:376 — src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 60 in BlazeCommandDispatcher.execExclusively at line 376. 1 of those changes was a fix/bug commit, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:28:31 -07:00' --until='2026-10-23 22:28:31 -07:00' --full-history --no-merges -- src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkActionFactory.java src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkActionFactory.java:724 — src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkActionFactory.java changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in StarlarkActionFactory.registerStarlarkAction at line 724. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:28:31 -07:00' --until='2026-10-23 22:28:31 -07:00' --full-history --no-merges -- src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkActionFactory.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/main/java/net/starlark/java/syntax/TypeChecker.java src/main/java/net/starlark/java/syntax/TypeChecker.java:156 — src/main/java/net/starlark/java/syntax/TypeChecker.java changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in TypeChecker.infer at line 156. 2 of those changes were fix/bug commits, and the other 12 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:28:31 -07:00' --until='2026-10-23 22:28:31 -07:00' --full-history --no-merges -- src/main/java/net/starlark/java/syntax/TypeChecker.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/main/java/com/google/devtools/build/lib/bazel/BazelRepositoryModule.java src/main/java/com/google/devtools/build/lib/bazel/BazelRepositoryModule.java:279 — src/main/java/com/google/devtools/build/lib/bazel/BazelRepositoryModule.java changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in BazelRepositoryModule.beforeCommand at line 279. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:28:31 -07:00' --until='2026-10-23 22:28:31 -07:00' --full-history --no-merges -- src/main/java/com/google/devtools/build/lib/bazel/BazelRepositoryModule.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/main/java/net/starlark/java/syntax/Types.java src/main/java/net/starlark/java/syntax/Types.java:613 — src/main/java/net/starlark/java/syntax/Types.java changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in CallableType.assignableFromHook at line 613. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:28:31 -07:00' --until='2026-10-23 22:28:31 -07:00' --full-history --no-merges -- src/main/java/net/starlark/java/syntax/Types.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/main/java/com/google/devtools/build/lib/remote/RemoteExternalOverlayFileSystem.java src/main/java/com/google/devtools/build/lib/remote/RemoteExternalOverlayFileSystem.java:288 — src/main/java/com/google/devtools/build/lib/remote/RemoteExternalOverlayFileSystem.java changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in RemoteExternalOverlayFileSystem.injectRecursively at line 288. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:28:31 -07:00' --until='2026-10-23 22:28:31 -07:00' --full-history --no-merges -- src/main/java/com/google/devtools/build/lib/remote/RemoteExternalOverlayFileSystem.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryFetchFunction.java src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryFetchFunction.java:222 — src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryFetchFunction.java changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in RepositoryFetchFunction.computeInternal at line 222. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:28:31 -07:00' --until='2026-10-23 22:28:31 -07:00' --full-history --no-merges -- src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryFetchFunction.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java:1750 — src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in Builder.createTargetMap at line 1750. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:28:31 -07:00' --until='2026-10-23 22:28:31 -07:00' --full-history --no-merges -- src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/main/java/com/google/devtools/build/lib/bazel/repository/decompressor/PatchUtil.java src/main/java/com/google/devtools/build/lib/bazel/repository/decompressor/PatchUtil.java:448 — src/main/java/com/google/devtools/build/lib/bazel/repository/decompressor/PatchUtil.java changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 54 in PatchUtil.applyInternal at line 448. 1 of those changes was a fix/bug commit, and the other 4 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:28:31 -07:00' --until='2026-10-23 22:28:31 -07:00' --full-history --no-merges -- src/main/java/com/google/devtools/build/lib/bazel/repository/decompressor/PatchUtil.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/main/java/com/google/devtools/build/lib/sandbox/SandboxModule.java src/main/java/com/google/devtools/build/lib/sandbox/SandboxModule.java:198 — src/main/java/com/google/devtools/build/lib/sandbox/SandboxModule.java changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in SandboxModule.setup at line 198. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:28:31 -07:00' --until='2026-10-23 22:28:31 -07:00' --full-history --no-merges -- src/main/java/com/google/devtools/build/lib/sandbox/SandboxModule.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/main/java/com/google/devtools/build/lib/analysis/RuleConfiguredTargetBuilder.java src/main/java/com/google/devtools/build/lib/analysis/RuleConfiguredTargetBuilder.java:101 — src/main/java/com/google/devtools/build/lib/analysis/RuleConfiguredTargetBuilder.java changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in RuleConfiguredTargetBuilder.build at line 101. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:28:31 -07:00' --until='2026-10-23 22:28:31 -07:00' --full-history --no-merges -- src/main/java/com/google/devtools/build/lib/analysis/RuleConfiguredTargetBuilder.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkCustomCommandLine.java src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkCustomCommandLine.java:333 — src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkCustomCommandLine.java changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in VectorArg.preprocess at line 333. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:28:31 -07:00' --until='2026-10-23 22:28:31 -07:00' --full-history --no-merges -- src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkCustomCommandLine.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/main/java/com/google/devtools/build/lib/buildtool/BuildTool.java src/main/java/com/google/devtools/build/lib/buildtool/BuildTool.java:1005 — src/main/java/com/google/devtools/build/lib/buildtool/BuildTool.java changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in BuildTool.processRequestHandleCheckedExceptions at line 1005. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:28:31 -07:00' --until='2026-10-23 22:28:31 -07:00' --full-history --no-merges -- src/main/java/com/google/devtools/build/lib/buildtool/BuildTool.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/main/java/com/google/devtools/build/lib/collect/nestedset/NestedSet.java src/main/java/com/google/devtools/build/lib/collect/nestedset/NestedSet.java:224 — src/main/java/com/google/devtools/build/lib/collect/nestedset/NestedSet.java changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in NestedSet.create at line 224. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:28:31 -07:00' --until='2026-10-23 22:28:31 -07:00' --full-history --no-merges -- src/main/java/com/google/devtools/build/lib/collect/nestedset/NestedSet.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/main/java/com/google/devtools/build/lib/remote/RemoteExecutionService.java src/main/java/com/google/devtools/build/lib/remote/RemoteExecutionService.java:1671 — src/main/java/com/google/devtools/build/lib/remote/RemoteExecutionService.java changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in RemoteExecutionService.waitForAndReuseOutputs at line 1671. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:28:31 -07:00' --until='2026-10-23 22:28:31 -07:00' --full-history --no-merges -- src/main/java/com/google/devtools/build/lib/remote/RemoteExecutionService.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/FileDependencySerializer.java src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/FileDependencySerializer.java:955 — src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/FileDependencySerializer.java changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in NodeDependencyHandler.reduce at line 955. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:28:31 -07:00' --until='2026-10-23 22:28:31 -07:00' --full-history --no-merges -- src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/FileDependencySerializer.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/main/java/com/google/devtools/build/lib/sandbox/SandboxStash.java src/main/java/com/google/devtools/build/lib/sandbox/SandboxStash.java:116 — src/main/java/com/google/devtools/build/lib/sandbox/SandboxStash.java changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in SandboxStash.takeStashedSandboxInternal at line 116. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:28:31 -07:00' --until='2026-10-23 22:28:31 -07:00' --full-history --no-merges -- src/main/java/com/google/devtools/build/lib/sandbox/SandboxStash.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/main/java/com/google/devtools/build/lib/skyframe/BzlLoadFunction.java src/main/java/com/google/devtools/build/lib/skyframe/BzlLoadFunction.java:757 — src/main/java/com/google/devtools/build/lib/skyframe/BzlLoadFunction.java changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in BzlLoadFunction.computeInternalWithCompiledBzl at line 757. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:28:31 -07:00' --until='2026-10-23 22:28:31 -07:00' --full-history --no-merges -- src/main/java/com/google/devtools/build/lib/skyframe/BzlLoadFunction.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/main/java/com/google/devtools/build/lib/skyframe/BzlCompileFunction.java src/main/java/com/google/devtools/build/lib/skyframe/BzlCompileFunction.java:108 — src/main/java/com/google/devtools/build/lib/skyframe/BzlCompileFunction.java changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in BzlCompileFunction.computeInline at line 108. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:28:31 -07:00' --until='2026-10-23 22:28:31 -07:00' --full-history --no-merges -- src/main/java/com/google/devtools/build/lib/skyframe/BzlCompileFunction.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java:1752 — src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in SkyframeActionExecutor.checkOutputs at line 1752. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:28:31 -07:00' --until='2026-10-23 22:28:31 -07:00' --full-history --no-merges -- src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/main/java/com/google/devtools/build/lib/bazel/commands/ModCommand.java src/main/java/com/google/devtools/build/lib/bazel/commands/ModCommand.java:217 — src/main/java/com/google/devtools/build/lib/bazel/commands/ModCommand.java changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 60 in ModCommand.execInternal at line 217. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:28:31 -07:00' --until='2026-10-23 22:28:31 -07:00' --full-history --no-merges -- src/main/java/com/google/devtools/build/lib/bazel/commands/ModCommand.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java:669 — src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in ActionExecutionFunction.checkCacheAndExecuteIfNeeded at line 669. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:28:31 -07:00' --until='2026-10-23 22:28:31 -07:00' --full-history --no-merges -- src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/main/java/com/google/devtools/build/skyframe/AbstractParallelEvaluator.java src/main/java/com/google/devtools/build/skyframe/AbstractParallelEvaluator.java:418 — src/main/java/com/google/devtools/build/skyframe/AbstractParallelEvaluator.java changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in Evaluate.runCore at line 418. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:28:31 -07:00' --until='2026-10-23 22:28:31 -07:00' --full-history --no-merges -- src/main/java/com/google/devtools/build/skyframe/AbstractParallelEvaluator.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/main/java/com/google/devtools/build/lib/analysis/BuildView.java src/main/java/com/google/devtools/build/lib/analysis/BuildView.java:224 — src/main/java/com/google/devtools/build/lib/analysis/BuildView.java changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in BuildView.update at line 224. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 22:28:31 -07:00' --until='2026-10-23 22:28:31 -07:00' --full-history --no-merges -- src/main/java/com/google/devtools/build/lib/analysis/BuildView.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • + 31 more in this group — see findings.md.
D6 · Cohesion (LCOM4) · Low cohesion · ×31
  • Low cohesion: Builder (LCOM4 16) src/main/java/com/google/devtools/build/lib/actions/SpawnResult.java:620 — Builder's methods fall into 16 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 16 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: Builder (LCOM4 11) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkCustomCommandLine.java:729 — Builder's methods fall into 11 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 11 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: Builder (LCOM4 9) src/main/java/com/google/devtools/build/lib/skyframe/packages/AbstractPackageLoader.java:163 — Builder's methods fall into 9 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 9 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: CppConfiguration (LCOM4 9) src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java:52 — CppConfiguration's methods fall into 9 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 9 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: ArchiveRepoSpecBuilder (LCOM4 9) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/ArchiveRepoSpecBuilder.java:33 — ArchiveRepoSpecBuilder's methods fall into 9 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 9 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: ServerBuilder (LCOM4 8) src/main/java/com/google/devtools/build/lib/runtime/ServerBuilder.java:30 — ServerBuilder'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: JavaStarlarkCommon (LCOM4 8) src/main/java/com/google/devtools/build/lib/rules/java/JavaStarlarkCommon.java:63 — JavaStarlarkCommon'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: ModuleAttribute (LCOM4 7) third_party/java/proguard/proguard6.2.2/src/proguard/classfile/attribute/module/ModuleAttribute.java:34 — ModuleAttribute's methods fall into 7 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 7 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: SubprocessBuilder (LCOM4 7) src/main/java/com/google/devtools/build/lib/shell/SubprocessBuilder.java:30 — SubprocessBuilder's methods fall into 7 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 7 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: PyBuiltins (LCOM4 7) src/main/java/com/google/devtools/build/lib/rules/python/PyBuiltins.java:57 — PyBuiltins's methods fall into 7 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 7 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: AbstractHttpHandler (LCOM4 6) src/main/java/com/google/devtools/build/lib/remote/http/AbstractHttpHandler.java:38 — AbstractHttpHandler's methods fall into 6 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 6 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: AbstractInMemoryMemoizingEvaluator (LCOM4 5) src/main/java/com/google/devtools/build/skyframe/AbstractInMemoryMemoizingEvaluator.java:64 — AbstractInMemoryMemoizingEvaluator'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.
  • Low cohesion: Builder (LCOM4 5) src/main/java/com/google/devtools/build/lib/skyframe/serialization/ObjectCodecRegistry.java:418 — Builder'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.
  • Low cohesion: RemoteExecutionCache (LCOM4 5) src/main/java/com/google/devtools/build/lib/remote/RemoteExecutionCache.java:75 — RemoteExecutionCache'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.
  • Low cohesion: AbstractBuilder (LCOM4 5) src/main/java/com/google/devtools/build/lib/packages/Package.java:770 — AbstractBuilder'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.
  • Low cohesion: TestStrategy (LCOM4 5) src/main/java/com/google/devtools/build/lib/analysis/test/TestStrategy.java:73 — TestStrategy'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.
  • Low cohesion: Builder (LCOM4 5) src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java:1458 — Builder'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.
  • Low cohesion: Builder (LCOM4 5) src/main/java/com/google/devtools/build/lib/analysis/ConfiguredRuleClassProvider.java:140 — Builder'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.
  • Low cohesion: ProgramClass (LCOM4 4) third_party/java/proguard/proguard6.2.2/src/proguard/classfile/ProgramClass.java:35 — ProgramClass's methods fall into 4 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 4 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: TypeTable (LCOM4 4) src/main/java/net/starlark/java/syntax/TypeTable.java:37 — TypeTable's methods fall into 4 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 4 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: CcToolchainFeatures (LCOM4 4) src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainFeatures.java:84 — CcToolchainFeatures's methods fall into 4 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 4 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: ByteStreamBuildEventArtifactUploader (LCOM4 4) src/main/java/com/google/devtools/build/lib/remote/ByteStreamBuildEventArtifactUploader.java:66 — ByteStreamBuildEventArtifactUploader's methods fall into 4 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 4 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: PathLabelVisitor (LCOM4 4) src/main/java/com/google/devtools/build/lib/query2/query/PathLabelVisitor.java:50 — PathLabelVisitor's methods fall into 4 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 4 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: GraphlessBlazeQueryEnvironment (LCOM4 4) src/main/java/com/google/devtools/build/lib/query2/query/GraphlessBlazeQueryEnvironment.java:80 — GraphlessBlazeQueryEnvironment's methods fall into 4 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 4 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: AbstractBlazeQueryEnvironment (LCOM4 4) src/main/java/com/google/devtools/build/lib/query2/common/AbstractBlazeQueryEnvironment.java:81 — AbstractBlazeQueryEnvironment's methods fall into 4 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 4 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.
  • + 6 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×25
  • Duplicated block (9 lines × 2) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/BazelModTidyFunction.java:97 — src/main/java/com/google/devtools/build/lib/bazel/bzlmod/BazelModTidyFunction.java:97-105 | src/main/java/com/google/devtools/build/lib/bazel/bzlmod/BazelModuleInspectorFunction.java:199-209 — 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 `src/main/java/com/google/devtools/build/lib/bazel/bzlmod/BazelModTidyFunction.java:97` 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 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) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleFileGlobals.java:730 — src/main/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleFileGlobals.java:730-738 | src/main/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleFileGlobals.java:790-798 — 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 `src/main/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleFileGlobals.java:730` 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 (9 lines × 2) src/main/java/com/google/devtools/build/lib/bazel/commands/VendorCommand.java:243 — src/main/java/com/google/devtools/build/lib/bazel/commands/VendorCommand.java:243-251 | src/main/java/com/google/devtools/build/lib/bazel/commands/VendorCommand.java:336-344 — 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.
  • Duplicated block (9 lines × 2) src/main/java/com/google/devtools/build/lib/collect/compacthashmap/CompactHashMap.java:291 — src/main/java/com/google/devtools/build/lib/collect/compacthashmap/CompactHashMap.java:291-299 | src/main/java/com/google/devtools/build/lib/collect/compacthashset/CompactHashSet.java:275-283 — `src/main/java/com/google/devtools/build/lib/collect/compacthashmap/CompactHashMap.java` and `src/main/java/com/google/devtools/build/lib/collect/compacthashset/CompactHashSet.java` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 79 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/google/devtools/build/lib/collect/compacthashmap/CompactHashMap.java:291` 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 (9 lines × 2) src/main/java/com/google/devtools/build/lib/rules/java/JavaStarlarkCommon.java:163 — src/main/java/com/google/devtools/build/lib/rules/java/JavaStarlarkCommon.java:163-171 | src/main/java/com/google/devtools/build/lib/rules/java/JavaStarlarkCommon.java:259-267 — 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 (9 lines × 2) src/main/java/com/google/devtools/build/lib/sandbox/DarwinSandboxedSpawnRunner.java:206 — src/main/java/com/google/devtools/build/lib/sandbox/DarwinSandboxedSpawnRunner.java:206-215 | src/main/java/com/google/devtools/build/lib/sandbox/ProcessWrapperSandboxedSpawnRunner.java:79-87 — 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) src/main/java/com/google/devtools/build/lib/sandbox/SandboxHelpers.java:347 — src/main/java/com/google/devtools/build/lib/sandbox/SandboxHelpers.java:347-355 | src/main/java/com/google/devtools/build/lib/sandbox/SandboxHelpers.java:370-378 — 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 (9 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/DependencyResolver.java:598 — src/main/java/com/google/devtools/build/lib/skyframe/DependencyResolver.java:598-606 | src/main/java/com/google/devtools/build/lib/skyframe/DependencyResolver.java:617-625 — 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 `src/main/java/com/google/devtools/build/lib/skyframe/DependencyResolver.java:598` 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 (9 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/FileDependencyDeserializer.java:630 — src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/FileDependencyDeserializer.java:630-638 | src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/FileDependencyDeserializer.java:642-650 — 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 `src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/FileDependencyDeserializer.java:630` 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 (9 lines × 2) src/main/java/com/google/devtools/build/lib/util/VarInt.java:66 — src/main/java/com/google/devtools/build/lib/util/VarInt.java:66-74 | src/main/java/com/google/devtools/build/lib/util/VarInt.java:155-163 — 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 `src/main/java/com/google/devtools/build/lib/util/VarInt.java:66` 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 (9 lines × 2) src/main/java/com/google/devtools/build/lib/vfs/PathFragment.java:592 — src/main/java/com/google/devtools/build/lib/vfs/PathFragment.java:592-600 | src/main/java/com/google/devtools/build/lib/vfs/PathFragment.java:653-661 — 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 (9 lines × 2) src/main/java/com/google/devtools/build/lib/vfs/UnixOsPathPolicy.java:76 — src/main/java/com/google/devtools/build/lib/vfs/UnixOsPathPolicy.java:76-84 | src/main/java/com/google/devtools/build/lib/vfs/WindowsOsPathPolicy.java:171-179 — 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 `src/main/java/com/google/devtools/build/lib/vfs/UnixOsPathPolicy.java:76` 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) src/main/java/com/google/devtools/build/skyframe/SkyFunctionException.java:117 — src/main/java/com/google/devtools/build/skyframe/SkyFunctionException.java:117-125 | src/main/java/com/google/devtools/build/skyframe/state/EnvironmentForUtilities.java:96-104 — 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 (9 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/BzlLoadCycleReporter.java:54 — src/main/java/com/google/devtools/build/lib/skyframe/BzlLoadCycleReporter.java:54-62 | src/main/java/com/google/devtools/build/lib/skyframe/BzlmodRepoCycleReporter.java:87-95 — 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 `src/main/java/com/google/devtools/build/lib/skyframe/BzlLoadCycleReporter.java:54` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (9 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/serialization/autocodec/AutoCodecProcessor.java:85 — src/main/java/com/google/devtools/build/lib/skyframe/serialization/autocodec/AutoCodecProcessor.java:85-93 | src/main/java/com/google/devtools/build/lib/skyframe/serialization/autocodec/SerializationConstantProcessor.java:53-61 — 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) src/main/java/com/google/devtools/build/lib/skyframe/serialization/autocodec/DeferredObjectCodecFieldGenerators.java:259 — src/main/java/com/google/devtools/build/lib/skyframe/serialization/autocodec/DeferredObjectCodecFieldGenerators.java:259-267 | src/main/java/com/google/devtools/build/lib/skyframe/serialization/autocodec/InterningObjectCodecFieldGenerators.java:146-154 — 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) src/main/java/com/google/devtools/build/lib/unix/UnixFileSystem.java:405 — src/main/java/com/google/devtools/build/lib/unix/UnixFileSystem.java:405-413 | src/main/java/com/google/devtools/build/lib/vfs/JavaIoFileSystem.java:418-426 — 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 (9 lines × 2) src/main/java/net/starlark/java/eval/ImmutableSingletonStarlarkList.java:74 — src/main/java/net/starlark/java/eval/ImmutableSingletonStarlarkList.java:74-82 | src/main/java/net/starlark/java/eval/SingletonTuple.java:91-99 — 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) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttributeTransitionProvider.java:178 — src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttributeTransitionProvider.java:178-186 | src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleTransitionProvider.java:256-264 — 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) src/main/java/com/google/devtools/build/lib/bazel/BazelFileSystemModule.java:56 — src/main/java/com/google/devtools/build/lib/bazel/BazelFileSystemModule.java:56-64 | src/main/java/com/google/devtools/build/lib/profiler/memory/AllocationTrackerModule.java:70-78 — 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 `src/main/java/com/google/devtools/build/lib/bazel/BazelFileSystemModule.java:56` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (9 lines × 2) src/main/java/com/google/devtools/build/lib/exec/CompactSpawnLogContext.java:103 — src/main/java/com/google/devtools/build/lib/exec/CompactSpawnLogContext.java:103-111 | src/main/java/com/google/devtools/build/lib/skyframe/TreeArtifactValue.java:529-537 — 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 (9 lines × 2) src/main/java/com/google/devtools/build/lib/exec/SpawnStrategyRegistry.java:752 — src/main/java/com/google/devtools/build/lib/exec/SpawnStrategyRegistry.java:752-760 | src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java:1377-1385 — 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 `src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java:1377` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. 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: `Code` names `com.google.devtools.build.lib.server.FailureDetails.ExecutionOptions.Code` in one and `com.google.devtools.build.lib.server.FailureDetails.RemoteExecution.Code` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 2) src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainProvider.java:144 — src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainProvider.java:144-152 | src/main/java/com/google/devtools/build/lib/rules/java/JavaToolchainProvider.java:336-344 — 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 (9 lines × 2) src/main/java/com/google/devtools/build/lib/runtime/commands/info/GcCountInfoItem.java:32 — src/main/java/com/google/devtools/build/lib/runtime/commands/info/GcCountInfoItem.java:32-40 | src/main/java/com/google/devtools/build/lib/runtime/commands/info/GcTimeInfoItem.java:32-40 — 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 `src/main/java/com/google/devtools/build/lib/runtime/commands/info/GcCountInfoItem.java:32` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. 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) src/main/java/net/starlark/java/syntax/CastExpression.java:70 — src/main/java/net/starlark/java/syntax/CastExpression.java:70-78 | src/main/java/net/starlark/java/syntax/IsInstanceExpression.java:52-60 — 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.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×23
  • Duplicated block (7 lines × 2) src/main/java/com/google/devtools/build/lib/actions/cache/CompactPersistentActionCache.java:1020 — src/main/java/com/google/devtools/build/lib/actions/cache/CompactPersistentActionCache.java:1020-1026 | src/main/java/com/google/devtools/build/lib/actions/cache/CompactPersistentActionCache.java:1107-1113 — 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 `src/main/java/com/google/devtools/build/lib/actions/cache/CompactPersistentActionCache.java:1020` 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 (7 lines × 2) src/main/java/com/google/devtools/build/lib/query2/PostAnalysisQueryEnvironment.java:437 — src/main/java/com/google/devtools/build/lib/query2/PostAnalysisQueryEnvironment.java:437-443 | src/main/java/com/google/devtools/build/lib/query2/PostAnalysisQueryEnvironment.java:476-482 — 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) src/main/java/com/google/devtools/build/lib/runtime/BlazeOptionHandler.java:784 — src/main/java/com/google/devtools/build/lib/runtime/BlazeOptionHandler.java:784-792 | src/main/java/com/google/devtools/build/lib/runtime/BlazeOptionHandler.java:805-811 — 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) src/main/java/com/google/devtools/build/lib/runtime/commands/AqueryCommand.java:125 — src/main/java/com/google/devtools/build/lib/runtime/commands/AqueryCommand.java:125-131 | src/main/java/com/google/devtools/build/lib/runtime/commands/CqueryCommand.java:160-166 — before extracting anything, compare `src/main/java/com/google/devtools/build/lib/runtime/commands/AqueryCommand.java` and `src/main/java/com/google/devtools/build/lib/runtime/commands/CqueryCommand.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/google/devtools/build/lib/runtime/commands/AqueryCommand.java:125` 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. Note first that the copies are not typed on the same thing: `Code` names `com.google.devtools.build.lib.server.FailureDetails.ActionQuery.Code` in one and `com.google.devtools.build.lib.server.FailureDetails.ConfigurableQuery.Code` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (7 lines × 2) src/main/java/com/google/devtools/build/lib/server/CommandServer.java:610 — src/main/java/com/google/devtools/build/lib/server/CommandServer.java:610-616 | src/main/java/com/google/devtools/build/lib/server/CommandServer.java:634-640 — 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 `src/main/java/com/google/devtools/build/lib/server/CommandServer.java:610` 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) src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredExecutionPlatformsFunction.java:168 — src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredExecutionPlatformsFunction.java:168-174 | src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredToolchainsFunction.java:157-163 — before extracting anything, compare `src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredExecutionPlatformsFunction.java` and `src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredToolchainsFunction.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredExecutionPlatformsFunction.java:168` 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 (7 lines × 2) src/main/java/com/google/devtools/build/docgen/BuildEncyclopediaGenerator.java:42 — src/main/java/com/google/devtools/build/docgen/BuildEncyclopediaGenerator.java:42-48 | src/main/java/com/google/devtools/build/docgen/StarlarkDocumentationGenerator.java:35-41 — 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 (7 lines × 2) src/main/java/com/google/devtools/build/lib/analysis/BuildView.java:869 — src/main/java/com/google/devtools/build/lib/analysis/BuildView.java:869-875 | src/main/java/com/google/devtools/build/lib/skyframe/BuildDriverFunction.java:708-714 — 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 `src/main/java/com/google/devtools/build/lib/analysis/BuildView.java:869` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (7 lines × 2) src/main/java/com/google/devtools/build/lib/analysis/WorkspaceStatusAction.java:218 — src/main/java/com/google/devtools/build/lib/analysis/WorkspaceStatusAction.java:218-224 | src/main/java/com/google/devtools/build/lib/bazel/BazelWorkspaceStatusModule.java:264-270 — 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.
  • Duplicated block (7 lines × 2) src/main/java/com/google/devtools/build/lib/analysis/actions/SymlinkAction.java:475 — src/main/java/com/google/devtools/build/lib/analysis/actions/SymlinkAction.java:475-481 | src/main/java/com/google/devtools/build/lib/analysis/starlark/UnresolvedSymlinkAction.java:149-155 — 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.
  • Duplicated block (7 lines × 2) src/main/java/com/google/devtools/build/lib/bazel/SpawnLogModule.java:318 — src/main/java/com/google/devtools/build/lib/bazel/SpawnLogModule.java:318-324 | src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java:1969-1975 — 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.
  • Duplicated block (7 lines × 2) src/main/java/com/google/devtools/build/lib/buildtool/AqueryProcessor.java:266 — src/main/java/com/google/devtools/build/lib/buildtool/AqueryProcessor.java:266-272 | src/main/java/com/google/devtools/build/lib/runtime/commands/AqueryCommand.java:182-188 — 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.
  • Duplicated block (7 lines × 2) src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java:844 — src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java:844-850 | src/main/java/com/google/devtools/build/lib/skyframe/RecursivePackageProviderBackedTargetPatternResolver.java:399-405 — 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.
  • Duplicated block (7 lines × 2) src/main/java/com/google/devtools/build/lib/query2/query/BlazeQueryEnvironment.java:463 — src/main/java/com/google/devtools/build/lib/query2/query/BlazeQueryEnvironment.java:463-469 | src/main/java/com/google/devtools/build/lib/query2/query/GraphlessBlazeQueryEnvironment.java:473-479 — before extracting anything, compare `src/main/java/com/google/devtools/build/lib/query2/query/BlazeQueryEnvironment.java` and `src/main/java/com/google/devtools/build/lib/query2/query/GraphlessBlazeQueryEnvironment.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 (7 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetFunction.java:617 — src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetFunction.java:617-623 | src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredValueCreationException.java:109-115 — 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 (7 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/serialization/ImmutableSetCodec.java:78 — src/main/java/com/google/devtools/build/lib/skyframe/serialization/ImmutableSetCodec.java:78-84 | src/main/java/com/google/devtools/build/lib/skyframe/serialization/TransformingRandomAccessListCodec.java:54-60 — 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 (7 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredExecutionPlatformsValue.java:93 — src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredExecutionPlatformsValue.java:93-99 | src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredToolchainsValue.java:102-108 — 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 (7 lines × 2) src/main/java/com/google/devtools/build/lib/worker/WorkerMultiplexerManager.java:128 — src/main/java/com/google/devtools/build/lib/worker/WorkerMultiplexerManager.java:128-134 | src/main/java/com/google/devtools/build/lib/worker/WorkerSpawnRunner.java:709-715 — 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 (7 lines × 2) src/main/java/com/google/devtools/build/lib/actions/Artifact.java:1334 — src/main/java/com/google/devtools/build/lib/actions/Artifact.java:1334-1340 | src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkCustomCommandLine.java:1586-1592 — 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 (7 lines × 2) src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java:1026 — src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java:1026-1032 | src/main/java/com/google/devtools/build/lib/query2/query/GraphlessBlazeQueryEnvironment.java:176-182 — 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 (7 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/serialization/ImmutableBiMapCodec.java:91 — src/main/java/com/google/devtools/build/lib/skyframe/serialization/ImmutableBiMapCodec.java:91-97 | src/main/java/com/google/devtools/build/lib/skyframe/serialization/ImmutableMapCodecs.java:157-163 — 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 (7 lines × 2) src/main/java/net/starlark/java/eval/StarlarkList.java:258 — src/main/java/net/starlark/java/eval/StarlarkList.java:258-265 | src/main/java/net/starlark/java/eval/Tuple.java:139-145 — 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 (7 lines × 2) src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java:1226 — src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java:1226-1232 | src/main/java/com/google/devtools/build/lib/skyframe/GraphBackedRecursivePackageProvider.java:186-192 — 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.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×20
  • Duplicated block (8 lines × 2) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkActionFactory.java:977 — src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkActionFactory.java:977-984 | src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkActionFactory.java:1078-1085 — 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 `src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkActionFactory.java:977` 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 (8 lines × 2) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleFileFunction.java:491 — src/main/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleFileFunction.java:491-500 | src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryUtils.java:58-65 — 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 `src/main/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleFileFunction.java:491` 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 (8 lines × 2) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/modcommand/ModExecutor.java:462 — src/main/java/com/google/devtools/build/lib/bazel/bzlmod/modcommand/ModExecutor.java:462-469 | src/main/java/com/google/devtools/build/lib/bazel/bzlmod/modcommand/ModExecutor.java:503-510 — 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 `src/main/java/com/google/devtools/build/lib/bazel/bzlmod/modcommand/ModExecutor.java:462` 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 (8 lines × 2) src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryOptions.java:560 — src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryOptions.java:560-567 | src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryOptions.java:593-600 — 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 `src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryOptions.java:560` 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 (8 lines × 2) src/main/java/com/google/devtools/build/lib/buildtool/BuildResultPrinter.java:449 — src/main/java/com/google/devtools/build/lib/buildtool/BuildResultPrinter.java:449-456 | src/main/java/com/google/devtools/build/lib/buildtool/BuildResultPrinter.java:459-466 — 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 (8 lines × 2) src/main/java/com/google/devtools/build/lib/platform/SystemLoadAdvisoryModule.java:89 — src/main/java/com/google/devtools/build/lib/platform/SystemLoadAdvisoryModule.java:89-96 | src/main/java/com/google/devtools/build/lib/platform/SystemThermalModule.java:93-100 — 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 `src/main/java/com/google/devtools/build/lib/platform/SystemLoadAdvisoryModule.java:89` 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 (8 lines × 2) src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java:786 — src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java:786-793 | src/main/java/com/google/devtools/build/lib/query2/engine/AllPathsFunction.java:124-131 — 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. 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 (8 lines × 2) src/main/java/com/google/devtools/build/lib/remote/RemoteGrpcServiceConfig.java:100 — src/main/java/com/google/devtools/build/lib/remote/RemoteGrpcServiceConfig.java:100-107 | src/main/java/com/google/devtools/build/lib/remote/RemoteGrpcServiceConfig.java:121-128 — 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 `src/main/java/com/google/devtools/build/lib/remote/RemoteGrpcServiceConfig.java:100` 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 (8 lines × 2) src/main/java/com/google/devtools/build/lib/rules/config/ConfigGlobalLibrary.java:54 — src/main/java/com/google/devtools/build/lib/rules/config/ConfigGlobalLibrary.java:54-61 | src/main/java/com/google/devtools/build/lib/rules/config/ConfigGlobalLibrary.java:92-99 — 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 `src/main/java/com/google/devtools/build/lib/rules/config/ConfigGlobalLibrary.java:54` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/main/java/com/google/devtools/build/lib/rules/config/ConfigGlobalLibrary.java:90` calls `failIfCalledOutsideBuiltins` and `src/main/java/com/google/devtools/build/lib/rules/config/ConfigGlobalLibrary.java:53` 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) src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java:681 — src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java:681-688 | src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java:2034-2041 — 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 `src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java:681` 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 (8 lines × 2) src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java:1625 — src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java:1625-1632 | src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java:1833-1841 — 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 `src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java:1625` 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 (8 lines × 2) src/main/java/com/google/devtools/build/lib/rules/java/JavaRuntimeInfo.java:106 — src/main/java/com/google/devtools/build/lib/rules/java/JavaRuntimeInfo.java:106-113 | src/main/java/com/google/devtools/build/lib/rules/java/JavaToolchainProvider.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 `src/main/java/com/google/devtools/build/lib/rules/java/JavaRuntimeInfo.java:106` 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.
  • Duplicated block (8 lines × 2) src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommandLine.java:257 — src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommandLine.java:257-264 | src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommandLine.java:322-329 — 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 (8 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java:2935 — src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java:2935-2942 | src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java:2977-2985 — 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 `src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java:2935` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java:2986` calls `throwIfInstanceOf` and `src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java:2943` 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) src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/FileDependencyDeserializer.java:292 — src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/FileDependencyDeserializer.java:292-299 | src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/FileDependencyDeserializer.java:548-555 — 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.
  • Duplicated block (8 lines × 2) src/main/java/com/google/devtools/common/options/InvocationPolicyEnforcer.java:839 — src/main/java/com/google/devtools/common/options/InvocationPolicyEnforcer.java:839-847 | src/main/java/com/google/devtools/common/options/InvocationPolicyEnforcer.java:911-918 — 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 `src/main/java/com/google/devtools/common/options/InvocationPolicyEnforcer.java:839` 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 (8 lines × 2) src/main/java/net/starlark/java/lib/json/Json.java:629 — src/main/java/net/starlark/java/lib/json/Json.java:629-636 | src/main/java/net/starlark/java/lib/json/Json.java:809-816 — 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 (8 lines × 2) src/main/java/com/google/devtools/build/lib/analysis/producers/TargetAndConfigurationProducer.java:345 — src/main/java/com/google/devtools/build/lib/analysis/producers/TargetAndConfigurationProducer.java:345-352 | src/main/java/com/google/devtools/build/lib/skyframe/toolchains/ToolchainException.java:98-105 — 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.
  • Duplicated block (8 lines × 2) src/main/java/com/google/devtools/build/lib/packages/NoSuchPackageException.java:82 — src/main/java/com/google/devtools/build/lib/packages/NoSuchPackageException.java:82-89 | src/main/java/com/google/devtools/build/lib/packages/NoSuchPackagePieceException.java:82-90 — 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 (8 lines × 2) src/main/java/net/starlark/java/syntax/CallExpression.java:97 — src/main/java/net/starlark/java/syntax/CallExpression.java:97-104 | src/main/java/net/starlark/java/syntax/TypeApplication.java:59-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 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.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×17
  • Duplicated block (11 lines × 2) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/VendorFileFunction.java:162 — src/main/java/com/google/devtools/build/lib/bazel/bzlmod/VendorFileFunction.java:162-172 | src/main/java/com/google/devtools/build/lib/skyframe/RepoFileFunction.java:119-129 — 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 `src/main/java/com/google/devtools/build/lib/bazel/bzlmod/VendorFileFunction.java:162` 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 (11 lines × 2) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/modcommand/ModExecutor.java:131 — src/main/java/com/google/devtools/build/lib/bazel/bzlmod/modcommand/ModExecutor.java:131-141 | src/main/java/com/google/devtools/build/lib/bazel/bzlmod/modcommand/ModExecutor.java:154-164 — 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.
  • Duplicated block (11 lines × 2) src/main/java/com/google/devtools/build/lib/bazel/commands/ModCommand.java:644 — src/main/java/com/google/devtools/build/lib/bazel/commands/ModCommand.java:644-654 | src/main/java/com/google/devtools/build/lib/bazel/commands/ModCommand.java:771-781 — 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 `src/main/java/com/google/devtools/build/lib/bazel/commands/ModCommand.java:644` 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.
  • Duplicated block (11 lines × 2) src/main/java/com/google/devtools/build/lib/bazel/repository/decompressor/PatchUtil.java:641 — src/main/java/com/google/devtools/build/lib/bazel/repository/decompressor/PatchUtil.java:641-651 | src/main/java/com/google/devtools/build/lib/bazel/repository/decompressor/PatchUtil.java:653-663 — 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 `src/main/java/com/google/devtools/build/lib/bazel/repository/decompressor/PatchUtil.java:641` 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) src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/HashInputStream.java:83 — src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/HashInputStream.java:83-93 | src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/HashOutputStream.java:81-91 — 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 (11 lines × 2) src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkBaseExternalContext.java:812 — src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkBaseExternalContext.java:812-822 | src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkBaseExternalContext.java:1081-1091 — 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 (11 lines × 2) src/main/java/com/google/devtools/build/lib/collect/compacthashmap/CompactHashMap.java:321 — src/main/java/com/google/devtools/build/lib/collect/compacthashmap/CompactHashMap.java:321-331 | src/main/java/com/google/devtools/build/lib/collect/compacthashset/CompactHashSet.java:305-315 — `src/main/java/com/google/devtools/build/lib/collect/compacthashmap/CompactHashMap.java` and `src/main/java/com/google/devtools/build/lib/collect/compacthashset/CompactHashSet.java` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 79 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/main/java/com/google/devtools/build/lib/collect/compacthashmap/CompactHashMap.java:339` calls `copyOf` and `src/main/java/com/google/devtools/build/lib/collect/compacthashset/CompactHashSet.java:323` 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 (11 lines × 2) src/main/java/com/google/devtools/build/lib/remote/BazelOutputService.java:144 — src/main/java/com/google/devtools/build/lib/remote/BazelOutputService.java:144-154 | src/main/java/com/google/devtools/build/lib/remote/RemoteOutputService.java:137-147 — 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 `src/main/java/com/google/devtools/build/lib/remote/BazelOutputService.java:144` 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) src/main/java/com/google/devtools/build/lib/rules/cpp/SolibSymlinkAction.java:82 — src/main/java/com/google/devtools/build/lib/rules/cpp/SolibSymlinkAction.java:82-92 | src/main/java/com/google/devtools/build/lib/rules/cpp/SolibSymlinkAction.java:102-112 — 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 `src/main/java/com/google/devtools/build/lib/rules/cpp/SolibSymlinkAction.java:82` 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) src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileActionBuilder.java:309 — src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileActionBuilder.java:309-319 | src/main/java/com/google/devtools/build/lib/rules/java/JavaHeaderCompileAction.java:544-554 — 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, `src/main/java/com/google/devtools/build/lib/rules/java/JavaHeaderCompileAction.java:542` calls `add` and `src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileActionBuilder.java:308` 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 (11 lines × 2) src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java:689 — src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java:689-699 | src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java:727-737 — 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 `src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java:689` 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 (11 lines × 2) src/main/java/com/google/devtools/build/lib/sandbox/AbstractContainerizingSandboxedSpawn.java:173 — src/main/java/com/google/devtools/build/lib/sandbox/AbstractContainerizingSandboxedSpawn.java:173-183 | src/main/java/com/google/devtools/build/lib/worker/WorkerExecRoot.java:118-128 — 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 `src/main/java/com/google/devtools/build/lib/sandbox/AbstractContainerizingSandboxedSpawn.java:173` 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) src/main/java/com/google/devtools/build/lib/skyframe/serialization/MapHelpers.java:71 — src/main/java/com/google/devtools/build/lib/skyframe/serialization/MapHelpers.java:71-81 | src/main/java/com/google/devtools/build/lib/skyframe/serialization/MapHelpers.java:106-116 — 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 `src/main/java/com/google/devtools/build/lib/skyframe/serialization/MapHelpers.java:71` 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) src/tools/execlog/src/main/java/com/google/devtools/build/execlog/ExecLogParser.java:222 — src/tools/execlog/src/main/java/com/google/devtools/build/execlog/ExecLogParser.java:222-232 | src/tools/workspacelog/src/main/java/com/google/devtools/build/workspacelog/WorkspaceLogParser.java:83-93 — 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 (11 lines × 2) src/main/java/com/google/devtools/build/lib/bazel/commands/FetchCommand.java:247 — src/main/java/com/google/devtools/build/lib/bazel/commands/FetchCommand.java:247-257 | src/main/java/com/google/devtools/build/lib/bazel/commands/VendorCommand.java:490-500 — before extracting anything, compare `src/main/java/com/google/devtools/build/lib/bazel/commands/FetchCommand.java` and `src/main/java/com/google/devtools/build/lib/bazel/commands/VendorCommand.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/google/devtools/build/lib/bazel/commands/FetchCommand.java:247` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. 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 (11 lines × 2) src/main/java/net/starlark/java/eval/MutableStarlarkList.java:51 — src/main/java/net/starlark/java/eval/MutableStarlarkList.java:51-61 | src/main/java/net/starlark/java/eval/StarlarkSet.java:204-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 (11 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/FileOpMatchMemoizingLookup.java:61 — src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/FileOpMatchMemoizingLookup.java:61-71 | src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/NestedMatchMemoizingLookup.java:65-75 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `key` to `FileOpDependency` in one and `NestedDependencies` 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 (10 lines × 2) · ×17
  • Duplicated block (10 lines × 2) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkCustomCommandLine.java:1066 — src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkCustomCommandLine.java:1066-1075 | src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkCustomCommandLine.java:1222-1231 — 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 `src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkCustomCommandLine.java:1066` 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 (10 lines × 2) src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkBaseExternalContext.java:1526 — src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkBaseExternalContext.java:1526-1535 | src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkRepositoryContext.java:352-361 — 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 `src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkBaseExternalContext.java:1526` 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.
  • Duplicated block (10 lines × 2) src/main/java/com/google/devtools/build/lib/exec/local/LocalSpawnRunner.java:142 — src/main/java/com/google/devtools/build/lib/exec/local/LocalSpawnRunner.java:142-151 | src/main/java/com/google/devtools/build/lib/sandbox/AbstractSandboxSpawnRunner.java:122-131 — 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 `src/main/java/com/google/devtools/build/lib/exec/local/LocalSpawnRunner.java:142` 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 (10 lines × 2) src/main/java/com/google/devtools/build/lib/exec/local/PosixLocalEnvProvider.java:49 — src/main/java/com/google/devtools/build/lib/exec/local/PosixLocalEnvProvider.java:49-58 | src/main/java/com/google/devtools/build/lib/exec/local/XcodeLocalEnvProvider.java:75-84 — 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 (10 lines × 2) src/main/java/com/google/devtools/build/lib/profiler/ThreadMetadata.java:148 — src/main/java/com/google/devtools/build/lib/profiler/ThreadMetadata.java:148-157 | src/main/java/com/google/devtools/build/lib/profiler/ThreadMetadata.java:163-172 — 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) src/main/java/com/google/devtools/build/lib/query2/aquery/ActionGraphQueryEnvironment.java:447 — src/main/java/com/google/devtools/build/lib/query2/aquery/ActionGraphQueryEnvironment.java:447-456 | src/main/java/com/google/devtools/build/lib/query2/cquery/ConfiguredTargetQueryEnvironment.java:285-294 — before extracting anything, compare `src/main/java/com/google/devtools/build/lib/query2/aquery/ActionGraphQueryEnvironment.java` and `src/main/java/com/google/devtools/build/lib/query2/cquery/ConfiguredTargetQueryEnvironment.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/google/devtools/build/lib/query2/aquery/ActionGraphQueryEnvironment.java:447` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `callback` to `Callback<ConfiguredTargetValue>` in one and `Callback<CqueryNode>` 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 (10 lines × 2) src/main/java/com/google/devtools/build/lib/query2/query/aspectresolvers/ConservativeAspectResolver.java:49 — src/main/java/com/google/devtools/build/lib/query2/query/aspectresolvers/ConservativeAspectResolver.java:49-58 | src/main/java/com/google/devtools/build/lib/query2/query/aspectresolvers/PreciseAspectResolver.java:70-79 — 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 `src/main/java/com/google/devtools/build/lib/query2/query/aspectresolvers/ConservativeAspectResolver.java:49` 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 (10 lines × 2) src/main/java/com/google/devtools/build/lib/remote/BazelOutputService.java:244 — src/main/java/com/google/devtools/build/lib/remote/BazelOutputService.java:244-253 | src/main/java/com/google/devtools/build/lib/remote/BazelOutputService.java:378-387 — 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 `src/main/java/com/google/devtools/build/lib/remote/BazelOutputService.java:244` 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. 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.
  • Duplicated block (10 lines × 2) src/main/java/com/google/devtools/build/lib/remote/BazelOutputService.java:343 — src/main/java/com/google/devtools/build/lib/remote/BazelOutputService.java:343-352 | src/main/java/com/google/devtools/build/lib/remote/BazelOutputService.java:417-426 — 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 `src/main/java/com/google/devtools/build/lib/remote/BazelOutputService.java:343` 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 (10 lines × 2) src/main/java/com/google/devtools/build/lib/remote/RemoteExternalOverlayFileSystem.java:305 — src/main/java/com/google/devtools/build/lib/remote/RemoteExternalOverlayFileSystem.java:305-314 | src/main/java/com/google/devtools/build/lib/remote/RemoteExternalOverlayFileSystem.java:335-344 — 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) src/main/java/com/google/devtools/build/lib/runtime/GcChurningDetector.java:138 — src/main/java/com/google/devtools/build/lib/runtime/GcChurningDetector.java:138-147 | src/main/java/com/google/devtools/build/lib/runtime/GcThrashingDetector.java:154-163 — 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 `src/main/java/com/google/devtools/build/lib/runtime/GcChurningDetector.java:138` 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 (10 lines × 2) src/main/java/com/google/devtools/build/lib/runtime/SkymeldUiStateTracker.java:217 — src/main/java/com/google/devtools/build/lib/runtime/SkymeldUiStateTracker.java:217-226 | src/main/java/com/google/devtools/build/lib/runtime/UiStateTracker.java:479-488 — 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 (10 lines × 2) src/main/java/com/google/devtools/build/lib/runtime/commands/HelpCommand.java:561 — src/main/java/com/google/devtools/build/lib/runtime/commands/HelpCommand.java:561-570 | src/main/java/com/google/devtools/build/lib/runtime/commands/HelpCommand.java:580-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 `src/main/java/com/google/devtools/build/lib/runtime/commands/HelpCommand.java:561` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/main/java/com/google/devtools/build/lib/runtime/commands/HelpCommand.java:579` calls `equals` and `src/main/java/com/google/devtools/build/lib/runtime/commands/HelpCommand.java:560` 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 (10 lines × 2) src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommandLine.java:182 — src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommandLine.java:182-191 | src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommandLine.java:228-237 — 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) src/main/java/net/starlark/java/annot/processor/StarlarkMethodProcessor.java:554 — src/main/java/net/starlark/java/annot/processor/StarlarkMethodProcessor.java:554-563 | src/main/java/net/starlark/java/annot/processor/StarlarkMethodProcessor.java:566-575 — 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 `src/main/java/net/starlark/java/annot/processor/StarlarkMethodProcessor.java:554` 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 (10 lines × 2) src/main/java/net/starlark/java/eval/StarlarkInt.java:503 — src/main/java/net/starlark/java/eval/StarlarkInt.java:503-512 | src/main/java/net/starlark/java/eval/StarlarkInt.java:530-539 — 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 `src/main/java/net/starlark/java/eval/StarlarkInt.java:503` 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 (10 lines × 2) src/main/java/com/google/devtools/build/lib/query2/query/BlazeQueryEnvironment.java:167 — src/main/java/com/google/devtools/build/lib/query2/query/BlazeQueryEnvironment.java:167-176 | src/main/java/com/google/devtools/build/lib/query2/query/GraphlessBlazeQueryEnvironment.java:186-195 — before extracting anything, compare `src/main/java/com/google/devtools/build/lib/query2/query/BlazeQueryEnvironment.java` and `src/main/java/com/google/devtools/build/lib/query2/query/GraphlessBlazeQueryEnvironment.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/google/devtools/build/lib/query2/query/BlazeQueryEnvironment.java:167` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×13
  • Duplicated block (6 lines × 2) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/modcommand/ModExecutor.java:303 — src/main/java/com/google/devtools/build/lib/bazel/bzlmod/modcommand/ModExecutor.java:303-308 | src/main/java/com/google/devtools/build/lib/bazel/bzlmod/modcommand/ModExecutor.java:368-373 — 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 `src/main/java/com/google/devtools/build/lib/bazel/bzlmod/modcommand/ModExecutor.java:303` 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) src/main/java/com/google/devtools/build/lib/packages/AbstractAttributeMapper.java:177 — src/main/java/com/google/devtools/build/lib/packages/AbstractAttributeMapper.java:177-184 | src/main/java/com/google/devtools/build/lib/packages/AggregatingAttributeMapper.java:95-100 — 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 `src/main/java/com/google/devtools/build/lib/packages/AbstractAttributeMapper.java:177` 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) src/main/java/com/google/devtools/build/lib/packages/BazelStarlarkEnvironment.java:546 — src/main/java/com/google/devtools/build/lib/packages/BazelStarlarkEnvironment.java:546-551 | src/main/java/com/google/devtools/build/lib/packages/BazelStarlarkEnvironment.java:581-586 — 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 `src/main/java/com/google/devtools/build/lib/packages/BazelStarlarkEnvironment.java:546` 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) src/main/java/com/google/devtools/build/lib/packages/StarlarkInfoWithSchema.java:552 — src/main/java/com/google/devtools/build/lib/packages/StarlarkInfoWithSchema.java:552-557 | src/main/java/com/google/devtools/build/lib/packages/StarlarkInfoWithSchema.java:614-619 — 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 `src/main/java/com/google/devtools/build/lib/packages/StarlarkInfoWithSchema.java:552` 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 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, `src/main/java/com/google/devtools/build/lib/packages/StarlarkInfoWithSchema.java:620` calls `equals` and `src/main/java/com/google/devtools/build/lib/packages/StarlarkInfoWithSchema.java:558` 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 (6 lines × 2) src/main/java/com/google/devtools/build/lib/remote/util/Utils.java:438 — src/main/java/com/google/devtools/build/lib/remote/util/Utils.java:438-443 | src/main/java/com/google/devtools/build/lib/remote/util/Utils.java:463-468 — 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 `src/main/java/com/google/devtools/build/lib/remote/util/Utils.java:438` 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. 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 `call` to `AsyncCallable<V>` in one and `Callable<V>` 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 (6 lines × 2) src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommandLine.java:186 — src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommandLine.java:186-191 | src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommandLine.java:259-265 — 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 `src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommandLine.java:259` 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. 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 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.
  • Duplicated block (6 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/serialization/ObjectCodecRegistry.java:123 — src/main/java/com/google/devtools/build/lib/skyframe/serialization/ObjectCodecRegistry.java:123-128 | src/main/java/com/google/devtools/build/lib/skyframe/serialization/ObjectCodecRegistry.java:135-140 — 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 (6 lines × 2) src/main/java/com/google/devtools/build/lib/util/VarInt.java:72 — src/main/java/com/google/devtools/build/lib/util/VarInt.java:72-77 | src/main/java/com/google/devtools/build/lib/util/VarInt.java:181-186 — 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 `src/main/java/com/google/devtools/build/lib/util/VarInt.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 (6 lines × 2) src/main/java/com/google/devtools/common/options/testing/OptionsTester.java:113 — src/main/java/com/google/devtools/common/options/testing/OptionsTester.java:113-118 | src/main/java/com/google/devtools/common/options/testing/OptionsTester.java:122-127 — 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 `src/main/java/com/google/devtools/common/options/testing/OptionsTester.java:113` 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 (6 lines × 2) src/main/java/net/starlark/java/syntax/TypeChecker.java:753 — src/main/java/net/starlark/java/syntax/TypeChecker.java:753-758 | src/main/java/net/starlark/java/syntax/TypeChecker.java:793-798 — 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 `src/main/java/net/starlark/java/syntax/TypeChecker.java:753` 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) src/main/java/net/starlark/java/syntax/Types.java:1985 — src/main/java/net/starlark/java/syntax/Types.java:1985-1990 | src/main/java/net/starlark/java/syntax/Types.java:2012-2017 — 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 `src/main/java/net/starlark/java/syntax/Types.java:1985` 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) src/main/java/com/google/devtools/build/lib/analysis/BuildView.java:808 — src/main/java/com/google/devtools/build/lib/analysis/BuildView.java:808-813 | src/main/java/com/google/devtools/build/lib/skyframe/SkyframeErrorProcessor.java:776-781 — 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 `src/main/java/com/google/devtools/build/lib/analysis/BuildView.java:808` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. 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: `Code` names `com.google.devtools.build.lib.server.FailureDetails.Analysis.Code` in one and `com.google.devtools.build.lib.server.FailureDetails.TargetPatterns.Code` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (6 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/ActionInputMetadataProvider.java:151 — src/main/java/com/google/devtools/build/lib/skyframe/ActionInputMetadataProvider.java:151-156 | src/main/java/com/google/devtools/build/lib/skyframe/ActionOutputMetadataStore.java:165-170 — 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.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×12
  • Duplicated block (12 lines × 2) src/main/java/com/google/devtools/build/lib/actions/MachineLoadProvider.java:49 — src/main/java/com/google/devtools/build/lib/actions/MachineLoadProvider.java:49-60 | src/main/java/com/google/devtools/build/lib/profiler/LocalResourceUsageCollectors.java:220-231 — 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 (12 lines × 2) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleFileGlobals.java:1103 — src/main/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleFileGlobals.java:1103-1114 | src/main/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleFileGlobals.java:1148-1159 — 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 `src/main/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleFileGlobals.java:1103` 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) src/main/java/com/google/devtools/build/lib/bazel/commands/FetchCommand.java:200 — src/main/java/com/google/devtools/build/lib/bazel/commands/FetchCommand.java:200-211 | src/main/java/com/google/devtools/build/lib/bazel/commands/VendorCommand.java:263-274 — before extracting anything, compare `src/main/java/com/google/devtools/build/lib/bazel/commands/FetchCommand.java` and `src/main/java/com/google/devtools/build/lib/bazel/commands/VendorCommand.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 (12 lines × 2) src/main/java/com/google/devtools/build/lib/bazel/repository/decompressor/SevenZDecompressor.java:112 — src/main/java/com/google/devtools/build/lib/bazel/repository/decompressor/SevenZDecompressor.java:112-123 | src/main/java/com/google/devtools/build/lib/bazel/repository/decompressor/ZipDecompressor.java:136-147 — 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 (12 lines × 2) src/main/java/com/google/devtools/build/lib/collect/compacthashmap/CompactHashMap.java:271 — src/main/java/com/google/devtools/build/lib/collect/compacthashmap/CompactHashMap.java:271-282 | src/main/java/com/google/devtools/build/lib/collect/compacthashset/CompactHashSet.java:260-271 — `src/main/java/com/google/devtools/build/lib/collect/compacthashmap/CompactHashMap.java` and `src/main/java/com/google/devtools/build/lib/collect/compacthashset/CompactHashSet.java` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 79 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/google/devtools/build/lib/collect/compacthashmap/CompactHashMap.java: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 (12 lines × 2) src/main/java/com/google/devtools/build/lib/collect/compacthashmap/CompactHashMap.java:350 — src/main/java/com/google/devtools/build/lib/collect/compacthashmap/CompactHashMap.java:350-361 | src/main/java/com/google/devtools/build/lib/collect/compacthashset/CompactHashSet.java:340-351 — `src/main/java/com/google/devtools/build/lib/collect/compacthashmap/CompactHashMap.java` and `src/main/java/com/google/devtools/build/lib/collect/compacthashset/CompactHashSet.java` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 79 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (12 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/GlobFunctionWithMultipleRecursiveFunctions.java:260 — src/main/java/com/google/devtools/build/lib/skyframe/GlobFunctionWithMultipleRecursiveFunctions.java:260-271 | src/main/java/com/google/devtools/build/lib/skyframe/ProcessPackageDirectory.java:105-116 — 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 (12 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/PackageLookupFunction.java:101 — src/main/java/com/google/devtools/build/lib/skyframe/PackageLookupFunction.java:101-112 | src/main/java/com/google/devtools/build/lib/skyframe/PackageLookupFunction.java:308-319 — 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.
  • Duplicated block (12 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java:534 — src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java:534-545 | src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java:1079-1090 — 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 `src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java:534` 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) src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredExecutionPlatformsFunction.java:176 — src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredExecutionPlatformsFunction.java:176-187 | src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredToolchainsFunction.java:165-176 — before extracting anything, compare `src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredExecutionPlatformsFunction.java` and `src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredToolchainsFunction.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredExecutionPlatformsFunction.java:176` 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) src/main/java/com/google/devtools/build/lib/collect/compacthashmap/CompactHashMap.java:104 — src/main/java/com/google/devtools/build/lib/collect/compacthashmap/CompactHashMap.java:104-115 | src/main/java/com/google/devtools/build/lib/collect/compacthashset/CompactHashSet.java:93-104 — `src/main/java/com/google/devtools/build/lib/collect/compacthashmap/CompactHashMap.java` and `src/main/java/com/google/devtools/build/lib/collect/compacthashset/CompactHashSet.java` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 79 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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 (12 lines × 2) src/main/java/com/google/devtools/build/lib/query2/query/BlazeQueryEnvironment.java:475 — src/main/java/com/google/devtools/build/lib/query2/query/BlazeQueryEnvironment.java:475-486 | src/main/java/com/google/devtools/build/lib/query2/query/GraphlessBlazeQueryEnvironment.java:483-494 — before extracting anything, compare `src/main/java/com/google/devtools/build/lib/query2/query/BlazeQueryEnvironment.java` and `src/main/java/com/google/devtools/build/lib/query2/query/GraphlessBlazeQueryEnvironment.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D35 · Change Coupling · Change coupling · ×11
  • Change coupling: AnalysisPhaseRunner.java ↔ FlagSetValue.java src/main/java/com/google/devtools/build/lib/buildtool/AnalysisPhaseRunner.java:1 — `src/main/java/com/google/devtools/build/lib/buildtool/AnalysisPhaseRunner.java` and `src/main/java/com/google/devtools/build/lib/skyframe/config/FlagSetValue.java` change together 76% of the time (13 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 13 shared commits counted here, the most recent 3 are `a1ddb393` PROJECT.scl: fail on unrecognized or unsupported flags.; `9c8141a4` Automated rollback of commit 6d7087bf26a945376e88d24b81e5a145841f55f0…; `6d7087bf` Automated rollback of commit 0d773a14ee24ceb9e61128067db5b6d1e6e6e5fe. — run `git show` on any of them.
  • Change coupling: Project.java ↔ FlagSetFunction.java src/main/java/com/google/devtools/build/lib/analysis/Project.java:1 — `src/main/java/com/google/devtools/build/lib/analysis/Project.java` and `src/main/java/com/google/devtools/build/lib/skyframe/config/FlagSetFunction.java` change together 67% of the time (14 of the 21 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 14 shared commits counted here, the most recent 3 are `3662bc33` Allow builds with multiple targets where one has a PROJECT.scl file a…; `a1ddb393` PROJECT.scl: fail on unrecognized or unsupported flags.; `9c8141a4` Automated rollback of commit 6d7087bf26a945376e88d24b81e5a145841f55f0… — run `git show` on any of them.
  • Change coupling: RemoteSpawnCache.java ↔ RemoteSpawnRunner.java src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnCache.java:1 — `src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnCache.java` and `src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java` change together 62% of the time (10 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `86444557` Respect `--bust_action_caches` in Bazel's remote subsystem (#31333); `8bcf6aa9` Allow local fallback for buildRemoteAction failures (https://github.c…; `ddafb1a5` Make the Profiler singleton functional even when `Profiler.instance()… — run `git show` on any of them.
  • Change coupling: StarlarkRepositoryModule.java ↔ BuildGlobals.java src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkRepositoryModule.java:1 — `src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkRepositoryModule.java` and `src/main/java/com/google/devtools/build/lib/packages/BuildGlobals.java` change together 62% of the time (8 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `c4eba38e` Rename TargetRegistrationEnvironment -> TargetRecorder; `33a2bb79` Merge TargetDefinitionContext into TargetRegistrationEnvironment; `57e4ff5a` Refactor Package.Builder#fromOrFail variants — run `git show` on any of them.
  • Change coupling: RemoteAnalysisCacheReaderDepsProvider.java ↔ RemoteAnalysisCachingDependenciesProvider.java src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/RemoteAnalysisCacheReaderDepsProvider.java:1 — `src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/RemoteAnalysisCacheReaderDepsProvider.java` and `src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/RemoteAnalysisCachingDependenciesProvider.java` change together 62% of the time (8 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `359434c4` Move RemoteAnalysisCacheMode into its own class.; `b76b5eed` Remove RemoteAnalysisJsonLogWriter and related functionality / dead c…; `15274330` Update RemoteAnalysisCachingOptions to use the new options class inte… — run `git show` on any of them.
  • Change coupling: DelegatingPairInputMetadataProvider.java ↔ ActionInputMetadataProvider.java src/main/java/com/google/devtools/build/lib/actions/DelegatingPairInputMetadataProvider.java:1 — `src/main/java/com/google/devtools/build/lib/actions/DelegatingPairInputMetadataProvider.java` and `src/main/java/com/google/devtools/build/lib/skyframe/ActionInputMetadataProvider.java` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `b0b54977` Make the InputMetadataProvider#getInput argument a PathFragment inste…; `ff8b077c` Rename InputMetadataProvider.getTreeMetadataForPrefix() to getEnclosi…; `33987eca` Make ActionFileSystem take an InputMetadataProvider instead of an Act… — run `git show` on any of them.
  • Change coupling: FingerprintValueService.java ↔ GetRecordingStore.java src/main/java/com/google/devtools/build/lib/skyframe/serialization/FingerprintValueService.java:1 — `src/main/java/com/google/devtools/build/lib/skyframe/serialization/FingerprintValueService.java` and `src/main/java/com/google/devtools/build/lib/skyframe/serialization/testutils/GetRecordingStore.java` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `61e10c0e` Move `WriteStatus` to its own class.; `92f78b42` Internal change.; `207c6205` Fallback to other silos when a storage backend entry is missing. — run `git show` on any of them.
  • Change coupling: CompletionFunction.java ↔ LostImportantOutputHandlerModule.java src/main/java/com/google/devtools/build/lib/skyframe/CompletionFunction.java:1 — `src/main/java/com/google/devtools/build/lib/skyframe/CompletionFunction.java` and `src/main/java/com/google/devtools/build/lib/skyframe/rewinding/LostImportantOutputHandlerModule.java` change together 54% of the time (13 of the 24 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 13 shared commits counted here, the most recent 3 are `4fa5867e` Make lost input ownership tracking internal to `ActionRewindStrategy`.; `b005ba93` Only pass one `InputMetadataProvider` to `ImportantOutputHandler`.; `1ab88056` Fix a blaze bug with ineffective rewinding of a top-level output when… (at that commit the file was still `src/test/java/com/google/devtools/build/lib/skyframe/rewinding/LostImportantOutputHandlerModule.java`) — run `git show` on any of them.
  • Change coupling: FrontierSerializer.java ↔ RemoteAnalysisCacheReaderDepsProvider.java src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/FrontierSerializer.java:1 — `src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/FrontierSerializer.java` and `src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/RemoteAnalysisCacheReaderDepsProvider.java` change together 54% of the time (7 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `ff6eceb0` Fix NullPointerException on remote analysis cache initialization fail…; `359434c4` Move RemoteAnalysisCacheMode into its own class.; `b76b5eed` Remove RemoteAnalysisJsonLogWriter and related functionality / dead c… — run `git show` on any of them.
  • Change coupling: BuildResultPrinter.java ↔ TestCommand.java src/main/java/com/google/devtools/build/lib/buildtool/BuildResultPrinter.java:1 — `src/main/java/com/google/devtools/build/lib/buildtool/BuildResultPrinter.java` and `src/main/java/com/google/devtools/build/lib/runtime/commands/TestCommand.java` change together 50% of the time (8 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `6f9286e3` Update ExecutionOptions to use the new options class interface.; `f82d1677` Take pwd into account when pretty-printing paths; `bca3fd75` Automated rollback of commit 99434b16ba41677b92f7eb79d5d8dcb1130d7c47. — run `git show` on any of them.
  • Change coupling: RunfilesSupport.java ↔ PyBuiltins.java src/main/java/com/google/devtools/build/lib/analysis/RunfilesSupport.java:1 — `src/main/java/com/google/devtools/build/lib/analysis/RunfilesSupport.java` and `src/main/java/com/google/devtools/build/lib/rules/python/PyBuiltins.java` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `3e93ad81` Prefer artifacts in the same configuration as the depending target.; `39b9d3cc` Add `--incompatible_compact_repo_mapping_manifest`; `be1f9af1` Add a knob to RunfilesSupplier to override the root of the contained … — run `git show` on any of them.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×11
  • Duplicated block (5 lines × 2) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/Facts.java:100 — src/main/java/com/google/devtools/build/lib/bazel/bzlmod/Facts.java:100-104 | src/main/java/com/google/devtools/build/lib/bazel/bzlmod/Facts.java:108-112 — 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 `src/main/java/com/google/devtools/build/lib/bazel/bzlmod/Facts.java:100` 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 (5 lines × 2) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/RegularRunnableExtension.java:248 — src/main/java/com/google/devtools/build/lib/bazel/bzlmod/RegularRunnableExtension.java:248-252 | src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryFetchFunction.java:198-202 — 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 `src/main/java/com/google/devtools/build/lib/bazel/bzlmod/RegularRunnableExtension.java:248` 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 (5 lines × 2) src/main/java/com/google/devtools/build/lib/query2/PostAnalysisQueryEnvironment.java:431 — src/main/java/com/google/devtools/build/lib/query2/PostAnalysisQueryEnvironment.java:431-435 | src/main/java/com/google/devtools/build/lib/query2/PostAnalysisQueryEnvironment.java:468-474 — 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 `src/main/java/com/google/devtools/build/lib/query2/PostAnalysisQueryEnvironment.java:468` 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.
  • Duplicated block (5 lines × 2) src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommandLine.java:219 — src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommandLine.java:219-224 | src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommandLine.java:302-306 — 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 `src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommandLine.java:219` 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 (5 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/AspectFunction.java:388 — src/main/java/com/google/devtools/build/lib/skyframe/AspectFunction.java:388-392 | src/main/java/com/google/devtools/build/lib/skyframe/AspectFunction.java:480-484 — 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 `src/main/java/com/google/devtools/build/lib/skyframe/AspectFunction.java:388` 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 (5 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java:1948 — src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java:1948-1952 | src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java:2297-2302 — 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 `src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java:1948` 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 (5 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/FileDependencyDeserializer.java:638 — src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/FileDependencyDeserializer.java:638-642 | src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/FileDependencyDeserializer.java:661-665 — 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 `src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/FileDependencyDeserializer.java:638` 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 (5 lines × 2) src/main/java/net/starlark/java/eval/ImmutableStarlarkList.java:101 — src/main/java/net/starlark/java/eval/ImmutableStarlarkList.java:101-105 | src/main/java/net/starlark/java/eval/LazyImmutableStarlarkList.java:36-40 — 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 (5 lines × 2) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/modcommand/JsonOutputFormatter.java:136 — src/main/java/com/google/devtools/build/lib/bazel/bzlmod/modcommand/JsonOutputFormatter.java:136-140 | src/main/java/com/google/devtools/build/lib/bazel/bzlmod/modcommand/TextOutputFormatter.java:218-222 — 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 `src/main/java/com/google/devtools/build/lib/bazel/bzlmod/modcommand/JsonOutputFormatter.java:136` 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 (5 lines × 2) src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkRepositoryModule.java:82 — src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkRepositoryModule.java:82-86 | src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkRepositoryModule.java:233-237 — 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 `src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkRepositoryModule.java:82` 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 (5 lines × 2) examples/java-native/src/main/java/com/example/myproject/Greeter.java:43 — examples/java-native/src/main/java/com/example/myproject/Greeter.java:43-47 | examples/java-starlark/src/main/java/com/example/myproject/Greeter.java:41-45 — 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.
D17 · Explicit Debt · HackComment · ×8
  • HackComment scripts/docs/docs2mdx.py:369 — # Hack: do not add anchor if heading has non-empty prefix (e.g. list tag) — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment src/main/java/com/google/devtools/build/lib/collect/nestedset/NestedSet.java:741 — // Hack to share our internal array with ImmutableList/ImmutableSet, or avoid — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment src/main/java/com/google/devtools/build/lib/remote/ExecutionStatusException.java:46 — // Hack: convert to non-retriable exception on timeouts. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java:1794 — // Hack on Windows. The included headers dumped by cl.exe in stdout contain absolute paths. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment src/main/java/com/google/devtools/build/lib/util/FileHandlerQuerier.java:65 — // Hack: java.util.logging.FileHandler has no API for getting the current file path. Instead, we — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment src/main/java/com/google/devtools/build/lib/util/FileHandlerQuerier.java:79 — // Hack: java.util.logging.FileHandler has no API for checking if a log file is currently open. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment src/test/java/com/google/devtools/build/lib/buildtool/TargetSummaryEventTest.java:233 — // Hack: the path to the tools/test/BUILD file is prefixed in the Bazel tests. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment src/test/java/com/google/devtools/build/lib/view/cpp/CppTemplateTest.java:114 — // Hack up the workspace to make *.cc files not associated to any C++ action name. Should never — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×8
  • Duplicated block (14 lines × 2) src/main/java/com/google/devtools/build/lib/analysis/ConfiguredAspect.java:183 — src/main/java/com/google/devtools/build/lib/analysis/ConfiguredAspect.java:183-196 | src/main/java/com/google/devtools/build/lib/analysis/RuleConfiguredTargetBuilder.java:285-298 — 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 `src/main/java/com/google/devtools/build/lib/analysis/ConfiguredAspect.java:183` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. 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 (14 lines × 2) src/main/java/com/google/devtools/build/lib/dynamic/LocalBranch.java:178 — src/main/java/com/google/devtools/build/lib/dynamic/LocalBranch.java:178-191 | src/main/java/com/google/devtools/build/lib/dynamic/RemoteBranch.java:144-157 — 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 `src/main/java/com/google/devtools/build/lib/dynamic/LocalBranch.java:178` 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.
  • Duplicated block (14 lines × 2) src/main/java/com/google/devtools/build/lib/packages/PackageSpecification.java:509 — src/main/java/com/google/devtools/build/lib/packages/PackageSpecification.java:509-522 | src/main/java/com/google/devtools/build/lib/packages/PackageSpecification.java:532-545 — 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.
  • Duplicated block (14 lines × 2) src/main/java/com/google/devtools/build/lib/query2/aquery/ActionGraphSummaryOutputFormatterCallback.java:67 — src/main/java/com/google/devtools/build/lib/query2/aquery/ActionGraphSummaryOutputFormatterCallback.java:67-80 | src/main/java/com/google/devtools/build/lib/query2/aquery/ActionGraphTextOutputFormatterCallback.java:109-122 — 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 `src/main/java/com/google/devtools/build/lib/query2/aquery/ActionGraphSummaryOutputFormatterCallback.java:67` 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 (14 lines × 2) src/main/java/com/google/devtools/build/lib/query2/query/BlazeQueryEnvironment.java:386 — src/main/java/com/google/devtools/build/lib/query2/query/BlazeQueryEnvironment.java:386-399 | src/main/java/com/google/devtools/build/lib/query2/query/GraphlessBlazeQueryEnvironment.java:429-442 — before extracting anything, compare `src/main/java/com/google/devtools/build/lib/query2/query/BlazeQueryEnvironment.java` and `src/main/java/com/google/devtools/build/lib/query2/query/GraphlessBlazeQueryEnvironment.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/google/devtools/build/lib/query2/query/BlazeQueryEnvironment.java:386` 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. 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 (14 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/config/FlagSetFunction.java:325 — src/main/java/com/google/devtools/build/lib/skyframe/config/FlagSetFunction.java:325-338 | src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/RemoteAnalysisCacheFactory.java:398-411 — 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 `src/main/java/com/google/devtools/build/lib/skyframe/config/FlagSetFunction.java:325` 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.
  • Duplicated block (14 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/serialization/ArrayProcessor.java:115 — src/main/java/com/google/devtools/build/lib/skyframe/serialization/ArrayProcessor.java:115-128 | src/main/java/com/google/devtools/build/lib/skyframe/serialization/ArrayProcessor.java:370-383 — 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.
  • Duplicated block (14 lines × 2) src/main/java/net/starlark/java/eval/BuiltinFunction.java:407 — src/main/java/net/starlark/java/eval/BuiltinFunction.java:407-420 | src/main/java/net/starlark/java/eval/BuiltinFunction.java:520-533 — 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 `src/main/java/net/starlark/java/eval/BuiltinFunction.java:407` 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) · ×6
  • Duplicated block (15 lines × 2) src/main/java/com/google/devtools/build/lib/analysis/starlark/Args.java:346 — src/main/java/com/google/devtools/build/lib/analysis/starlark/Args.java:346-360 | src/main/java/com/google/devtools/build/lib/analysis/starlark/Args.java:412-426 — 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 `src/main/java/com/google/devtools/build/lib/analysis/starlark/Args.java:346` 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 (15 lines × 2) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleClassFunctions.java:286 — src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleClassFunctions.java:286-300 | src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleClassFunctions.java:308-322 — 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 `src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleClassFunctions.java:286` 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 (15 lines × 2) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/IndexRegistry.java:522 — src/main/java/com/google/devtools/build/lib/bazel/bzlmod/IndexRegistry.java:522-536 | src/main/java/com/google/devtools/build/lib/bazel/bzlmod/IndexRegistry.java:609-623 — 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 `src/main/java/com/google/devtools/build/lib/bazel/bzlmod/IndexRegistry.java:522` 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 (15 lines × 2) src/main/java/com/google/devtools/build/lib/buildtool/AnalysisAndExecutionPhaseRunner.java:169 — src/main/java/com/google/devtools/build/lib/buildtool/AnalysisAndExecutionPhaseRunner.java:169-183 | src/main/java/com/google/devtools/build/lib/buildtool/AnalysisPhaseRunner.java:282-296 — before extracting anything, compare `src/main/java/com/google/devtools/build/lib/buildtool/AnalysisAndExecutionPhaseRunner.java` and `src/main/java/com/google/devtools/build/lib/buildtool/AnalysisPhaseRunner.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 84 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/main/java/com/google/devtools/build/lib/buildtool/AnalysisPhaseRunner.java:281` calls `createStarted` and `src/main/java/com/google/devtools/build/lib/buildtool/AnalysisAndExecutionPhaseRunner.java:168` 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 (15 lines × 2) src/main/java/com/google/devtools/build/lib/includescanning/LegacyIncludeScanner.java:210 — src/main/java/com/google/devtools/build/lib/includescanning/LegacyIncludeScanner.java:210-224 | src/main/java/com/google/devtools/build/lib/includescanning/LegacyIncludeScanner.java:299-313 — 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 `src/main/java/com/google/devtools/build/lib/includescanning/LegacyIncludeScanner.java: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 (15 lines × 2) src/main/java/com/google/devtools/build/lib/query2/engine/BuildFilesFunction.java:51 — src/main/java/com/google/devtools/build/lib/query2/engine/BuildFilesFunction.java:51-65 | src/main/java/com/google/devtools/build/lib/query2/engine/LoadFilesFunction.java:48-62 — 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 `src/main/java/com/google/devtools/build/lib/query2/engine/BuildFilesFunction.java:51` 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) · ×6
  • Duplicated block (14–15 lines × 2) src/main/java/com/google/devtools/build/lib/buildtool/AnalysisAndExecutionPhaseRunner.java:124 — src/main/java/com/google/devtools/build/lib/buildtool/AnalysisAndExecutionPhaseRunner.java:124-137 | src/main/java/com/google/devtools/build/lib/buildtool/AnalysisPhaseRunner.java:140-154 — before extracting anything, compare `src/main/java/com/google/devtools/build/lib/buildtool/AnalysisAndExecutionPhaseRunner.java` and `src/main/java/com/google/devtools/build/lib/buildtool/AnalysisPhaseRunner.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 84 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/google/devtools/build/lib/buildtool/AnalysisAndExecutionPhaseRunner.java:124` 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 (14–15 lines × 2) src/main/java/com/google/devtools/build/lib/exec/local/XcodeLocalEnvProvider.java:194 — src/main/java/com/google/devtools/build/lib/exec/local/XcodeLocalEnvProvider.java:194-207 | src/main/java/com/google/devtools/build/lib/exec/local/XcodeLocalEnvProvider.java:302-316 — 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 `src/main/java/com/google/devtools/build/lib/exec/local/XcodeLocalEnvProvider.java:194` 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.
  • Duplicated block (14–15 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/TargetPatternPhaseFunction.java:437 — src/main/java/com/google/devtools/build/lib/skyframe/TargetPatternPhaseFunction.java:437-450 | src/main/java/com/google/devtools/build/lib/skyframe/TargetPatternPhaseFunction.java:460-474 — 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 `src/main/java/com/google/devtools/build/lib/skyframe/TargetPatternPhaseFunction.java:437` 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. 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 (14–15 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredExecutionPlatformsFunction.java:81 — src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredExecutionPlatformsFunction.java:81-94 | src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredToolchainsFunction.java:72-86 — before extracting anything, compare `src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredExecutionPlatformsFunction.java` and `src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredToolchainsFunction.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (14–15 lines × 2) src/main/java/net/starlark/java/annot/processor/StarlarkMethodProcessor.java:222 — src/main/java/net/starlark/java/annot/processor/StarlarkMethodProcessor.java:222-236 | src/main/java/net/starlark/java/annot/processor/StarlarkMethodProcessor.java:444-457 — 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 `src/main/java/net/starlark/java/annot/processor/StarlarkMethodProcessor.java:222` 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 (14–15 lines × 2) src/main/java/net/starlark/java/eval/FlagGuardedValue.java:27 — src/main/java/net/starlark/java/eval/FlagGuardedValue.java:27-40 | src/main/java/net/starlark/java/eval/FlagGuardedValue.java:60-74 — 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 `src/main/java/net/starlark/java/eval/FlagGuardedValue.java:27` 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. 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 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.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×6
  • Duplicated block (13 lines × 2) src/main/java/com/google/devtools/build/lib/analysis/LocationExpander.java:458 — src/main/java/com/google/devtools/build/lib/analysis/LocationExpander.java:458-470 | src/main/java/com/google/devtools/build/lib/analysis/LocationExpander.java:473-485 — 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 `src/main/java/com/google/devtools/build/lib/analysis/LocationExpander.java:458` 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 (13 lines × 2) src/main/java/com/google/devtools/build/lib/bazel/commands/FetchCommand.java:85 — src/main/java/com/google/devtools/build/lib/bazel/commands/FetchCommand.java:85-97 | src/main/java/com/google/devtools/build/lib/bazel/commands/VendorCommand.java:134-146 — before extracting anything, compare `src/main/java/com/google/devtools/build/lib/bazel/commands/FetchCommand.java` and `src/main/java/com/google/devtools/build/lib/bazel/commands/VendorCommand.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/main/java/com/google/devtools/build/lib/bazel/commands/FetchCommand.java:99` calls `getOptions`, `getForce` and `src/main/java/com/google/devtools/build/lib/bazel/commands/VendorCommand.java:150` 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 (13 lines × 2) src/main/java/com/google/devtools/build/lib/buildtool/SkyframeBuilder.java:186 — src/main/java/com/google/devtools/build/lib/buildtool/SkyframeBuilder.java:186-198 | src/main/java/com/google/devtools/build/lib/buildtool/SkyframeBuilder.java:248-260 — 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 (13 lines × 2) src/main/java/com/google/devtools/build/lib/remote/Retrier.java:359 — src/main/java/com/google/devtools/build/lib/remote/Retrier.java:359-371 | src/main/java/com/google/devtools/build/lib/remote/Retrier.java:375-387 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `call` to `RetryableCallable<T, E>` in one and `AsyncCallable<T>` 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 (13 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/EvalMacroFunction.java:100 — src/main/java/com/google/devtools/build/lib/skyframe/EvalMacroFunction.java:100-112 | src/main/java/com/google/devtools/build/lib/skyframe/EvalMacroFunction.java:126-138 — 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 `src/main/java/com/google/devtools/build/lib/skyframe/EvalMacroFunction.java:100` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. 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 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.
  • Duplicated block (13 lines × 2) src/main/java/com/google/devtools/build/lib/vfs/DiskBackedFileSystem.java:76 — src/main/java/com/google/devtools/build/lib/vfs/DiskBackedFileSystem.java:76-88 | src/main/java/com/google/devtools/build/lib/vfs/DiskBackedFileSystem.java:105-117 — 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 `src/main/java/com/google/devtools/build/lib/vfs/DiskBackedFileSystem.java:76` 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.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×5
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/main/java/com/google/devtools/build/lib/bazel/commands/FetchCommand.java:84 — src/main/java/com/google/devtools/build/lib/bazel/commands/FetchCommand.java:84-145 | src/main/java/com/google/devtools/build/lib/bazel/commands/VendorCommand.java:133-212 | src/main/java/com/google/devtools/build/lib/runtime/commands/BuildCommand.java:69-109 | src/main/java/com/google/devtools/build/lib/runtime/commands/TestCommand.java:132-263 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. 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. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainFeaturesLib.java:158 — src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainFeaturesLib.java:158-171 | src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainFeaturesLib.java:180-191 | src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainFeaturesLib.java:196-213 | src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainFeaturesLib.java:217-234 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. 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. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/main/java/com/google/devtools/build/lib/runtime/commands/AqueryCommand.java:86 — src/main/java/com/google/devtools/build/lib/runtime/commands/AqueryCommand.java:86-180 | src/main/java/com/google/devtools/build/lib/runtime/commands/BuildCommand.java:69-109 | src/main/java/com/google/devtools/build/lib/runtime/commands/CqueryCommand.java:120-205 | src/main/java/com/google/devtools/build/lib/runtime/commands/TestCommand.java:132-263 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. 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. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommandLine.java:180 — src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommandLine.java:180-193 | src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommandLine.java:227-244 | src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommandLine.java:253-280 | src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommandLine.java:309-336 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. 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. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/main/java/com/google/devtools/build/lib/util/HashCodes.java:90 — src/main/java/com/google/devtools/build/lib/util/HashCodes.java:90-104 | src/main/java/com/google/devtools/build/lib/util/HashCodes.java:113-131 | src/main/java/com/google/devtools/build/lib/util/HashCodes.java:141-163 | src/main/java/com/google/devtools/build/lib/util/HashCodes.java:174-201 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. 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. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×5
  • Duplicated block (16 lines × 2) src/main/java/com/google/devtools/build/lib/analysis/RunfilesSupport.java:724 — src/main/java/com/google/devtools/build/lib/analysis/RunfilesSupport.java:724-739 | src/main/java/com/google/devtools/build/lib/rules/python/PyBuiltins.java:205-220 — 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 (16 lines × 2) src/main/java/com/google/devtools/build/lib/exec/SpawnLogReconstructor.java:202 — src/main/java/com/google/devtools/build/lib/exec/SpawnLogReconstructor.java:202-217 | src/main/java/com/google/devtools/build/lib/exec/SpawnLogReconstructor.java:254-269 — 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 `src/main/java/com/google/devtools/build/lib/exec/SpawnLogReconstructor.java:202` 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 (16 lines × 2) src/main/java/com/google/devtools/build/lib/remote/http/HttpCacheClient.java:707 — src/main/java/com/google/devtools/build/lib/remote/http/HttpCacheClient.java:707-722 | src/main/java/com/google/devtools/build/lib/remote/http/HttpCacheClient.java:757-772 — 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 `src/main/java/com/google/devtools/build/lib/remote/http/HttpCacheClient.java:707` 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 (16 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/AspectFunction.java:669 — src/main/java/com/google/devtools/build/lib/skyframe/AspectFunction.java:669-684 | src/main/java/com/google/devtools/build/lib/skyframe/DependencyResolver.java:511-526 — 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 `src/main/java/com/google/devtools/build/lib/skyframe/AspectFunction.java:669` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/main/java/com/google/devtools/build/lib/skyframe/AspectFunction.java:668` calls `getConfigurationKey` and `src/main/java/com/google/devtools/build/lib/skyframe/DependencyResolver.java:510` 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 (16 lines × 2) src/main/java/com/google/devtools/build/lib/platform/SystemLoadAdvisoryEvent.java:34 — src/main/java/com/google/devtools/build/lib/platform/SystemLoadAdvisoryEvent.java:34-49 | src/main/java/com/google/devtools/build/lib/platform/SystemThermalEvent.java:34-49 — 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.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×4
  • Duplicated block (18 lines × 2) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkCustomCommandLine.java:1080 — src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkCustomCommandLine.java:1080-1097 | src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkCustomCommandLine.java:1185-1202 — 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 `src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkCustomCommandLine.java:1080` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkCustomCommandLine.java:1204` calls `addLineForFlagPerLine` and `src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkCustomCommandLine.java:1098` 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 (18 lines × 2) src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java:750 — src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java:750-767 | src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java:771-788 — 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 `src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java:750` 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 (18 lines × 2) src/main/java/com/google/devtools/build/lib/sandbox/LinuxSandboxCommandLineBuilder.java:241 — src/main/java/com/google/devtools/build/lib/sandbox/LinuxSandboxCommandLineBuilder.java:241-258 | src/main/java/com/google/devtools/build/lib/sandbox/WindowsSandboxUtil.java:198-215 — 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, `src/main/java/com/google/devtools/build/lib/sandbox/WindowsSandboxUtil.java:216` calls `values`, `add`, `getPathString` and `src/main/java/com/google/devtools/build/lib/sandbox/LinuxSandboxCommandLineBuilder.java:259` 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 (18 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/BuildOptionsScopeFunction.java:258 — src/main/java/com/google/devtools/build/lib/skyframe/BuildOptionsScopeFunction.java:258-275 | src/main/java/com/google/devtools/build/lib/skyframe/config/ParsedFlagsFunction.java:267-284 — 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. 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 (17 lines × 2) · ×4
  • Duplicated block (17 lines × 2) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkActionFactory.java:144 — src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkActionFactory.java:144-160 | src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkActionFactory.java:166-182 — 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 (17 lines × 2) src/main/java/com/google/devtools/build/lib/bazel/coverage/CoverageReportActionBuilder.java:244 — src/main/java/com/google/devtools/build/lib/bazel/coverage/CoverageReportActionBuilder.java:244-260 | src/main/java/com/google/devtools/build/lib/bazel/coverage/CoverageReportActionBuilder.java:266-282 — 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 `src/main/java/com/google/devtools/build/lib/bazel/coverage/CoverageReportActionBuilder.java:244` 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 (17 lines × 2) src/main/java/com/google/devtools/build/lib/buildtool/AnalysisAndExecutionPhaseRunner.java:186 — src/main/java/com/google/devtools/build/lib/buildtool/AnalysisAndExecutionPhaseRunner.java:186-202 | src/main/java/com/google/devtools/build/lib/buildtool/AnalysisPhaseRunner.java:300-316 — before extracting anything, compare `src/main/java/com/google/devtools/build/lib/buildtool/AnalysisAndExecutionPhaseRunner.java` and `src/main/java/com/google/devtools/build/lib/buildtool/AnalysisPhaseRunner.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 84 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/google/devtools/build/lib/buildtool/AnalysisAndExecutionPhaseRunner.java:186` 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 (17 lines × 2) src/main/java/com/google/devtools/build/lib/sandbox/HardlinkedSandboxedSpawn.java:117 — src/main/java/com/google/devtools/build/lib/sandbox/HardlinkedSandboxedSpawn.java:117-133 | src/main/java/com/google/devtools/build/lib/sandbox/SymlinkedSandboxedSpawn.java:143-159 — 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.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×4
  • Duplicated block (7–8 lines × 2) src/main/java/com/google/devtools/build/lib/packages/ImplicitOutputsFunction.java:118 — src/main/java/com/google/devtools/build/lib/packages/ImplicitOutputsFunction.java:118-124 | src/main/java/com/google/devtools/build/lib/packages/ImplicitOutputsFunction.java:171-178 — 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 `src/main/java/com/google/devtools/build/lib/packages/ImplicitOutputsFunction.java:118` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. 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 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, `src/main/java/com/google/devtools/build/lib/packages/ImplicitOutputsFunction.java:124` calls `buildOrThrow`, `EvalException` and `src/main/java/com/google/devtools/build/lib/packages/ImplicitOutputsFunction.java:178` 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 (7–8 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/GlobFunctionWithMultipleRecursiveFunctions.java:217 — src/main/java/com/google/devtools/build/lib/skyframe/GlobFunctionWithMultipleRecursiveFunctions.java:217-224 | src/main/java/com/google/devtools/build/lib/skyframe/GlobFunctionWithMultipleRecursiveFunctions.java:278-284 — 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 `src/main/java/com/google/devtools/build/lib/skyframe/GlobFunctionWithMultipleRecursiveFunctions.java:217` 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–8 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/serialization/autocodec/DeferredObjectCodecFieldGenerators.java:70 — src/main/java/com/google/devtools/build/lib/skyframe/serialization/autocodec/DeferredObjectCodecFieldGenerators.java:70-77 | src/main/java/com/google/devtools/build/lib/skyframe/serialization/autocodec/InterningObjectCodecFieldGenerators.java:49-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/google/devtools/build/lib/skyframe/serialization/autocodec/DeferredObjectCodecFieldGenerators.java:70` 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.
  • Duplicated block (7–8 lines × 2) src/main/java/net/starlark/java/syntax/TypeChecker.java:304 — src/main/java/net/starlark/java/syntax/TypeChecker.java:304-311 | src/main/java/net/starlark/java/syntax/TypeChecker.java:349-355 — 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 `src/main/java/net/starlark/java/syntax/TypeChecker.java:304` 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 (9 lines × 3) · ×3
  • Duplicated block (9 lines × 3) src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java:1008 — src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java:1008-1016 | src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java:1834-1842 | src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java:2034-2042 — all 3 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 `src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java:1008` 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 (9 lines × 3) src/main/java/com/google/devtools/build/lib/remote/ReferenceCountedChannel.java:164 — src/main/java/com/google/devtools/build/lib/remote/ReferenceCountedChannel.java:164-172 | src/main/java/com/google/devtools/build/lib/remote/util/RxFutures.java:200-208 | src/main/java/com/google/devtools/build/lib/remote/util/RxFutures.java:241-249 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (9 lines × 3) src/main/java/com/google/devtools/build/lib/runtime/ServerBuilder.java:101 — src/main/java/com/google/devtools/build/lib/runtime/ServerBuilder.java:101-109 | src/main/java/com/google/devtools/build/lib/runtime/WorkspaceBuilder.java:166-174 | src/main/java/com/google/devtools/build/lib/runtime/WorkspaceBuilder.java:182-190 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/google/devtools/build/lib/runtime/WorkspaceBuilder.java:166` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. 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 (7 lines × 3) · ×3
  • Duplicated block (7 lines × 3) src/main/java/com/google/devtools/build/lib/runtime/BuildEventStreamer.java:366 — src/main/java/com/google/devtools/build/lib/runtime/BuildEventStreamer.java:366-372 | src/main/java/com/google/devtools/build/lib/runtime/BuildEventStreamer.java:855-861 | src/main/java/com/google/devtools/build/lib/runtime/BuildEventStreamer.java:959-965 — all 3 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.
  • Duplicated block (7 lines × 3) src/main/java/net/starlark/java/eval/EvalUtils.java:132 — src/main/java/net/starlark/java/eval/EvalUtils.java:132-138 | src/main/java/net/starlark/java/eval/EvalUtils.java:148-154 | src/main/java/net/starlark/java/eval/EvalUtils.java:196-202 — all 3 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 `src/main/java/net/starlark/java/eval/EvalUtils.java:132` 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 × 3) src/main/java/com/google/devtools/build/lib/analysis/BazelRuleAnalysisThreadContext.java:51 — src/main/java/com/google/devtools/build/lib/analysis/BazelRuleAnalysisThreadContext.java:51-57 | src/main/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleThreadContext.java:69-75 | src/main/java/com/google/devtools/build/lib/packages/RepoThreadContext.java:35-41 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 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 3 times.
X3 · Exception handling · Swallowed exception (empty catch) · ×3
  • Swallowed exception (empty catch) src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java:2158 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java:2177 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java:2182 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
D4 · Code Duplication · Duplicated block (24 lines × 2) · ×2
  • Duplicated block (24 lines × 2) src/main/java/com/google/devtools/build/lib/analysis/actions/StarlarkAction.java:269 — src/main/java/com/google/devtools/build/lib/analysis/actions/StarlarkAction.java:269-292 | src/main/java/com/google/devtools/build/lib/analysis/actions/StarlarkAction.java:311-334 — 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 (24 lines × 2) src/main/java/com/google/devtools/build/lib/query2/aquery/ActionGraphQueryEnvironment.java:486 — src/main/java/com/google/devtools/build/lib/query2/aquery/ActionGraphQueryEnvironment.java:486-509 | src/main/java/com/google/devtools/build/lib/query2/cquery/ConfiguredTargetQueryEnvironment.java:365-388 — before extracting anything, compare `src/main/java/com/google/devtools/build/lib/query2/aquery/ActionGraphQueryEnvironment.java` and `src/main/java/com/google/devtools/build/lib/query2/cquery/ConfiguredTargetQueryEnvironment.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/google/devtools/build/lib/query2/aquery/ActionGraphQueryEnvironment.java:486` 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 (22 lines × 2) · ×2
  • Duplicated block (22 lines × 2) src/main/java/com/google/devtools/build/lib/packages/PackageFactory.java:232 — src/main/java/com/google/devtools/build/lib/packages/PackageFactory.java:232-253 | src/main/java/com/google/devtools/build/lib/packages/PackageFactory.java:304-325 — 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 `src/main/java/com/google/devtools/build/lib/packages/PackageFactory.java:232` 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.
  • Duplicated block (22 lines × 2) src/main/java/com/google/devtools/build/lib/packages/Type.java:739 — src/main/java/com/google/devtools/build/lib/packages/Type.java:739-760 | src/main/java/com/google/devtools/build/lib/packages/Type.java:814-835 — 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 `src/main/java/com/google/devtools/build/lib/packages/Type.java:739` 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 lines × 2) · ×2
  • Duplicated block (19 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java:547 — src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java:547-565 | src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java:1094-1112 — 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 `src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java:547` 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 (19 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredExecutionPlatformsCycleReporter.java:60 — src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredExecutionPlatformsCycleReporter.java:60-78 | src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredToolchainsCycleReporter.java:67-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredExecutionPlatformsCycleReporter.java:60` 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 (13–14 lines × 3) · ×2
  • Duplicated block (13–14 lines × 3) src/main/java/com/google/devtools/build/skyframe/state/Lookup.java:119 — src/main/java/com/google/devtools/build/skyframe/state/Lookup.java:119-131 | src/main/java/com/google/devtools/build/skyframe/state/Lookup.java:171-183 | src/main/java/com/google/devtools/build/skyframe/state/Lookup.java:233-246 — all 3 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 `src/main/java/com/google/devtools/build/skyframe/state/Lookup.java:119` 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.
  • Duplicated block (13–14 lines × 3) src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java:192 — src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java:192-205 | src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java:215-228 | src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java:237-249 — all 3 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 `src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java:192` 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. 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.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×2
  • Duplicated block (12–13 lines × 2) src/main/java/com/google/devtools/build/docgen/ApiExporter.java:322 — src/main/java/com/google/devtools/build/docgen/ApiExporter.java:322-333 | src/main/java/com/google/devtools/build/docgen/BuildEncyclopediaGenerator.java:63-75 — 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 `src/main/java/com/google/devtools/build/docgen/ApiExporter.java:322` 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–13 lines × 2) src/main/java/com/google/devtools/build/skyframe/SkyFunctionEnvironment.java:250 — src/main/java/com/google/devtools/build/skyframe/SkyFunctionEnvironment.java:250-262 | src/main/java/com/google/devtools/build/skyframe/SkyFunctionEnvironment.java:1302-1313 — 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 `src/main/java/com/google/devtools/build/skyframe/SkyFunctionEnvironment.java:250` 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 (11 lines × 3) · ×2
  • Duplicated block (11 lines × 3) src/main/java/com/google/devtools/build/lib/remote/http/HttpCacheClient.java:627 — src/main/java/com/google/devtools/build/lib/remote/http/HttpCacheClient.java:627-637 | src/main/java/com/google/devtools/build/lib/remote/http/HttpCacheClient.java:708-718 | src/main/java/com/google/devtools/build/lib/remote/http/HttpCacheClient.java:758-768 — all 3 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 `src/main/java/com/google/devtools/build/lib/remote/http/HttpCacheClient.java:627` 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 × 3) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkMapActionTemplate.java:313 — src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkMapActionTemplate.java:313-323 | src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionTemplate.java:397-407 | src/main/java/com/google/devtools/build/lib/rules/cpp/LtoBackendActionTemplate.java:449-459 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 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 3 times. 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 × 3) · ×2
  • Duplicated block (8 lines × 3) src/main/java/com/google/devtools/build/lib/bazel/debug/WorkspaceRuleEvent.java:75 — src/main/java/com/google/devtools/build/lib/bazel/debug/WorkspaceRuleEvent.java:75-82 | src/main/java/com/google/devtools/build/lib/bazel/debug/WorkspaceRuleEvent.java:106-113 | src/main/java/com/google/devtools/build/lib/bazel/debug/WorkspaceRuleEvent.java:169-176 — all 3 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 `src/main/java/com/google/devtools/build/lib/bazel/debug/WorkspaceRuleEvent.java:75` 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 (8 lines × 3) src/main/java/com/google/devtools/build/lib/remote/RemoteExternalOverlayFileSystem.java:304 — src/main/java/com/google/devtools/build/lib/remote/RemoteExternalOverlayFileSystem.java:304-311 | src/main/java/com/google/devtools/build/lib/remote/RemoteExternalOverlayFileSystem.java:334-341 | src/main/java/com/google/devtools/build/lib/remote/RemoteExternalOverlayFileSystem.java:360-367 — all 3 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.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×2
  • Duplicated block (7 lines × 4) src/main/java/com/google/devtools/build/lib/bazel/commands/FetchCommand.java:115 — src/main/java/com/google/devtools/build/lib/bazel/commands/FetchCommand.java:115-121 | src/main/java/com/google/devtools/build/lib/bazel/commands/VendorCommand.java:162-168 | src/main/java/com/google/devtools/build/lib/runtime/commands/BuildCommand.java:71-77 | src/main/java/com/google/devtools/build/lib/runtime/commands/TestCommand.java:135-141 — before extracting anything, compare `src/main/java/com/google/devtools/build/lib/bazel/commands/FetchCommand.java` and `src/main/java/com/google/devtools/build/lib/bazel/commands/VendorCommand.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 (7 lines × 4) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkBuildSettingsDetailsValue.java:66 — src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkBuildSettingsDetailsValue.java:66-72 | src/main/java/com/google/devtools/build/lib/bazel/bzlmod/BazelModuleInspectorValue.java:60-66 | src/main/java/com/google/devtools/build/lib/bazel/bzlmod/SingleExtensionValue.java:56-62 | src/main/java/com/google/devtools/build/lib/bazel/repository/decompressor/DecompressorDescriptor.java:37-43 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 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 4 times.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×2
  • Duplicated block (5 lines × 3) src/main/java/com/google/devtools/build/lib/runtime/commands/AqueryCommand.java:100 — src/main/java/com/google/devtools/build/lib/runtime/commands/AqueryCommand.java:100-104 | src/main/java/com/google/devtools/build/lib/runtime/commands/CqueryCommand.java:129-133 | src/main/java/com/google/devtools/build/lib/runtime/commands/QueryEnvironmentBasedCommand.java:117-121 — before extracting anything, compare `src/main/java/com/google/devtools/build/lib/runtime/commands/AqueryCommand.java` and `src/main/java/com/google/devtools/build/lib/runtime/commands/CqueryCommand.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/google/devtools/build/lib/runtime/commands/AqueryCommand.java:100` 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 (5 lines × 3) src/main/java/com/google/devtools/build/docgen/BuildEncyclopediaGenerator.java:52 — src/main/java/com/google/devtools/build/docgen/BuildEncyclopediaGenerator.java:52-56 | src/main/java/com/google/devtools/build/docgen/ListRuleMain.java:31-35 | src/main/java/com/google/devtools/build/docgen/SymbolFamilies.java:139-143 — 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 (6 lines × 3) · ×2
  • Duplicated block (6 lines × 3) src/main/java/com/google/devtools/build/lib/actions/ActionExecutedEvent.java:266 — src/main/java/com/google/devtools/build/lib/actions/ActionExecutedEvent.java:266-271 | src/main/java/com/google/devtools/build/lib/buildeventservice/client/BuildEventServiceProtoUtil.java:231-236 | src/main/java/com/google/devtools/build/lib/remote/UploadManifest.java:159-164 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 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 3 times. 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 × 3) src/main/java/com/google/devtools/build/lib/actions/ExecutionRequirements.java:266 — src/main/java/com/google/devtools/build/lib/actions/ExecutionRequirements.java:266-271 | src/main/java/com/google/devtools/build/lib/remote/CombinedCache.java:996-1001 | src/main/java/com/google/devtools/build/lib/skyframe/config/PlatformMappingFunction.java:148-153 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 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 3 times. 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: `Code` names `com.google.devtools.build.lib.server.FailureDetails.BuildConfiguration.Code` in one and `com.google.devtools.build.lib.server.FailureDetails.RemoteExecution.Code` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
X15 · Unvalidated length from an untrusted reader · Length read from the parsed input is spent without ever being bounded · ×2
  • Length read from the parsed input is spent without ever being bounded src/main/java/com/google/devtools/build/lib/actions/cache/PersistentStringIndexer.java:193 — `length` is read from the bytes being parsed at line 189 (`readInt`), then used to size a `new byte[]` at line 193 — and nowhere in its scope is `length` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `length` against the bytes actually remaining and a maximum the format allows before allocating.
  • Length read from the parsed input is spent without ever being bounded src/main/java/com/google/devtools/build/lib/actions/cache/CompactPersistentActionCache.java:214 — `size` is read from the bytes being parsed at line 210 (`readInt`), then used to size a `new byte[]` at line 214 — and nowhere in its scope is `size` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `size` against the bytes actually remaining and a maximum the format allows before allocating.
D1 · Cyclomatic Complexity · EvalUtils.binaryOp (cyclomatic 111) · ×1
  • EvalUtils.binaryOp (cyclomatic 111) src/main/java/net/starlark/java/eval/EvalUtils.java:59 — EvalUtils.binaryOp has cyclomatic complexity 111 (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 · StarlarkRuleClassFunctions.createRule (cyclomatic 83) · ×1
  • StarlarkRuleClassFunctions.createRule (cyclomatic 83) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleClassFunctions.java:709 — StarlarkRuleClassFunctions.createRule has cyclomatic complexity 83 (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 · Lexer.scanWord (cyclomatic 79) · ×1
  • Lexer.scanWord (cyclomatic 79) src/main/java/com/google/devtools/build/lib/query2/engine/Lexer.java:170 — Lexer.scanWord has cyclomatic complexity 79 (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 · Lexer.tokenize (cyclomatic 62) · ×1
  • Lexer.tokenize (cyclomatic 62) src/main/java/net/starlark/java/syntax/Lexer.java:694 — Lexer.tokenize has cyclomatic complexity 62 (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. This is NOT this file's highest cyclomatic complexity: Lexer.scanIdentifier (cyclomatic 65) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · BlazeCommandDispatcher.execExclusively (cyclomatic 60) · ×1
  • BlazeCommandDispatcher.execExclusively (cyclomatic 60) src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java:376 — BlazeCommandDispatcher.execExclusively has cyclomatic complexity 60 (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 · ModCommand.execInternal (cyclomatic 60) · ×1
  • ModCommand.execInternal (cyclomatic 60) src/main/java/com/google/devtools/build/lib/bazel/commands/ModCommand.java:217 — ModCommand.execInternal has cyclomatic complexity 60 (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 · BazelRepositoryModule.beforeCommand (cyclomatic 55) · ×1
  • BazelRepositoryModule.beforeCommand (cyclomatic 55) src/main/java/com/google/devtools/build/lib/bazel/BazelRepositoryModule.java:279 — BazelRepositoryModule.beforeCommand has cyclomatic complexity 55 (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 · PatchUtil.applyInternal (cyclomatic 54) · ×1
  • PatchUtil.applyInternal (cyclomatic 54) src/main/java/com/google/devtools/build/lib/bazel/repository/decompressor/PatchUtil.java:448 — PatchUtil.applyInternal 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 · Lexer.escapedStringLiteral (cyclomatic 52) · ×1
  • Lexer.escapedStringLiteral (cyclomatic 52) src/main/java/net/starlark/java/syntax/Lexer.java:273 — Lexer.escapedStringLiteral has cyclomatic complexity 52 (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. This is NOT this file's highest cyclomatic complexity: Lexer.scanIdentifier (cyclomatic 65) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · RemoteModule.setup (cyclomatic 50) · ×1
  • RemoteModule.setup (cyclomatic 50) src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java:414 — RemoteModule.setup has cyclomatic complexity 50 (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 · StarlarkAttrModule.createAttribute (cyclomatic 50) · ×1
  • StarlarkAttrModule.createAttribute (cyclomatic 50) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttrModule.java:312 — StarlarkAttrModule.createAttribute has cyclomatic complexity 50 (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 · HttpConnector.connect (cyclomatic 48) · ×1
  • HttpConnector.connect (cyclomatic 48) src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/HttpConnector.java:115 — HttpConnector.connect has cyclomatic complexity 48 (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 · GlobFunctionWithMultipleRecursiveFunctions.compute (cyclomatic 45) · ×1
  • GlobFunctionWithMultipleRecursiveFunctions.compute (cyclomatic 45) src/main/java/com/google/devtools/build/lib/skyframe/GlobFunctionWithMultipleRecursiveFunctions.java:51 — GlobFunctionWithMultipleRecursiveFunctions.compute has cyclomatic complexity 45 (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 · CcCommon.configureFeaturesOrThrowEvalException (cyclomatic 45) · ×1
  • CcCommon.configureFeaturesOrThrowEvalException (cyclomatic 45) src/main/java/com/google/devtools/build/lib/rules/cpp/CcCommon.java:117 — CcCommon.configureFeaturesOrThrowEvalException has cyclomatic complexity 45 (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 · NodePrinter.printExpr (cyclomatic 41) · ×1
  • NodePrinter.printExpr (cyclomatic 41) src/main/java/net/starlark/java/syntax/NodePrinter.java:313 — NodePrinter.printExpr has cyclomatic complexity 41 (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 · Evaluate.runCore (cyclomatic 41) · ×1
  • Evaluate.runCore (cyclomatic 41) src/main/java/com/google/devtools/build/skyframe/AbstractParallelEvaluator.java:418 — Evaluate.runCore has cyclomatic complexity 41 (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 · FunctionTransitionUtil.applyTransition (cyclomatic 40) · ×1
  • FunctionTransitionUtil.applyTransition (cyclomatic 40) src/main/java/com/google/devtools/build/lib/analysis/starlark/FunctionTransitionUtil.java:612 — FunctionTransitionUtil.applyTransition 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 · Lexer.scanNumberOrDotOrEllipsis (cyclomatic 39) · ×1
  • Lexer.scanNumberOrDotOrEllipsis (cyclomatic 39) src/main/java/net/starlark/java/syntax/Lexer.java:900 — Lexer.scanNumberOrDotOrEllipsis 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. This is NOT this file's highest cyclomatic complexity: Lexer.scanIdentifier (cyclomatic 65) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · StarlarkActionFactory.registerStarlarkAction (cyclomatic 39) · ×1
  • StarlarkActionFactory.registerStarlarkAction (cyclomatic 39) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkActionFactory.java:724 — StarlarkActionFactory.registerStarlarkAction 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 · AspectFunction.compute (cyclomatic 38) · ×1
  • AspectFunction.compute (cyclomatic 38) src/main/java/com/google/devtools/build/lib/skyframe/AspectFunction.java:265 — AspectFunction.compute has cyclomatic complexity 38 (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 · BuildEventServiceUploader.publishBuildEvents (cyclomatic 38) · ×1
  • BuildEventServiceUploader.publishBuildEvents (cyclomatic 38) src/main/java/com/google/devtools/build/lib/buildeventservice/BuildEventServiceUploader.java:458 — BuildEventServiceUploader.publishBuildEvents has cyclomatic complexity 38 (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 · _CLRParser.handle_endtag (cyclomatic 38) · ×1
  • _CLRParser.handle_endtag (cyclomatic 38) scripts/docs/clr_converter.py:215 — _CLRParser.handle_endtag has cyclomatic complexity 38 (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 · PackageFunction.compute (cyclomatic 37) · ×1
  • PackageFunction.compute (cyclomatic 37) src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java:368 — PackageFunction.compute has cyclomatic complexity 37 (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 · ProtoOutputFormatter.toTargetProtoBuffer (cyclomatic 36) · ×1
  • ProtoOutputFormatter.toTargetProtoBuffer (cyclomatic 36) src/main/java/com/google/devtools/build/lib/query2/query/output/ProtoOutputFormatter.java:182 — ProtoOutputFormatter.toTargetProtoBuffer has cyclomatic complexity 36 (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 · RuleConfiguredTargetBuilder.build (cyclomatic 36) · ×1
  • RuleConfiguredTargetBuilder.build (cyclomatic 36) src/main/java/com/google/devtools/build/lib/analysis/RuleConfiguredTargetBuilder.java:101 — RuleConfiguredTargetBuilder.build has cyclomatic complexity 36 (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 · UiEventHandler.handleLocked (cyclomatic 35) · ×1
  • UiEventHandler.handleLocked (cyclomatic 35) src/main/java/com/google/devtools/build/lib/runtime/UiEventHandler.java:429 — UiEventHandler.handleLocked has cyclomatic complexity 35 (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 · RemoteExecutionService.downloadOutputs (cyclomatic 35) · ×1
  • RemoteExecutionService.downloadOutputs (cyclomatic 35) src/main/java/com/google/devtools/build/lib/remote/RemoteExecutionService.java:1307 — RemoteExecutionService.downloadOutputs has cyclomatic complexity 35 (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 · RepositoryFetchFunction.computeInternal (cyclomatic 34) · ×1
  • RepositoryFetchFunction.computeInternal (cyclomatic 34) src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryFetchFunction.java:222 — RepositoryFetchFunction.computeInternal has cyclomatic complexity 34 (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 · BzlCompileFunction.computeInline (cyclomatic 33) · ×1
  • BzlCompileFunction.computeInline (cyclomatic 33) src/main/java/com/google/devtools/build/lib/skyframe/BzlCompileFunction.java:108 — BzlCompileFunction.computeInline 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 · ChunkingSession.nextChunkSize (cyclomatic 33) · ×1
  • ChunkingSession.nextChunkSize (cyclomatic 33) src/main/java/com/google/devtools/build/lib/remote/chunking/RepMaxCdcChunker.java:219 — ChunkingSession.nextChunkSize 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 · StarlarkRuleClassFunctions.aspect (cyclomatic 33) · ×1
  • StarlarkRuleClassFunctions.aspect (cyclomatic 33) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleClassFunctions.java:1334 — StarlarkRuleClassFunctions.aspect 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 · BlazeRuntime.newRuntime (cyclomatic 32) · ×1
  • BlazeRuntime.newRuntime (cyclomatic 32) src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java:1408 — BlazeRuntime.newRuntime has cyclomatic complexity 32 (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 · SingleExtensionEvalFunction.compute (cyclomatic 32) · ×1
  • SingleExtensionEvalFunction.compute (cyclomatic 32) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/SingleExtensionEvalFunction.java:99 — SingleExtensionEvalFunction.compute has cyclomatic complexity 32 (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 · DownloadManager.downloadInExecutor (cyclomatic 31) · ×1
  • DownloadManager.downloadInExecutor (cyclomatic 31) src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/DownloadManager.java:185 — DownloadManager.downloadInExecutor 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 · Printer.formatWithList (cyclomatic 30) · ×1
  • Printer.formatWithList (cyclomatic 30) src/main/java/net/starlark/java/eval/Printer.java:462 — Printer.formatWithList 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 · MethodDescriptor.starlarkTypeFromJava (cyclomatic 30) · ×1
  • MethodDescriptor.starlarkTypeFromJava (cyclomatic 30) src/main/java/net/starlark/java/eval/MethodDescriptor.java:285 — MethodDescriptor.starlarkTypeFromJava has cyclomatic complexity 30 (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 · SkyValueRetriever.tryRetrieve (cyclomatic 30) · ×1
  • SkyValueRetriever.tryRetrieve (cyclomatic 30) src/main/java/com/google/devtools/build/lib/skyframe/serialization/SkyValueRetriever.java:288 — SkyValueRetriever.tryRetrieve 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 · StarlarkNativeModule.starlarkifyValue (cyclomatic 30) · ×1
  • StarlarkNativeModule.starlarkifyValue (cyclomatic 30) src/main/java/com/google/devtools/build/lib/packages/StarlarkNativeModule.java:716 — StarlarkNativeModule.starlarkifyValue has cyclomatic complexity 30 (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 · StandaloneTestStrategy.runTestAttempt (cyclomatic 30) · ×1
  • StandaloneTestStrategy.runTestAttempt (cyclomatic 30) src/main/java/com/google/devtools/build/lib/exec/StandaloneTestStrategy.java:651 — StandaloneTestStrategy.runTestAttempt 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 · VectorArg.preprocess (cyclomatic 30) · ×1
  • VectorArg.preprocess (cyclomatic 30) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkCustomCommandLine.java:333 — VectorArg.preprocess 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 · _CLRParser.handle_starttag (cyclomatic 30) · ×1
  • _CLRParser.handle_starttag (cyclomatic 30) scripts/docs/clr_converter.py:124 — _CLRParser.handle_starttag has cyclomatic complexity 30 (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 · TypeChecker.infer (cyclomatic 29) · ×1
  • TypeChecker.infer (cyclomatic 29) src/main/java/net/starlark/java/syntax/TypeChecker.java:156 — TypeChecker.infer has cyclomatic complexity 29 (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 · StarlarkMethodProcessor.process (cyclomatic 29) · ×1
  • StarlarkMethodProcessor.process (cyclomatic 29) src/main/java/net/starlark/java/annot/processor/StarlarkMethodProcessor.java:139 — StarlarkMethodProcessor.process 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 · ShellUtils.tokenize (cyclomatic 29) · ×1
  • ShellUtils.tokenize (cyclomatic 29) src/main/java/com/google/devtools/build/lib/shell/ShellUtils.java:90 — ShellUtils.tokenize 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 · RemoteSpawnCache.lookup (cyclomatic 29) · ×1
  • RemoteSpawnCache.lookup (cyclomatic 29) src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnCache.java:84 — RemoteSpawnCache.lookup 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 · RemoteServerCapabilities.checkClientServerCompatibility (cyclomatic 29) · ×1
  • RemoteServerCapabilities.checkClientServerCompatibility (cyclomatic 29) src/main/java/com/google/devtools/build/lib/remote/RemoteServerCapabilities.java:155 — RemoteServerCapabilities.checkClientServerCompatibility 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 · AttributeFormatter.writeAttributeValueToBuilder (cyclomatic 29) · ×1
  • AttributeFormatter.writeAttributeValueToBuilder (cyclomatic 29) src/main/java/com/google/devtools/build/lib/packages/AttributeFormatter.java:210 — AttributeFormatter.writeAttributeValueToBuilder has cyclomatic complexity 29 (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 · TestActionBuilder.createTestAction (cyclomatic 29) · ×1
  • TestActionBuilder.createTestAction (cyclomatic 29) src/main/java/com/google/devtools/build/lib/analysis/test/TestActionBuilder.java:234 — TestActionBuilder.createTestAction 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 · MergedConfiguredTarget.of (cyclomatic 29) · ×1
  • MergedConfiguredTarget.of (cyclomatic 29) src/main/java/com/google/devtools/build/lib/analysis/configuredtargets/MergedConfiguredTarget.java:197 — MergedConfiguredTarget.of 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 · StarlarkOptionsParser.parseGivenArgs (cyclomatic 28) · ×1
  • StarlarkOptionsParser.parseGivenArgs (cyclomatic 28) src/main/java/com/google/devtools/build/lib/runtime/StarlarkOptionsParser.java:179 — StarlarkOptionsParser.parseGivenArgs 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 · CommandEnvironment.<init> (cyclomatic 28) · ×1
  • CommandEnvironment.<init> (cyclomatic 28) src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java:228 — CommandEnvironment.<init> 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 · BuildEventStreamer.buildEvent (cyclomatic 28) · ×1
  • BuildEventStreamer.buildEvent (cyclomatic 28) src/main/java/com/google/devtools/build/lib/runtime/BuildEventStreamer.java:671 — BuildEventStreamer.buildEvent has cyclomatic complexity 28 (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 · NestedSet.create (cyclomatic 28) · ×1
  • NestedSet.create (cyclomatic 28) src/main/java/com/google/devtools/build/lib/collect/nestedset/NestedSet.java:224 — NestedSet.create 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 · ProxyHelper.createProxyIfNeeded (cyclomatic 28) · ×1
  • ProxyHelper.createProxyIfNeeded (cyclomatic 28) src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/ProxyHelper.java:83 — ProxyHelper.createProxyIfNeeded 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 · TypeChecker.inferCall (cyclomatic 27) · ×1
  • TypeChecker.inferCall (cyclomatic 27) src/main/java/net/starlark/java/syntax/TypeChecker.java:586 — TypeChecker.inferCall 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 · TypeChecker.inferSlice (cyclomatic 27) · ×1
  • TypeChecker.inferSlice (cyclomatic 27) src/main/java/net/starlark/java/syntax/TypeChecker.java:420 — TypeChecker.inferSlice 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 · SimpleCycleDetector.checkForCycles (cyclomatic 27) · ×1
  • SimpleCycleDetector.checkForCycles (cyclomatic 27) src/main/java/com/google/devtools/build/skyframe/SimpleCycleDetector.java:92 — SimpleCycleDetector.checkForCycles 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 · ActionGraphDump.dumpSingleAction (cyclomatic 27) · ×1
  • ActionGraphDump.dumpSingleAction (cyclomatic 27) src/main/java/com/google/devtools/build/lib/skyframe/actiongraph/v2/ActionGraphDump.java:150 — ActionGraphDump.dumpSingleAction 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 · TargetPatternPhaseFunction.compute (cyclomatic 27) · ×1
  • TargetPatternPhaseFunction.compute (cyclomatic 27) src/main/java/com/google/devtools/build/lib/skyframe/TargetPatternPhaseFunction.java:76 — TargetPatternPhaseFunction.compute 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 · BuildDriverFunction.compute (cyclomatic 27) · ×1
  • BuildDriverFunction.compute (cyclomatic 27) src/main/java/com/google/devtools/build/lib/skyframe/BuildDriverFunction.java:157 — BuildDriverFunction.compute 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 · DumpCommand.exec (cyclomatic 27) · ×1
  • DumpCommand.exec (cyclomatic 27) src/main/java/com/google/devtools/build/lib/runtime/commands/DumpCommand.java:399 — DumpCommand.exec has cyclomatic complexity 27 (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 · UiStateTracker.describeAction (cyclomatic 27) · ×1
  • UiStateTracker.describeAction (cyclomatic 27) src/main/java/com/google/devtools/build/lib/runtime/UiStateTracker.java:819 — UiStateTracker.describeAction 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 · SymlinkForest.plantSymlinkForestMultiPackagePath (cyclomatic 27) · ×1
  • SymlinkForest.plantSymlinkForestMultiPackagePath (cyclomatic 27) src/main/java/com/google/devtools/build/lib/buildtool/SymlinkForest.java:146 — SymlinkForest.plantSymlinkForestMultiPackagePath 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 · ExecutionServer.execute (cyclomatic 26) · ×1
  • ExecutionServer.execute (cyclomatic 26) src/tools/remote/src/main/java/com/google/devtools/build/remote/worker/ExecutionServer.java:287 — ExecutionServer.execute 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 · StarlarkInt.parse (cyclomatic 26) · ×1
  • StarlarkInt.parse (cyclomatic 26) src/main/java/net/starlark/java/eval/StarlarkInt.java:104 — StarlarkInt.parse 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 · AqueryThreadsafeCallback.getReachableActions (cyclomatic 26) · ×1
  • AqueryThreadsafeCallback.getReachableActions (cyclomatic 26) src/main/java/com/google/devtools/build/lib/query2/aquery/AqueryThreadsafeCallback.java:65 — AqueryThreadsafeCallback.getReachableActions has cyclomatic complexity 26 (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 · Resolver.resolveFunction (cyclomatic 25) · ×1
  • Resolver.resolveFunction (cyclomatic 25) src/main/java/net/starlark/java/syntax/Resolver.java:1107 — Resolver.resolveFunction 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 · Hints.getPathLevelHintedInclusions (cyclomatic 25) · ×1
  • Hints.getPathLevelHintedInclusions (cyclomatic 25) src/main/java/com/google/devtools/build/lib/includescanning/IncludeParser.java:263 — Hints.getPathLevelHintedInclusions 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 · StarlarkRuleFunction.call (cyclomatic 25) · ×1
  • StarlarkRuleFunction.call (cyclomatic 25) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleClassFunctions.java:1795 — StarlarkRuleFunction.call 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 · TypeChecker.inferBinaryOperator (cyclomatic 24) · ×1
  • TypeChecker.inferBinaryOperator (cyclomatic 24) src/main/java/net/starlark/java/syntax/TypeChecker.java:516 — TypeChecker.inferBinaryOperator 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 · Parser.parsePrimary (cyclomatic 24) · ×1
  • Parser.parsePrimary (cyclomatic 24) src/main/java/net/starlark/java/syntax/Parser.java:685 — Parser.parsePrimary has cyclomatic complexity 24 (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 · Starlark.classType (cyclomatic 24) · ×1
  • Starlark.classType (cyclomatic 24) src/main/java/net/starlark/java/eval/Starlark.java:423 — Starlark.classType has cyclomatic complexity 24 (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 · OptionsParserImpl.identifyOptionAndPossibleArgument (cyclomatic 24) · ×1
  • OptionsParserImpl.identifyOptionAndPossibleArgument (cyclomatic 24) src/main/java/com/google/devtools/common/options/OptionsParserImpl.java:735 — OptionsParserImpl.identifyOptionAndPossibleArgument 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 · PackageFunction.loadPackage (cyclomatic 24) · ×1
  • PackageFunction.loadPackage (cyclomatic 24) src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java:994 — PackageFunction.loadPackage 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 · ConfiguredTargetFunction.compute (cyclomatic 24) · ×1
  • ConfiguredTargetFunction.compute (cyclomatic 24) src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetFunction.java:256 — ConfiguredTargetFunction.compute 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 · ActionOutputMetadataStore.constructTreeArtifactValueFromFilesystem (cyclomatic 24) · ×1
  • ActionOutputMetadataStore.constructTreeArtifactValueFromFilesystem (cyclomatic 24) src/main/java/com/google/devtools/build/lib/skyframe/ActionOutputMetadataStore.java:255 — ActionOutputMetadataStore.constructTreeArtifactValueFromFilesystem 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 · ActionExecutionFunction.computeInternal (cyclomatic 24) · ×1
  • ActionExecutionFunction.computeInternal (cyclomatic 24) src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java:223 — ActionExecutionFunction.computeInternal 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 · GenQueryPackageProviderFactory.constructPackageMapImpl (cyclomatic 24) · ×1
  • GenQueryPackageProviderFactory.constructPackageMapImpl (cyclomatic 24) src/main/java/com/google/devtools/build/lib/rules/genquery/GenQueryPackageProviderFactory.java:184 — GenQueryPackageProviderFactory.constructPackageMapImpl 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 · SubprocessHandler.start (cyclomatic 24) · ×1
  • SubprocessHandler.start (cyclomatic 24) src/main/java/com/google/devtools/build/lib/exec/local/LocalSpawnRunner.java:310 — SubprocessHandler.start has cyclomatic complexity 24 (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 · ExpandedSpawnLogContext.logSpawn (cyclomatic 24) · ×1
  • ExpandedSpawnLogContext.logSpawn (cyclomatic 24) src/main/java/com/google/devtools/build/lib/exec/ExpandedSpawnLogContext.java:156 — ExpandedSpawnLogContext.logSpawn 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 · CompressedTarFunction.decompress (cyclomatic 24) · ×1
  • CompressedTarFunction.decompress (cyclomatic 24) src/main/java/com/google/devtools/build/lib/bazel/repository/decompressor/CompressedTarFunction.java:68 — CompressedTarFunction.decompress 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 · CallableType.assignableFromHook (cyclomatic 23) · ×1
  • CallableType.assignableFromHook (cyclomatic 23) src/main/java/net/starlark/java/syntax/Types.java:613 — CallableType.assignableFromHook 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 · TypeTagger.extractTerm (cyclomatic 23) · ×1
  • TypeTagger.extractTerm (cyclomatic 23) src/main/java/net/starlark/java/syntax/TypeTagger.java:184 — TypeTagger.extractTerm 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 · ParallelEvaluator.bubbleErrorUp (cyclomatic 23) · ×1
  • ParallelEvaluator.bubbleErrorUp (cyclomatic 23) src/main/java/com/google/devtools/build/skyframe/ParallelEvaluator.java:293 — ParallelEvaluator.bubbleErrorUp 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 · Evaluate.maybeHandleDirtyNode (cyclomatic 23) · ×1
  • Evaluate.maybeHandleDirtyNode (cyclomatic 23) src/main/java/com/google/devtools/build/skyframe/AbstractParallelEvaluator.java:236 — Evaluate.maybeHandleDirtyNode 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 · DependencySet.process (cyclomatic 23) · ×1
  • DependencySet.process (cyclomatic 23) src/main/java/com/google/devtools/build/lib/util/DependencySet.java:131 — DependencySet.process 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 · WatchServiceDiffAwareness.collectChanges (cyclomatic 23) · ×1
  • WatchServiceDiffAwareness.collectChanges (cyclomatic 23) src/main/java/com/google/devtools/build/lib/skyframe/WatchServiceDiffAwareness.java:180 — WatchServiceDiffAwareness.collectChanges 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 · SkyframeExecutor.handleDiffsWithMissingDiffInformation (cyclomatic 23) · ×1
  • SkyframeExecutor.handleDiffsWithMissingDiffInformation (cyclomatic 23) src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java:4022 — SkyframeExecutor.handleDiffsWithMissingDiffInformation 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 · DependencyResolver.computeDependencies (cyclomatic 23) · ×1
  • DependencyResolver.computeDependencies (cyclomatic 23) src/main/java/com/google/devtools/build/lib/skyframe/DependencyResolver.java:672 — DependencyResolver.computeDependencies 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 · CompletionFunction.compute (cyclomatic 23) · ×1
  • CompletionFunction.compute (cyclomatic 23) src/main/java/com/google/devtools/build/lib/skyframe/CompletionFunction.java:152 — CompletionFunction.compute 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 · LinuxSandboxCommandLineBuilder.buildForCommand (cyclomatic 23) · ×1
  • LinuxSandboxCommandLineBuilder.buildForCommand (cyclomatic 23) src/main/java/com/google/devtools/build/lib/sandbox/LinuxSandboxCommandLineBuilder.java:233 — LinuxSandboxCommandLineBuilder.buildForCommand has cyclomatic complexity 23 (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 · BlazeRuntime.initProfiler (cyclomatic 23) · ×1
  • BlazeRuntime.initProfiler (cyclomatic 23) src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java:379 — BlazeRuntime.initProfiler 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 · HeaderDiscovery.runDiscovery (cyclomatic 23) · ×1
  • HeaderDiscovery.runDiscovery (cyclomatic 23) src/main/java/com/google/devtools/build/lib/rules/cpp/HeaderDiscovery.java:115 — HeaderDiscovery.runDiscovery 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 · UserDefinedFlagMatch.fromAttributeValueAndPrerequisites (cyclomatic 23) · ×1
  • UserDefinedFlagMatch.fromAttributeValueAndPrerequisites (cyclomatic 23) src/main/java/com/google/devtools/build/lib/rules/config/ConfigSetting.java:642 — UserDefinedFlagMatch.fromAttributeValueAndPrerequisites 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 · PostAnalysisQueryEnvironment.targetifyValues (cyclomatic 23) · ×1
  • PostAnalysisQueryEnvironment.targetifyValues (cyclomatic 23) src/main/java/com/google/devtools/build/lib/query2/PostAnalysisQueryEnvironment.java:668 — PostAnalysisQueryEnvironment.targetifyValues 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 · ActionConflictException.debugSuffix (cyclomatic 23) · ×1
  • ActionConflictException.debugSuffix (cyclomatic 23) src/main/java/com/google/devtools/build/lib/actions/ActionConflictException.java:254 — ActionConflictException.debugSuffix has cyclomatic complexity 23 (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 · NodePrinter.printStmt (cyclomatic 22) · ×1
  • NodePrinter.printStmt (cyclomatic 22) src/main/java/net/starlark/java/syntax/NodePrinter.java:159 — NodePrinter.printStmt 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 · Decoder.parse (cyclomatic 22) · ×1
  • Decoder.parse (cyclomatic 22) src/main/java/net/starlark/java/lib/json/Json.java:374 — Decoder.parse 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 · Indenter.indent (cyclomatic 22) · ×1
  • Indenter.indent (cyclomatic 22) src/main/java/net/starlark/java/lib/json/Json.java:716 — Indenter.indent 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 · UnixGlob.makePatternFromWildcard (cyclomatic 22) · ×1
  • UnixGlob.makePatternFromWildcard (cyclomatic 22) src/main/java/com/google/devtools/build/lib/vfs/UnixGlob.java:262 — UnixGlob.makePatternFromWildcard has cyclomatic complexity 22 (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 · AttributeInfoExtractor.getAttributeType (cyclomatic 22) · ×1
  • AttributeInfoExtractor.getAttributeType (cyclomatic 22) src/main/java/com/google/devtools/build/lib/starlarkdocextract/AttributeInfoExtractor.java:111 — AttributeInfoExtractor.getAttributeType has cyclomatic complexity 22 (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 · RunCommand.getBuiltTargets (cyclomatic 22) · ×1
  • RunCommand.getBuiltTargets (cyclomatic 22) src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java:436 — RunCommand.getBuiltTargets 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 · TestSummaryPrinter.print (cyclomatic 22) · ×1
  • TestSummaryPrinter.print (cyclomatic 22) src/main/java/com/google/devtools/build/lib/runtime/TestSummaryPrinter.java:135 — TestSummaryPrinter.print 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 · QueryParser.parsePrimary (cyclomatic 22) · ×1
  • QueryParser.parsePrimary (cyclomatic 22) src/main/java/com/google/devtools/build/lib/query2/engine/QueryParser.java:271 — QueryParser.parsePrimary 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 · ActionGraphTextOutputFormatterCallback.writeText (cyclomatic 22) · ×1
  • ActionGraphTextOutputFormatterCallback.writeText (cyclomatic 22) src/main/java/com/google/devtools/build/lib/query2/aquery/ActionGraphTextOutputFormatterCallback.java:167 — ActionGraphTextOutputFormatterCallback.writeText 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 · AttributeProvider.populateDefaultRuleAttributeValues (cyclomatic 22) · ×1
  • AttributeProvider.populateDefaultRuleAttributeValues (cyclomatic 22) src/main/java/com/google/devtools/build/lib/packages/AttributeProvider.java:298 — AttributeProvider.populateDefaultRuleAttributeValues 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 · NestedSetBuilder.buildInternal (cyclomatic 22) · ×1
  • NestedSetBuilder.buildInternal (cyclomatic 22) src/main/java/com/google/devtools/build/lib/collect/nestedset/NestedSetBuilder.java:221 — NestedSetBuilder.buildInternal 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 · LabelValidator.validateTargetName (cyclomatic 22) · ×1
  • LabelValidator.validateTargetName (cyclomatic 22) src/main/java/com/google/devtools/build/lib/cmdline/LabelValidator.java:146 — LabelValidator.validateTargetName 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 · RepositoryFetchFunction.fetch (cyclomatic 22) · ×1
  • RepositoryFetchFunction.fetch (cyclomatic 22) src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryFetchFunction.java:602 — RepositoryFetchFunction.fetch has cyclomatic complexity 22 (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 · CompactPersistentActionCache.decodeInternal (cyclomatic 22) · ×1
  • CompactPersistentActionCache.decodeInternal (cyclomatic 22) src/main/java/com/google/devtools/build/lib/actions/cache/CompactPersistentActionCache.java:999 — CompactPersistentActionCache.decodeInternal 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 · Decoder.parseString (cyclomatic 21) · ×1
  • Decoder.parseString (cyclomatic 21) src/main/java/net/starlark/java/lib/json/Json.java:485 — Decoder.parseString 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 · WorkerSpawnRunner.execInWorker (cyclomatic 21) · ×1
  • WorkerSpawnRunner.execInWorker (cyclomatic 21) src/main/java/com/google/devtools/build/lib/worker/WorkerSpawnRunner.java:380 — WorkerSpawnRunner.execInWorker 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 · WindowsOsPathPolicy.needsToNormalize (cyclomatic 21) · ×1
  • WindowsOsPathPolicy.needsToNormalize (cyclomatic 21) src/main/java/com/google/devtools/build/lib/vfs/WindowsOsPathPolicy.java:78 — WindowsOsPathPolicy.needsToNormalize 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 · NodeDependencyHandler.reduce (cyclomatic 21) · ×1
  • NodeDependencyHandler.reduce (cyclomatic 21) src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/FileDependencySerializer.java:955 — NodeDependencyHandler.reduce 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 · ArtifactFunction.createSourceValue (cyclomatic 21) · ×1
  • ArtifactFunction.createSourceValue (cyclomatic 21) src/main/java/com/google/devtools/build/lib/skyframe/ArtifactFunction.java:311 — ArtifactFunction.createSourceValue has cyclomatic complexity 21 (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 · ShellUtils.windowsEscapeArg (cyclomatic 21) · ×1
  • ShellUtils.windowsEscapeArg (cyclomatic 21) src/main/java/com/google/devtools/build/lib/shell/ShellUtils.java:186 — ShellUtils.windowsEscapeArg 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 · SandboxStash.takeStashedSandboxInternal (cyclomatic 21) · ×1
  • SandboxStash.takeStashedSandboxInternal (cyclomatic 21) src/main/java/com/google/devtools/build/lib/sandbox/SandboxStash.java:116 — SandboxStash.takeStashedSandboxInternal 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 · RemoteSpawnRunner.exec (cyclomatic 21) · ×1
  • RemoteSpawnRunner.exec (cyclomatic 21) src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java:182 — RemoteSpawnRunner.exec 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 · InclusionCache.locateOnPaths (cyclomatic 21) · ×1
  • InclusionCache.locateOnPaths (cyclomatic 21) src/main/java/com/google/devtools/build/lib/includescanning/LegacyIncludeScanner.java:124 — InclusionCache.locateOnPaths 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 · BuildTool.processRequestHandleCheckedExceptions (cyclomatic 21) · ×1
  • BuildTool.processRequestHandleCheckedExceptions (cyclomatic 21) src/main/java/com/google/devtools/build/lib/buildtool/BuildTool.java:1005 — BuildTool.processRequestHandleCheckedExceptions has cyclomatic complexity 21 (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 · Builder.createTargetMap (cyclomatic 21) · ×1
  • Builder.createTargetMap (cyclomatic 21) src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java:1750 — Builder.createTargetMap 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 · StarlarkFloat.format (cyclomatic 20) · ×1
  • StarlarkFloat.format (cyclomatic 20) src/main/java/net/starlark/java/eval/StarlarkFloat.java:130 — StarlarkFloat.format 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 · ParsedFlagsFunction.compute (cyclomatic 20) · ×1
  • ParsedFlagsFunction.compute (cyclomatic 20) src/main/java/com/google/devtools/build/lib/skyframe/config/ParsedFlagsFunction.java:64 — ParsedFlagsFunction.compute 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 · FilesystemValueChecker.batchStatJob (cyclomatic 20) · ×1
  • FilesystemValueChecker.batchStatJob (cyclomatic 20) src/main/java/com/google/devtools/build/lib/skyframe/FilesystemValueChecker.java:314 — FilesystemValueChecker.batchStatJob 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 · EvalMacroFunction.compute (cyclomatic 20) · ×1
  • EvalMacroFunction.compute (cyclomatic 20) src/main/java/com/google/devtools/build/lib/skyframe/EvalMacroFunction.java:71 — EvalMacroFunction.compute has cyclomatic complexity 20 (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 · VirtualCgroup.createRoot (cyclomatic 20) · ×1
  • VirtualCgroup.createRoot (cyclomatic 20) src/main/java/com/google/devtools/build/lib/sandbox/cgroups/VirtualCgroup.java:131 — VirtualCgroup.createRoot 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 · MemoryModeConverter.convert (cyclomatic 20) · ×1
  • MemoryModeConverter.convert (cyclomatic 20) src/main/java/com/google/devtools/build/lib/runtime/commands/DumpCommand.java:195 — MemoryModeConverter.convert has cyclomatic complexity 20 (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 · BuildEventStreamer.post (cyclomatic 20) · ×1
  • BuildEventStreamer.post (cyclomatic 20) src/main/java/com/google/devtools/build/lib/runtime/BuildEventStreamer.java:337 — BuildEventStreamer.post 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 · Builder.build (cyclomatic 20) · ×1
  • Builder.build (cyclomatic 20) src/main/java/com/google/devtools/build/lib/rules/java/JavaHeaderCompileAction.java:435 — Builder.build 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 · CppConfiguration.<init> (cyclomatic 20) · ×1
  • CppConfiguration.<init> (cyclomatic 20) src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java:169 — CppConfiguration.<init> 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 · Rule.populateOutputFilesInternal (cyclomatic 20) · ×1
  • Rule.populateOutputFilesInternal (cyclomatic 20) src/main/java/com/google/devtools/build/lib/packages/Rule.java:518 — Rule.populateOutputFilesInternal 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 · ProxyHelper.createProxyInfo (cyclomatic 20) · ×1
  • ProxyHelper.createProxyInfo (cyclomatic 20) src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/ProxyHelper.java:233 — ProxyHelper.createProxyInfo 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 · PatchUtil.getLineType (cyclomatic 20) · ×1
  • PatchUtil.getLineType (cyclomatic 20) src/main/java/com/google/devtools/build/lib/bazel/repository/decompressor/PatchUtil.java:109 — PatchUtil.getLineType 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 · BuildView.update (cyclomatic 20) · ×1
  • BuildView.update (cyclomatic 20) src/main/java/com/google/devtools/build/lib/analysis/BuildView.java:224 — BuildView.update 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 · Encoder.encode (cyclomatic 19) · ×1
  • Encoder.encode (cyclomatic 19) src/main/java/net/starlark/java/lib/json/Json.java:121 — Encoder.encode has cyclomatic complexity 19 (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 · ArgumentProcessor.call (cyclomatic 19) · ×1
  • ArgumentProcessor.call (cyclomatic 19) src/main/java/net/starlark/java/eval/StarlarkFunction.java:581 — ArgumentProcessor.call 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 · MethodLibrary.floatForStarlark (cyclomatic 19) · ×1
  • MethodLibrary.floatForStarlark (cyclomatic 19) src/main/java/net/starlark/java/eval/MethodLibrary.java:555 — MethodLibrary.floatForStarlark 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 · RewindableGraphInconsistencyReceiver.noteInconsistencyAndMaybeThrow (cyclomatic 19) · ×1
  • RewindableGraphInconsistencyReceiver.noteInconsistencyAndMaybeThrow (cyclomatic 19) src/main/java/com/google/devtools/build/lib/skyframe/rewinding/RewindableGraphInconsistencyReceiver.java:65 — RewindableGraphInconsistencyReceiver.noteInconsistencyAndMaybeThrow 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 · ParsedFlagsFunction.checkPackageVisibility (cyclomatic 19) · ×1
  • ParsedFlagsFunction.checkPackageVisibility (cyclomatic 19) src/main/java/com/google/devtools/build/lib/skyframe/config/ParsedFlagsFunction.java:171 — ParsedFlagsFunction.checkPackageVisibility 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 · SkyframeExecutor.processDiscardAndDetermineRemoval (cyclomatic 19) · ×1
  • SkyframeExecutor.processDiscardAndDetermineRemoval (cyclomatic 19) src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java:1441 — SkyframeExecutor.processDiscardAndDetermineRemoval 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 · SkyframeBuildView.configureTargets (cyclomatic 19) · ×1
  • SkyframeBuildView.configureTargets (cyclomatic 19) src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java:402 — SkyframeBuildView.configureTargets 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 · RecursiveFilesystemTraversalFunction.compute (cyclomatic 19) · ×1
  • RecursiveFilesystemTraversalFunction.compute (cyclomatic 19) src/main/java/com/google/devtools/build/lib/skyframe/RecursiveFilesystemTraversalFunction.java:180 — RecursiveFilesystemTraversalFunction.compute 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 · CommandServer.run (cyclomatic 19) · ×1
  • CommandServer.run (cyclomatic 19) src/main/java/com/google/devtools/build/lib/server/CommandServer.java:427 — CommandServer.run 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 · SandboxModule.setup (cyclomatic 19) · ×1
  • SandboxModule.setup (cyclomatic 19) src/main/java/com/google/devtools/build/lib/sandbox/SandboxModule.java:198 — SandboxModule.setup has cyclomatic complexity 19 (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 · TargetPatternsHelper.readFrom (cyclomatic 19) · ×1
  • TargetPatternsHelper.readFrom (cyclomatic 19) src/main/java/com/google/devtools/build/lib/runtime/commands/TargetPatternsHelper.java:68 — TargetPatternsHelper.readFrom has cyclomatic complexity 19 (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 · QueryCommand.doQuery (cyclomatic 19) · ×1
  • QueryCommand.doQuery (cyclomatic 19) src/main/java/com/google/devtools/build/lib/runtime/commands/QueryCommand.java:76 — QueryCommand.doQuery has cyclomatic complexity 19 (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 · BlazeRuntime.deleteOutputBase (cyclomatic 19) · ×1
  • BlazeRuntime.deleteOutputBase (cyclomatic 19) src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java:2069 — BlazeRuntime.deleteOutputBase has cyclomatic complexity 19 (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 · JavaUtil.javaSegmentIndexImpl (cyclomatic 19) · ×1
  • JavaUtil.javaSegmentIndexImpl (cyclomatic 19) src/main/java/com/google/devtools/build/lib/rules/java/JavaUtil.java:89 — JavaUtil.javaSegmentIndexImpl 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 · CompileOneDependencyTransformer.transformCompileOneDependency (cyclomatic 19) · ×1
  • CompileOneDependencyTransformer.transformCompileOneDependency (cyclomatic 19) src/main/java/com/google/devtools/build/lib/pkgcache/CompileOneDependencyTransformer.java:88 — CompileOneDependencyTransformer.transformCompileOneDependency 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 · Builder.<init> (cyclomatic 19) · ×1
  • Builder.<init> (cyclomatic 19) src/main/java/com/google/devtools/build/lib/packages/RuleClass.java:765 — Builder.<init> 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 · ImplicitOutputsFunction.attributeValues (cyclomatic 19) · ×1
  • ImplicitOutputsFunction.attributeValues (cyclomatic 19) src/main/java/com/google/devtools/build/lib/packages/ImplicitOutputsFunction.java:374 — ImplicitOutputsFunction.attributeValues 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 · TextOutputFormatter.printModule (cyclomatic 19) · ×1
  • TextOutputFormatter.printModule (cyclomatic 19) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/modcommand/TextOutputFormatter.java:143 — TextOutputFormatter.printModule has cyclomatic complexity 19 (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 · ModuleFileFunction.advanceHorizon (cyclomatic 19) · ×1
  • ModuleFileFunction.advanceHorizon (cyclomatic 19) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleFileFunction.java:413 — ModuleFileFunction.advanceHorizon 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 · ModuleExtensionMetadata.create (cyclomatic 19) · ×1
  • ModuleExtensionMetadata.create (cyclomatic 19) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleExtensionMetadata.java:88 — ModuleExtensionMetadata.create 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 · GoogleAuthUtils.newChannel (cyclomatic 19) · ×1
  • GoogleAuthUtils.newChannel (cyclomatic 19) src/main/java/com/google/devtools/build/lib/authandtls/GoogleAuthUtils.java:74 — GoogleAuthUtils.newChannel 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 · VectorArg.addToFingerprint (cyclomatic 19) · ×1
  • VectorArg.addToFingerprint (cyclomatic 19) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkCustomCommandLine.java:602 — VectorArg.addToFingerprint 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 · Eval.inplaceBinaryOp (cyclomatic 18) · ×1
  • Eval.inplaceBinaryOp (cyclomatic 18) src/main/java/net/starlark/java/eval/Eval.java:558 — Eval.inplaceBinaryOp 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. This is NOT this file's highest cyclomatic complexity: Eval.eval (cyclomatic 23) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · WorkerModule.buildStarting (cyclomatic 18) · ×1
  • WorkerModule.buildStarting (cyclomatic 18) src/main/java/com/google/devtools/build/lib/worker/WorkerModule.java:90 — WorkerModule.buildStarting 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 · JsonWorkerMessageProcessor.readWorkRequest (cyclomatic 18) · ×1
  • JsonWorkerMessageProcessor.readWorkRequest (cyclomatic 18) src/main/java/com/google/devtools/build/lib/worker/JsonWorkerMessageProcessor.java:103 — JsonWorkerMessageProcessor.readWorkRequest 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 · InMemoryFileSystem.pathWalkErrno (cyclomatic 18) · ×1
  • InMemoryFileSystem.pathWalkErrno (cyclomatic 18) src/main/java/com/google/devtools/build/lib/vfs/inmemoryfs/InMemoryFileSystem.java:240 — InMemoryFileSystem.pathWalkErrno 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 · GlobVisitor.reallyGlob (cyclomatic 18) · ×1
  • GlobVisitor.reallyGlob (cyclomatic 18) src/main/java/com/google/devtools/build/lib/vfs/UnixGlob.java:776 — GlobVisitor.reallyGlob 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 · ObjectGraphTraverser.process (cyclomatic 18) · ×1
  • ObjectGraphTraverser.process (cyclomatic 18) src/main/java/com/google/devtools/build/lib/util/ObjectGraphTraverser.java:407 — ObjectGraphTraverser.process 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 · SkyframeBuildView.analyzeAndExecuteTargets (cyclomatic 18) · ×1
  • SkyframeBuildView.analyzeAndExecuteTargets (cyclomatic 18) src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java:620 — SkyframeBuildView.analyzeAndExecuteTargets 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 · DefaultSyscallCache.getType (cyclomatic 18) · ×1
  • DefaultSyscallCache.getType (cyclomatic 18) src/main/java/com/google/devtools/build/lib/skyframe/DefaultSyscallCache.java:191 — DefaultSyscallCache.getType 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 · CleanCommand.actuallyClean (cyclomatic 18) · ×1
  • CleanCommand.actuallyClean (cyclomatic 18) src/main/java/com/google/devtools/build/lib/runtime/commands/CleanCommand.java:194 — CleanCommand.actuallyClean has cyclomatic complexity 18 (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 · UiStateTracker.writeProgressBar (cyclomatic 18) · ×1
  • UiStateTracker.writeProgressBar (cyclomatic 18) src/main/java/com/google/devtools/build/lib/runtime/UiStateTracker.java:1388 — UiStateTracker.writeProgressBar 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 · ActionDumpWriter.maybeAddEdges (cyclomatic 18) · ×1
  • ActionDumpWriter.maybeAddEdges (cyclomatic 18) src/main/java/com/google/devtools/build/lib/runtime/ExecutionGraphModule.java:573 — ActionDumpWriter.maybeAddEdges 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 · DiskCacheClient.refreshActionResult (cyclomatic 18) · ×1
  • DiskCacheClient.refreshActionResult (cyclomatic 18) src/main/java/com/google/devtools/build/lib/remote/disk/DiskCacheClient.java:253 — DiskCacheClient.refreshActionResult 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 · MacroClass.instantiateMacro (cyclomatic 18) · ×1
  • MacroClass.instantiateMacro (cyclomatic 18) src/main/java/com/google/devtools/build/lib/packages/MacroClass.java:210 — MacroClass.instantiateMacro 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 · IncludeParser.extractInclusion (cyclomatic 18) · ×1
  • IncludeParser.extractInclusion (cyclomatic 18) src/main/java/com/google/devtools/build/lib/includescanning/IncludeParser.java:756 — IncludeParser.extractInclusion 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 · DownloadManager.downloadAndReadOneUrlForBzlmod (cyclomatic 18) · ×1
  • DownloadManager.downloadAndReadOneUrlForBzlmod (cyclomatic 18) src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/DownloadManager.java:409 — DownloadManager.downloadAndReadOneUrlForBzlmod 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 · ModCommand.validateArgs (cyclomatic 18) · ×1
  • ModCommand.validateArgs (cyclomatic 18) src/main/java/com/google/devtools/build/lib/bazel/commands/ModCommand.java:142 — ModCommand.validateArgs 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 · IndexRegistry.createArchiveRepoSpec (cyclomatic 18) · ×1
  • IndexRegistry.createArchiveRepoSpec (cyclomatic 18) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/IndexRegistry.java:472 — IndexRegistry.createArchiveRepoSpec 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 · TestRunnerAction.getTestOutputsMapping (cyclomatic 18) · ×1
  • TestRunnerAction.getTestOutputsMapping (cyclomatic 18) src/main/java/com/google/devtools/build/lib/analysis/test/TestRunnerAction.java:418 — TestRunnerAction.getTestOutputsMapping 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 · StarlarkRuleContext.<init> (cyclomatic 18) · ×1
  • StarlarkRuleContext.<init> (cyclomatic 18) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleContext.java:195 — StarlarkRuleContext.<init> 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 · StarlarkRuleConfiguredTargetUtil.addProviders (cyclomatic 18) · ×1
  • StarlarkRuleConfiguredTargetUtil.addProviders (cyclomatic 18) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleConfiguredTargetUtil.java:239 — StarlarkRuleConfiguredTargetUtil.addProviders 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 · StarlarkActionFactory.symlink (cyclomatic 18) · ×1
  • StarlarkActionFactory.symlink (cyclomatic 18) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkActionFactory.java:259 — StarlarkActionFactory.symlink 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 · VectorArgFragment.eval (cyclomatic 18) · ×1
  • VectorArgFragment.eval (cyclomatic 18) src/main/java/com/google/devtools/build/lib/analysis/actions/CustomCommandLine.java:395 — VectorArgFragment.eval has cyclomatic complexity 18 (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 · mirror_external_deps.collect_candidates (cyclomatic 18) · ×1
  • mirror_external_deps.collect_candidates (cyclomatic 18) tools/mirror_external_deps.py:185 — mirror_external_deps.collect_candidates 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 · Resolver.createBindings (cyclomatic 17) · ×1
  • Resolver.createBindings (cyclomatic 17) src/main/java/net/starlark/java/syntax/Resolver.java:649 — Resolver.createBindings has cyclomatic complexity 17 (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 · Resolver.visit (cyclomatic 17) · ×1
  • Resolver.visit (cyclomatic 17) src/main/java/net/starlark/java/syntax/Resolver.java:783 — Resolver.visit 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 · MethodDescriptor.call (cyclomatic 17) · ×1
  • MethodDescriptor.call (cyclomatic 17) src/main/java/net/starlark/java/eval/MethodDescriptor.java:400 — MethodDescriptor.call 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 · Eval.evalCall (cyclomatic 17) · ×1
  • Eval.evalCall (cyclomatic 17) src/main/java/net/starlark/java/eval/Eval.java:743 — Eval.evalCall 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. This is NOT this file's highest cyclomatic complexity: Eval.eval (cyclomatic 23) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · StarlarkMethodProcessor.checkParameter (cyclomatic 17) · ×1
  • StarlarkMethodProcessor.checkParameter (cyclomatic 17) src/main/java/net/starlark/java/annot/processor/StarlarkMethodProcessor.java:400 — StarlarkMethodProcessor.checkParameter 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 · OptionsClassProcessor.generateWrapper (cyclomatic 17) · ×1
  • OptionsClassProcessor.generateWrapper (cyclomatic 17) src/main/java/com/google/devtools/common/options/processor/OptionsClassProcessor.java:151 — OptionsClassProcessor.generateWrapper 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 · WaitForNestedNodeBytes.apply (cyclomatic 17) · ×1
  • WaitForNestedNodeBytes.apply (cyclomatic 17) src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/FileDependencyDeserializer.java:596 — WaitForNestedNodeBytes.apply 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 (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 · StarlarkBuildSettingsDetailsFunction.compute (cyclomatic 17) · ×1
  • StarlarkBuildSettingsDetailsFunction.compute (cyclomatic 17) src/main/java/com/google/devtools/build/lib/skyframe/StarlarkBuildSettingsDetailsFunction.java:59 — StarlarkBuildSettingsDetailsFunction.compute 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 · SkymeldModule.determineIfMergingAnalysisExecution (cyclomatic 17) · ×1
  • SkymeldModule.determineIfMergingAnalysisExecution (cyclomatic 17) src/main/java/com/google/devtools/build/lib/skyframe/SkymeldModule.java:34 — SkymeldModule.determineIfMergingAnalysisExecution has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · SkyValueRetrieverUtils.retrieveRemoteSkyValue (cyclomatic 17) · ×1
  • SkyValueRetrieverUtils.retrieveRemoteSkyValue (cyclomatic 17) src/main/java/com/google/devtools/build/lib/skyframe/SkyValueRetrieverUtils.java:50 — SkyValueRetrieverUtils.retrieveRemoteSkyValue 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 · RecursiveFilesystemTraversalFunction.lookUpFileInfo (cyclomatic 17) · ×1
  • RecursiveFilesystemTraversalFunction.lookUpFileInfo (cyclomatic 17) src/main/java/com/google/devtools/build/lib/skyframe/RecursiveFilesystemTraversalFunction.java:335 — RecursiveFilesystemTraversalFunction.lookUpFileInfo 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 · FileSystemValueCheckerInferringAncestors.visitEntry (cyclomatic 17) · ×1
  • FileSystemValueCheckerInferringAncestors.visitEntry (cyclomatic 17) src/main/java/com/google/devtools/build/lib/skyframe/FileSystemValueCheckerInferringAncestors.java:287 — FileSystemValueCheckerInferringAncestors.visitEntry 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 · ActionExecutionFunction.checkCacheAndExecuteIfNeeded (cyclomatic 17) · ×1
  • ActionExecutionFunction.checkCacheAndExecuteIfNeeded (cyclomatic 17) src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java:669 — ActionExecutionFunction.checkCacheAndExecuteIfNeeded 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 · RunCommand.exec (cyclomatic 17) · ×1
  • RunCommand.exec (cyclomatic 17) src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java:249 — RunCommand.exec 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 · TestResultAggregator.incrementalAnalyze (cyclomatic 17) · ×1
  • TestResultAggregator.incrementalAnalyze (cyclomatic 17) src/main/java/com/google/devtools/build/lib/runtime/TestResultAggregator.java:165 — TestResultAggregator.incrementalAnalyze 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 · TerminalTestResultNotifier.notify (cyclomatic 17) · ×1
  • TerminalTestResultNotifier.notify (cyclomatic 17) src/main/java/com/google/devtools/build/lib/runtime/TerminalTestResultNotifier.java:176 — TerminalTestResultNotifier.notify has cyclomatic complexity 17 (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 · ConfigExpander.expandConfigOptions (cyclomatic 17) · ×1
  • ConfigExpander.expandConfigOptions (cyclomatic 17) src/main/java/com/google/devtools/build/lib/runtime/ConfigExpander.java:93 — ConfigExpander.expandConfigOptions 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 · BlazeOptionHandler.structureRcOptionsAndConfigs (cyclomatic 17) · ×1
  • BlazeOptionHandler.structureRcOptionsAndConfigs (cyclomatic 17) src/main/java/com/google/devtools/build/lib/runtime/BlazeOptionHandler.java:730 — BlazeOptionHandler.structureRcOptionsAndConfigs 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 · BlazeCommandDispatcher.exec (cyclomatic 17) · ×1
  • BlazeCommandDispatcher.exec (cyclomatic 17) src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java:193 — BlazeCommandDispatcher.exec 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 · RemoteExecutionService.waitForAndReuseOutputs (cyclomatic 17) · ×1
  • RemoteExecutionService.waitForAndReuseOutputs (cyclomatic 17) src/main/java/com/google/devtools/build/lib/remote/RemoteExecutionService.java:1671 — RemoteExecutionService.waitForAndReuseOutputs 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 · TaskData.writeTraceData (cyclomatic 17) · ×1
  • TaskData.writeTraceData (cyclomatic 17) src/main/java/com/google/devtools/build/lib/profiler/TaskData.java:74 — TaskData.writeTraceData 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 · 3.extractGlobPatterns (cyclomatic 17) · ×1
  • 3.extractGlobPatterns (cyclomatic 17) src/main/java/com/google/devtools/build/lib/packages/PackageFactory.java:609 — 3.extractGlobPatterns 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 · AggregatingAttributeMapper.checkForDuplicateLabels (cyclomatic 17) · ×1
  • AggregatingAttributeMapper.checkForDuplicateLabels (cyclomatic 17) src/main/java/com/google/devtools/build/lib/packages/AggregatingAttributeMapper.java:241 — AggregatingAttributeMapper.checkForDuplicateLabels has cyclomatic complexity 17 (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 · AggregatingAttributeMapper.visitLabels (cyclomatic 17) · ×1
  • AggregatingAttributeMapper.visitLabels (cyclomatic 17) src/main/java/com/google/devtools/build/lib/packages/AggregatingAttributeMapper.java:107 — AggregatingAttributeMapper.visitLabels 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 · TestXmlOutputParser.parseContainedElements (cyclomatic 17) · ×1
  • TestXmlOutputParser.parseContainedElements (cyclomatic 17) src/main/java/com/google/devtools/build/lib/exec/TestXmlOutputParser.java:222 — TestXmlOutputParser.parseContainedElements 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 · AbstractSpawnStrategy.exec (cyclomatic 17) · ×1
  • AbstractSpawnStrategy.exec (cyclomatic 17) src/main/java/com/google/devtools/build/lib/exec/AbstractSpawnStrategy.java:101 — AbstractSpawnStrategy.exec 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 · ModuleFileFunction.getModuleFile (cyclomatic 17) · ×1
  • ModuleFileFunction.getModuleFile (cyclomatic 17) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleFileFunction.java:816 — ModuleFileFunction.getModuleFile 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 · FunctionTransitionUtil.applyStarlarkFlagsAliases (cyclomatic 17) · ×1
  • FunctionTransitionUtil.applyStarlarkFlagsAliases (cyclomatic 17) src/main/java/com/google/devtools/build/lib/analysis/starlark/FunctionTransitionUtil.java:345 — FunctionTransitionUtil.applyStarlarkFlagsAliases 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 · OptionsDiffCodec.serialize (cyclomatic 17) · ×1
  • OptionsDiffCodec.serialize (cyclomatic 17) src/main/java/com/google/devtools/build/lib/analysis/config/OptionsDiff.java:667 — OptionsDiffCodec.serialize 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 · LocationExpander.buildLocationMap (cyclomatic 17) · ×1
  • LocationExpander.buildLocationMap (cyclomatic 17) src/main/java/com/google/devtools/build/lib/analysis/LocationExpander.java:420 — LocationExpander.buildLocationMap has cyclomatic complexity 17 (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 · CommonPrerequisiteValidator.validateDirectPrerequisiteVisibility (cyclomatic 17) · ×1
  • CommonPrerequisiteValidator.validateDirectPrerequisiteVisibility (cyclomatic 17) src/main/java/com/google/devtools/build/lib/analysis/CommonPrerequisiteValidator.java:187 — CommonPrerequisiteValidator.validateDirectPrerequisiteVisibility 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 · ActionExecutedEvent.asStreamProto (cyclomatic 17) · ×1
  • ActionExecutedEvent.asStreamProto (cyclomatic 17) src/main/java/com/google/devtools/build/lib/actions/ActionExecutedEvent.java:175 — ActionExecutedEvent.asStreamProto 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 · BuildDocCollector.processJavaSourceRuleAttributeDocs (cyclomatic 17) · ×1
  • BuildDocCollector.processJavaSourceRuleAttributeDocs (cyclomatic 17) src/main/java/com/google/devtools/build/docgen/BuildDocCollector.java:200 — BuildDocCollector.processJavaSourceRuleAttributeDocs 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 · Lexer.stringLiteral (cyclomatic 16) · ×1
  • Lexer.stringLiteral (cyclomatic 16) src/main/java/net/starlark/java/syntax/Lexer.java:436 — Lexer.stringLiteral 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. This is NOT this file's highest cyclomatic complexity: Lexer.scanIdentifier (cyclomatic 65) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · MethodDescriptor.buildStarlarkType (cyclomatic 16) · ×1
  • MethodDescriptor.buildStarlarkType (cyclomatic 16) src/main/java/net/starlark/java/eval/MethodDescriptor.java:159 — MethodDescriptor.buildStarlarkType 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 · Main.main (cyclomatic 16) · ×1
  • Main.main (cyclomatic 16) src/main/java/net/starlark/java/cmd/Main.java:171 — Main.main 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 · SingleOptionValueDescription.addOptionInstance (cyclomatic 16) · ×1
  • SingleOptionValueDescription.addOptionInstance (cyclomatic 16) src/main/java/com/google/devtools/common/options/OptionValueDescription.java:208 — SingleOptionValueDescription.addOptionInstance 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 · PathFragment.isNormalizedImpl (cyclomatic 16) · ×1
  • PathFragment.isNormalizedImpl (cyclomatic 16) src/main/java/com/google/devtools/build/lib/vfs/PathFragment.java:879 — PathFragment.isNormalizedImpl 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 · PathFragment.subFragmentImpl (cyclomatic 16) · ×1
  • PathFragment.subFragmentImpl (cyclomatic 16) src/main/java/com/google/devtools/build/lib/vfs/PathFragment.java:652 — PathFragment.subFragmentImpl 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 · CommandFailureUtils.describeCommand (cyclomatic 16) · ×1
  • CommandFailureUtils.describeCommand (cyclomatic 16) src/main/java/com/google/devtools/build/lib/util/CommandFailureUtils.java:44 — CommandFailureUtils.describeCommand 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 · AnsiStrippingOutputStream.processByte (cyclomatic 16) · ×1
  • AnsiStrippingOutputStream.processByte (cyclomatic 16) src/main/java/com/google/devtools/build/lib/util/AnsiStrippingOutputStream.java:90 — AnsiStrippingOutputStream.processByte 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 · SkyframeProgressReceiver.evaluated (cyclomatic 16) · ×1
  • SkyframeProgressReceiver.evaluated (cyclomatic 16) src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java:3622 — SkyframeProgressReceiver.evaluated 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 · ProcessPackageDirectory.getPackageExistenceAndSubdirDeps (cyclomatic 16) · ×1
  • ProcessPackageDirectory.getPackageExistenceAndSubdirDeps (cyclomatic 16) src/main/java/com/google/devtools/build/lib/skyframe/ProcessPackageDirectory.java:78 — ProcessPackageDirectory.getPackageExistenceAndSubdirDeps 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 · GlobsFunction.compute (cyclomatic 16) · ×1
  • GlobsFunction.compute (cyclomatic 16) src/main/java/com/google/devtools/build/lib/skyframe/GlobsFunction.java:108 — GlobsFunction.compute 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 · BzlLoadFunction.computeInternalWithCompiledBzl (cyclomatic 16) · ×1
  • BzlLoadFunction.computeInternalWithCompiledBzl (cyclomatic 16) src/main/java/com/google/devtools/build/lib/skyframe/BzlLoadFunction.java:757 — BzlLoadFunction.computeInternalWithCompiledBzl 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 · BuildOptionsScopeFunction.compute (cyclomatic 16) · ×1
  • BuildOptionsScopeFunction.compute (cyclomatic 16) src/main/java/com/google/devtools/build/lib/skyframe/BuildOptionsScopeFunction.java:61 — BuildOptionsScopeFunction.compute 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 · ActionExecutionFunction.addDiscoveredInputs (cyclomatic 16) · ×1
  • ActionExecutionFunction.addDiscoveredInputs (cyclomatic 16) src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java:874 — ActionExecutionFunction.addDiscoveredInputs 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 · TestCommand.doTest (cyclomatic 16) · ×1
  • TestCommand.doTest (cyclomatic 16) src/main/java/com/google/devtools/build/lib/runtime/commands/TestCommand.java:128 — TestCommand.doTest 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 · ConfigSetting.optionMatches (cyclomatic 16) · ×1
  • ConfigSetting.optionMatches (cyclomatic 16) src/main/java/com/google/devtools/build/lib/rules/config/ConfigSetting.java:518 — ConfigSetting.optionMatches 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 · RemoteExecutionService.initUseOutputPaths (cyclomatic 16) · ×1
  • RemoteExecutionService.initUseOutputPaths (cyclomatic 16) src/main/java/com/google/devtools/build/lib/remote/RemoteExecutionService.java:461 — RemoteExecutionService.initUseOutputPaths 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 · XmlOutputFormatter.createTargetElement (cyclomatic 16) · ×1
  • XmlOutputFormatter.createTargetElement (cyclomatic 16) src/main/java/com/google/devtools/build/lib/query2/query/output/XmlOutputFormatter.java:147 — XmlOutputFormatter.createTargetElement 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 · JsonTraceFileWriter.run (cyclomatic 16) · ×1
  • JsonTraceFileWriter.run (cyclomatic 16) src/main/java/com/google/devtools/build/lib/profiler/JsonTraceFileWriter.java:252 — JsonTraceFileWriter.run 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 · Directory.syncTreeRecursively (cyclomatic 16) · ×1
  • Directory.syncTreeRecursively (cyclomatic 16) src/main/java/com/google/devtools/build/lib/exec/SymlinkTreeHelper.java:246 — Directory.syncTreeRecursively 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 · DynamicSpawnStrategy.maybeExecuteNonDynamically (cyclomatic 16) · ×1
  • DynamicSpawnStrategy.maybeExecuteNonDynamically (cyclomatic 16) src/main/java/com/google/devtools/build/lib/dynamic/DynamicSpawnStrategy.java:355 — DynamicSpawnStrategy.maybeExecuteNonDynamically 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 · BuildResultPrinter.outputConfiguredTargets (cyclomatic 16) · ×1
  • BuildResultPrinter.outputConfiguredTargets (cyclomatic 16) src/main/java/com/google/devtools/build/lib/buildtool/BuildResultPrinter.java:408 — BuildResultPrinter.outputConfiguredTargets 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 · UrlRewriterConfig.parseConfig (cyclomatic 16) · ×1
  • UrlRewriterConfig.parseConfig (cyclomatic 16) src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/UrlRewriterConfig.java:125 — UrlRewriterConfig.parseConfig 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 · PatchUtil.applyPatchToFile (cyclomatic 16) · ×1
  • PatchUtil.applyPatchToFile (cyclomatic 16) src/main/java/com/google/devtools/build/lib/bazel/repository/decompressor/PatchUtil.java:200 — PatchUtil.applyPatchToFile 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 · StarlarkRuleContext.runfiles (cyclomatic 16) · ×1
  • StarlarkRuleContext.runfiles (cyclomatic 16) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleContext.java:1101 — StarlarkRuleContext.runfiles 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 · StarlarkRuleClassFunctions.macro (cyclomatic 16) · ×1
  • StarlarkRuleClassFunctions.macro (cyclomatic 16) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleClassFunctions.java:407 — StarlarkRuleClassFunctions.macro 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 · OptionsDiff.diff (cyclomatic 16) · ×1
  • OptionsDiff.diff (cyclomatic 16) src/main/java/com/google/devtools/build/lib/analysis/config/OptionsDiff.java:113 — OptionsDiff.diff 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 · ConfiguredTargetFactory.createConfiguredTarget (cyclomatic 16) · ×1
  • ConfiguredTargetFactory.createConfiguredTarget (cyclomatic 16) src/main/java/com/google/devtools/build/lib/analysis/ConfiguredTargetFactory.java:221 — ConfiguredTargetFactory.createConfiguredTarget 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 · BuildView.checkUnknownOutputGroups (cyclomatic 16) · ×1
  • BuildView.checkUnknownOutputGroups (cyclomatic 16) src/main/java/com/google/devtools/build/lib/analysis/BuildView.java:952 — BuildView.checkUnknownOutputGroups 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 · CompactPersistentActionCache.encode (cyclomatic 16) · ×1
  • CompactPersistentActionCache.encode (cyclomatic 16) src/main/java/com/google/devtools/build/lib/actions/cache/CompactPersistentActionCache.java:868 — CompactPersistentActionCache.encode 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 · ActionCacheChecker.loadCachedOutputMetadata (cyclomatic 16) · ×1
  • ActionCacheChecker.loadCachedOutputMetadata (cyclomatic 16) src/main/java/com/google/devtools/build/lib/actions/ActionCacheChecker.java:338 — ActionCacheChecker.loadCachedOutputMetadata 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 · StarlarkDoc.getTypeAnchor (cyclomatic 16) · ×1
  • StarlarkDoc.getTypeAnchor (cyclomatic 16) src/main/java/com/google/devtools/build/docgen/starlark/StarlarkDoc.java:84 — StarlarkDoc.getTypeAnchor 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 · _CLRParser._parse_dt (cyclomatic 16) · ×1
  • _CLRParser._parse_dt (cyclomatic 16) scripts/docs/clr_converter.py:388 — _CLRParser._parse_dt 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.
D17 · Explicit Debt · TodoComment repeated across 10 files · ×1
  • TodoComment repeated across 10 files src/main/java/com/google/devtools/build/lib/skyframe/serialization/SharedValueDeserializationContext.java:229 — The identical TodoComment appears in 10 files (34 occurrences) — almost certainly one boilerplate line from a single migration or decision, not 34 independent debts. Fix the systemic cause once rather than file-by-file. Text: "// TODO: b/386384684 - remove Unsafe usage". Source code is not a task system: track the cleanup where tasks live. (Every occurrence still counts toward the score and metrics.)
D2 · Cognitive Complexity · EvalUtils.binaryOp (cognitive 174) · ×1
  • EvalUtils.binaryOp (cognitive 174) src/main/java/net/starlark/java/eval/EvalUtils.java:59 — EvalUtils.binaryOp has cognitive complexity 174 (threshold 15). Drivers by points: if/else 79 (146 pts), ternaries 4 (16 pts), boolean chains 8, error handling 1 (3 pts), match/switch 1 (nesting depth added 81). 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 · BazelRepositoryModule.beforeCommand (cognitive 143) · ×1
  • BazelRepositoryModule.beforeCommand (cognitive 143) src/main/java/com/google/devtools/build/lib/bazel/BazelRepositoryModule.java:279 — BazelRepositoryModule.beforeCommand has cognitive complexity 143 (threshold 15). Drivers by points: if/else 40 (88 pts), error handling 11 (31 pts), loops 5 (15 pts), boolean chains 5, ternaries 2 (4 pts) (nesting depth added 80). 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 · StarlarkRuleClassFunctions.createRule (cognitive 134) · ×1
  • StarlarkRuleClassFunctions.createRule (cognitive 134) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleClassFunctions.java:709 — StarlarkRuleClassFunctions.createRule has cognitive complexity 134 (threshold 15). Drivers by points: if/else 63 (103 pts), boolean chains 15, ternaries 4 (8 pts), error handling 2 (4 pts), loops 3 (4 pts) (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 · PatchUtil.applyInternal (cognitive 101) · ×1
  • PatchUtil.applyInternal (cognitive 101) src/main/java/com/google/devtools/build/lib/bazel/repository/decompressor/PatchUtil.java:448 — PatchUtil.applyInternal has cognitive complexity 101 (threshold 15). Drivers by points: if/else 26 (82 pts), boolean chains 10, ternaries 3 (6 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 60). 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 · ChunkingSession.nextChunkSize (cognitive 95) · ×1
  • ChunkingSession.nextChunkSize (cognitive 95) src/main/java/com/google/devtools/build/lib/remote/chunking/RepMaxCdcChunker.java:219 — ChunkingSession.nextChunkSize has cognitive complexity 95 (threshold 15). Drivers by points: if/else 27 (67 pts), loops 10 (28 pts) (nesting depth added 58). 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 · HttpConnector.connect (cognitive 94) · ×1
  • HttpConnector.connect (cognitive 94) src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/HttpConnector.java:115 — HttpConnector.connect has cognitive complexity 94 (threshold 15). Drivers by points: if/else 25 (53 pts), error handling 10 (21 pts), boolean chains 10, loops 4 (10 pts) (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 · BlazeCommandDispatcher.execExclusively (cognitive 92) · ×1
  • BlazeCommandDispatcher.execExclusively (cognitive 92) src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java:376 — BlazeCommandDispatcher.execExclusively has cognitive complexity 92 (threshold 15). Drivers by points: if/else 34 (54 pts), error handling 14 (23 pts), loops 5 (8 pts), boolean chains 7 (nesting depth added 32). 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 · FunctionTransitionUtil.applyTransition (cognitive 88) · ×1
  • FunctionTransitionUtil.applyTransition (cognitive 88) src/main/java/com/google/devtools/build/lib/analysis/starlark/FunctionTransitionUtil.java:612 — FunctionTransitionUtil.applyTransition has cognitive complexity 88 (threshold 15). Drivers by points: if/else 30 (58 pts), error handling 4 (16 pts), boolean chains 6, loops 2 (6 pts), ternaries 2 (nesting depth added 44). 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 · GlobFunctionWithMultipleRecursiveFunctions.compute (cognitive 85) · ×1
  • GlobFunctionWithMultipleRecursiveFunctions.compute (cognitive 85) src/main/java/com/google/devtools/build/lib/skyframe/GlobFunctionWithMultipleRecursiveFunctions.java:51 — GlobFunctionWithMultipleRecursiveFunctions.compute has cognitive complexity 85 (threshold 15). Drivers by points: if/else 36 (73 pts), boolean chains 5, loops 4, ternaries 2 (3 pts) (nesting depth added 38). 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 · ModCommand.execInternal (cognitive 82) · ×1
  • ModCommand.execInternal (cognitive 82) src/main/java/com/google/devtools/build/lib/bazel/commands/ModCommand.java:217 — ModCommand.execInternal has cognitive complexity 82 (threshold 15). Drivers by points: if/else 26 (39 pts), error handling 16 (25 pts), loops 4 (8 pts), ternaries 3 (7 pts), match/switch 2, boolean chains 1 (nesting depth added 30). 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 · BuildEventServiceUploader.publishBuildEvents (cognitive 81) · ×1
  • BuildEventServiceUploader.publishBuildEvents (cognitive 81) src/main/java/com/google/devtools/build/lib/buildeventservice/BuildEventServiceUploader.java:458 — BuildEventServiceUploader.publishBuildEvents has cognitive complexity 81 (threshold 15). Drivers by points: if/else 25 (55 pts), ternaries 3 (14 pts), loops 3 (5 pts), boolean chains 4, match/switch 1 (2 pts), error handling 1 (nesting depth added 44). 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 · ProtoOutputFormatter.toTargetProtoBuffer (cognitive 75) · ×1
  • ProtoOutputFormatter.toTargetProtoBuffer (cognitive 75) src/main/java/com/google/devtools/build/lib/query2/query/output/ProtoOutputFormatter.java:182 — ProtoOutputFormatter.toTargetProtoBuffer has cognitive complexity 75 (threshold 15). Drivers by points: if/else 20 (37 pts), loops 13 (33 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 39). 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 · RepositoryFetchFunction.computeInternal (cognitive 75) · ×1
  • RepositoryFetchFunction.computeInternal (cognitive 75) src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryFetchFunction.java:222 — RepositoryFetchFunction.computeInternal has cognitive complexity 75 (threshold 15). Drivers by points: if/else 23 (56 pts), error handling 4 (11 pts), boolean chains 5, loops 1 (3 pts) (nesting depth added 42). 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 · DownloadManager.downloadInExecutor (cognitive 73) · ×1
  • DownloadManager.downloadInExecutor (cognitive 73) src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/DownloadManager.java:185 — DownloadManager.downloadInExecutor has cognitive complexity 73 (threshold 15). Drivers by points: if/else 22 (43 pts), error handling 6 (21 pts), loops 3 (7 pts), boolean chains 2 (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 · HeaderDiscovery.runDiscovery (cognitive 72) · ×1
  • HeaderDiscovery.runDiscovery (cognitive 72) src/main/java/com/google/devtools/build/lib/rules/cpp/HeaderDiscovery.java:115 — HeaderDiscovery.runDiscovery has cognitive complexity 72 (threshold 15). Drivers by points: if/else 22 (58 pts), loops 3 (11 pts), match/switch 1 (3 pts) (nesting depth added 46). 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 · CcCommon.configureFeaturesOrThrowEvalException (cognitive 72) · ×1
  • CcCommon.configureFeaturesOrThrowEvalException (cognitive 72) src/main/java/com/google/devtools/build/lib/rules/cpp/CcCommon.java:117 — CcCommon.configureFeaturesOrThrowEvalException has cognitive complexity 72 (threshold 15). Drivers by points: if/else 33 (59 pts), boolean chains 10, loops 2, error handling 1 (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 · Evaluate.runCore (cognitive 71) · ×1
  • Evaluate.runCore (cognitive 71) src/main/java/com/google/devtools/build/skyframe/AbstractParallelEvaluator.java:418 — Evaluate.runCore has cognitive complexity 71 (threshold 15). Drivers by points: if/else 28 (51 pts), error handling 7 (12 pts), boolean chains 7, loops 1 (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 · RemoteModule.setup (cognitive 71) · ×1
  • RemoteModule.setup (cognitive 71) src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java:414 — RemoteModule.setup has cognitive complexity 71 (threshold 15). Drivers by points: if/else 34 (43 pts), error handling 9 (18 pts), boolean chains 9, ternaries 1 (nesting depth added 18). 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 · Lexer.escapedStringLiteral (cognitive 70) · ×1
  • Lexer.escapedStringLiteral (cognitive 70) src/main/java/net/starlark/java/syntax/Lexer.java:273 — Lexer.escapedStringLiteral has cognitive complexity 70 (threshold 15). Drivers by points: if/else 18 (55 pts), boolean chains 8, match/switch 2 (5 pts), loops 1, ternaries 1 (nesting depth added 40). 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 · BzlCompileFunction.computeInline (cognitive 69) · ×1
  • BzlCompileFunction.computeInline (cognitive 69) src/main/java/com/google/devtools/build/lib/skyframe/BzlCompileFunction.java:108 — BzlCompileFunction.computeInline has cognitive complexity 69 (threshold 15). Drivers by points: if/else 24 (46 pts), ternaries 5 (13 pts), error handling 4 (7 pts), boolean chains 3 (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.
D2 · Cognitive Complexity · AqueryThreadsafeCallback.getReachableActions (cognitive 69) · ×1
  • AqueryThreadsafeCallback.getReachableActions (cognitive 69) src/main/java/com/google/devtools/build/lib/query2/aquery/AqueryThreadsafeCallback.java:65 — AqueryThreadsafeCallback.getReachableActions has cognitive complexity 69 (threshold 15). Drivers by points: loops 11 (35 pts), if/else 11 (31 pts), boolean chains 3 (nesting depth added 44). 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 · Lexer.scanNumberOrDotOrEllipsis (cognitive 67) · ×1
  • Lexer.scanNumberOrDotOrEllipsis (cognitive 67) src/main/java/net/starlark/java/syntax/Lexer.java:900 — Lexer.scanNumberOrDotOrEllipsis has cognitive complexity 67 (threshold 15). Drivers by points: if/else 23 (37 pts), loops 7 (18 pts), boolean chains 9, error handling 2 (3 pts) (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 · StarlarkAttrModule.createAttribute (cognitive 67) · ×1
  • StarlarkAttrModule.createAttribute (cognitive 67) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttrModule.java:312 — StarlarkAttrModule.createAttribute has cognitive complexity 67 (threshold 15). Drivers by points: if/else 37 (50 pts), boolean chains 13, loops 2 (4 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 · Lexer.tokenize (cognitive 66) · ×1
  • Lexer.tokenize (cognitive 66) src/main/java/net/starlark/java/syntax/Lexer.java:694 — Lexer.tokenize has cognitive complexity 66 (threshold 15). Drivers by points: if/else 27 (51 pts), boolean chains 10, loops 2 (3 pts), match/switch 1 (2 pts) (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 · RemoteExecutionService.downloadOutputs (cognitive 66) · ×1
  • RemoteExecutionService.downloadOutputs (cognitive 66) src/main/java/com/google/devtools/build/lib/remote/RemoteExecutionService.java:1307 — RemoteExecutionService.downloadOutputs has cognitive complexity 66 (threshold 15). Drivers by points: if/else 26 (49 pts), loops 8 (11 pts), boolean chains 5, error handling 1 (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 · VectorArg.preprocess (cognitive 66) · ×1
  • VectorArg.preprocess (cognitive 66) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkCustomCommandLine.java:333 — VectorArg.preprocess has cognitive complexity 66 (threshold 15). Drivers by points: if/else 19 (41 pts), loops 4 (13 pts), boolean chains 7, ternaries 3 (5 pts) (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.
D2 · Cognitive Complexity · NestedSet.create (cognitive 65) · ×1
  • NestedSet.create (cognitive 65) src/main/java/com/google/devtools/build/lib/collect/nestedset/NestedSet.java:224 — NestedSet.create has cognitive complexity 65 (threshold 15). Drivers by points: if/else 17 (48 pts), loops 4 (12 pts), boolean chains 3, match/switch 1, ternaries 1 (nesting depth added 39). 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 · StarlarkActionFactory.registerStarlarkAction (cognitive 65) · ×1
  • StarlarkActionFactory.registerStarlarkAction (cognitive 65) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkActionFactory.java:724 — StarlarkActionFactory.registerStarlarkAction has cognitive complexity 65 (threshold 15). Drivers by points: if/else 31 (48 pts), boolean chains 8, error handling 2 (5 pts), loops 1 (2 pts), ternaries 1 (2 pts) (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 · TypeChecker.inferSlice (cognitive 64) · ×1
  • TypeChecker.inferSlice (cognitive 64) src/main/java/net/starlark/java/syntax/TypeChecker.java:420 — TypeChecker.inferSlice has cognitive complexity 64 (threshold 15). Drivers by points: if/else 19 (30 pts), ternaries 4 (20 pts), loops 3 (11 pts), boolean chains 3 (nesting depth added 35). 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 · SimpleCycleDetector.checkForCycles (cognitive 64) · ×1
  • SimpleCycleDetector.checkForCycles (cognitive 64) src/main/java/com/google/devtools/build/skyframe/SimpleCycleDetector.java:92 — SimpleCycleDetector.checkForCycles has cognitive complexity 64 (threshold 15). Drivers by points: if/else 19 (46 pts), loops 3 (7 pts), ternaries 2 (5 pts), boolean chains 3, error handling 1 (3 pts) (nesting depth added 36). 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 · GenQueryPackageProviderFactory.constructPackageMapImpl (cognitive 61) · ×1
  • GenQueryPackageProviderFactory.constructPackageMapImpl (cognitive 61) src/main/java/com/google/devtools/build/lib/rules/genquery/GenQueryPackageProviderFactory.java:184 — GenQueryPackageProviderFactory.constructPackageMapImpl has cognitive complexity 61 (threshold 15). Drivers by points: if/else 12 (33 pts), loops 6 (18 pts), error handling 1 (4 pts), ternaries 1 (3 pts), boolean chains 2, match/switch 1 (nesting depth added 38). 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 · SymlinkForest.plantSymlinkForestMultiPackagePath (cognitive 61) · ×1
  • SymlinkForest.plantSymlinkForestMultiPackagePath (cognitive 61) src/main/java/com/google/devtools/build/lib/buildtool/SymlinkForest.java:146 — SymlinkForest.plantSymlinkForestMultiPackagePath has cognitive complexity 61 (threshold 15). Drivers by points: if/else 15 (40 pts), loops 9 (15 pts), error handling 1 (4 pts), boolean chains 2 (nesting depth added 34). 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 · ShellUtils.tokenize (cognitive 59) · ×1
  • ShellUtils.tokenize (cognitive 59) src/main/java/com/google/devtools/build/lib/shell/ShellUtils.java:90 — ShellUtils.tokenize has cognitive complexity 59 (threshold 15). Drivers by points: if/else 24 (52 pts), boolean chains 6, loops 1 (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 · SkyValueRetriever.tryRetrieve (cognitive 58) · ×1
  • SkyValueRetriever.tryRetrieve (cognitive 58) src/main/java/com/google/devtools/build/lib/skyframe/serialization/SkyValueRetriever.java:288 — SkyValueRetriever.tryRetrieve has cognitive complexity 58 (threshold 15). Drivers by points: if/else 8 (26 pts), error handling 6 (16 pts), match/switch 4 (11 pts), ternaries 1 (4 pts), loops 1 (nesting depth added 38). 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 · VirtualCgroup.createRoot (cognitive 58) · ×1
  • VirtualCgroup.createRoot (cognitive 58) src/main/java/com/google/devtools/build/lib/sandbox/cgroups/VirtualCgroup.java:131 — VirtualCgroup.createRoot has cognitive complexity 58 (threshold 15). Drivers by points: if/else 12 (42 pts), match/switch 2 (8 pts), loops 3 (7 pts), boolean chains 1 (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 · RemoteSpawnCache.lookup (cognitive 58) · ×1
  • RemoteSpawnCache.lookup (cognitive 58) src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnCache.java:84 — RemoteSpawnCache.lookup has cognitive complexity 58 (threshold 15). Drivers by points: if/else 20 (43 pts), error handling 5 (9 pts), boolean chains 6 (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 · TestActionBuilder.createTestAction (cognitive 57) · ×1
  • TestActionBuilder.createTestAction (cognitive 57) src/main/java/com/google/devtools/build/lib/analysis/test/TestActionBuilder.java:234 — TestActionBuilder.createTestAction has cognitive complexity 57 (threshold 15). Drivers by points: if/else 20 (38 pts), ternaries 7 (14 pts), loops 2 (3 pts), boolean chains 2 (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 · StarlarkRuleFunction.call (cognitive 57) · ×1
  • StarlarkRuleFunction.call (cognitive 57) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleClassFunctions.java:1795 — StarlarkRuleFunction.call has cognitive complexity 57 (threshold 15). Drivers by points: if/else 10 (29 pts), ternaries 5 (17 pts), boolean chains 5, loops 3 (5 pts), error handling 1 (nesting depth added 33). 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 · StarlarkOptionsParser.parseGivenArgs (cognitive 56) · ×1
  • StarlarkOptionsParser.parseGivenArgs (cognitive 56) src/main/java/com/google/devtools/build/lib/runtime/StarlarkOptionsParser.java:179 — StarlarkOptionsParser.parseGivenArgs has cognitive complexity 56 (threshold 15). Drivers by points: if/else 19 (38 pts), ternaries 2 (8 pts), boolean chains 4, loops 4, error handling 1 (2 pts) (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 · StarlarkRuleClassFunctions.aspect (cognitive 54) · ×1
  • StarlarkRuleClassFunctions.aspect (cognitive 54) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleClassFunctions.java:1334 — StarlarkRuleClassFunctions.aspect has cognitive complexity 54 (threshold 15). Drivers by points: if/else 23 (43 pts), boolean chains 8, loops 2 (3 pts) (nesting depth added 21). 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 · RuleConfiguredTargetBuilder.build (cognitive 54) · ×1
  • RuleConfiguredTargetBuilder.build (cognitive 54) src/main/java/com/google/devtools/build/lib/analysis/RuleConfiguredTargetBuilder.java:101 — RuleConfiguredTargetBuilder.build has cognitive complexity 54 (threshold 15). Drivers by points: if/else 26 (40 pts), loops 4 (9 pts), boolean chains 3, error handling 1, ternaries 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 · CallableType.assignableFromHook (cognitive 53) · ×1
  • CallableType.assignableFromHook (cognitive 53) src/main/java/net/starlark/java/syntax/Types.java:613 — CallableType.assignableFromHook has cognitive complexity 53 (threshold 15). Drivers by points: if/else 13 (35 pts), loops 3 (7 pts), ternaries 2 (7 pts), boolean chains 4 (nesting depth added 31). 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 · StarlarkMethodProcessor.process (cognitive 53) · ×1
  • StarlarkMethodProcessor.process (cognitive 53) src/main/java/net/starlark/java/annot/processor/StarlarkMethodProcessor.java:139 — StarlarkMethodProcessor.process has cognitive complexity 53 (threshold 15). Drivers by points: if/else 21 (46 pts), boolean chains 4, loops 3 (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 · _CLRParser.handle_endtag (cognitive 53) · ×1
  • _CLRParser.handle_endtag (cognitive 53) scripts/docs/clr_converter.py:215 — _CLRParser.handle_endtag has cognitive complexity 53 (threshold 15). Drivers by points: if/else 26 (43 pts), boolean chains 10 (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 · TypeChecker.inferCall (cognitive 52) · ×1
  • TypeChecker.inferCall (cognitive 52) src/main/java/net/starlark/java/syntax/TypeChecker.java:586 — TypeChecker.inferCall has cognitive complexity 52 (threshold 15). Drivers by points: if/else 19 (39 pts), boolean chains 6, ternaries 1 (4 pts), loops 2 (3 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 · BuildDriverFunction.compute (cognitive 52) · ×1
  • BuildDriverFunction.compute (cognitive 52) src/main/java/com/google/devtools/build/lib/skyframe/BuildDriverFunction.java:157 — BuildDriverFunction.compute has cognitive complexity 52 (threshold 15). Drivers by points: if/else 22 (41 pts), error handling 2 (4 pts), boolean chains 3, loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 23). 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 · StandaloneTestStrategy.runTestAttempt (cognitive 52) · ×1
  • StandaloneTestStrategy.runTestAttempt (cognitive 52) src/main/java/com/google/devtools/build/lib/exec/StandaloneTestStrategy.java:651 — StandaloneTestStrategy.runTestAttempt has cognitive complexity 52 (threshold 15). Drivers by points: if/else 15 (28 pts), error handling 6 (11 pts), ternaries 3 (7 pts), boolean chains 6 (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 · AspectFunction.compute (cognitive 50) · ×1
  • AspectFunction.compute (cognitive 50) src/main/java/com/google/devtools/build/lib/skyframe/AspectFunction.java:265 — AspectFunction.compute has cognitive complexity 50 (threshold 15). Drivers by points: if/else 23 (32 pts), error handling 7 (8 pts), loops 2 (4 pts), boolean chains 3, match/switch 1 (2 pts), ternaries 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 · ShellUtils.windowsEscapeArg (cognitive 50) · ×1
  • ShellUtils.windowsEscapeArg (cognitive 50) src/main/java/com/google/devtools/build/lib/shell/ShellUtils.java:186 — ShellUtils.windowsEscapeArg has cognitive complexity 50 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 6 (22 pts), boolean chains 4 (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 · MergedConfiguredTarget.of (cognitive 50) · ×1
  • MergedConfiguredTarget.of (cognitive 50) src/main/java/com/google/devtools/build/lib/analysis/configuredtargets/MergedConfiguredTarget.java:197 — MergedConfiguredTarget.of has cognitive complexity 50 (threshold 15). Drivers by points: if/else 18 (36 pts), boolean chains 6, error handling 1 (4 pts), loops 3 (4 pts) (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 · RemoteServerCapabilities.checkClientServerCompatibility (cognitive 49) · ×1
  • RemoteServerCapabilities.checkClientServerCompatibility (cognitive 49) src/main/java/com/google/devtools/build/lib/remote/RemoteServerCapabilities.java:155 — RemoteServerCapabilities.checkClientServerCompatibility has cognitive complexity 49 (threshold 15). Drivers by points: if/else 18 (39 pts), boolean chains 7, match/switch 1 (3 pts) (nesting depth added 23). 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 · SingleExtensionEvalFunction.compute (cognitive 49) · ×1
  • SingleExtensionEvalFunction.compute (cognitive 49) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/SingleExtensionEvalFunction.java:99 — SingleExtensionEvalFunction.compute has cognitive complexity 49 (threshold 15). Drivers by points: if/else 22 (32 pts), ternaries 3 (7 pts), boolean chains 5, error handling 3 (5 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 · Evaluate.maybeHandleDirtyNode (cognitive 48) · ×1
  • Evaluate.maybeHandleDirtyNode (cognitive 48) src/main/java/com/google/devtools/build/skyframe/AbstractParallelEvaluator.java:236 — Evaluate.maybeHandleDirtyNode has cognitive complexity 48 (threshold 15). Drivers by points: if/else 11 (32 pts), loops 4 (10 pts), boolean chains 3, ternaries 1 (2 pts), match/switch 1 (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 · WatchServiceDiffAwareness.collectChanges (cognitive 48) · ×1
  • WatchServiceDiffAwareness.collectChanges (cognitive 48) src/main/java/com/google/devtools/build/lib/skyframe/WatchServiceDiffAwareness.java:180 — WatchServiceDiffAwareness.collectChanges has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (37 pts), loops 6 (10 pts), boolean chains 1 (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 · QueryParser.parsePrimary (cognitive 48) · ×1
  • QueryParser.parsePrimary (cognitive 48) src/main/java/com/google/devtools/build/lib/query2/engine/QueryParser.java:271 — QueryParser.parsePrimary has cognitive complexity 48 (threshold 15). Drivers by points: if/else 10 (34 pts), loops 2 (5 pts), match/switch 2 (5 pts), boolean chains 3, ternaries 1 (nesting depth added 30). 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 · 3.extractGlobPatterns (cognitive 48) · ×1
  • 3.extractGlobPatterns (cognitive 48) src/main/java/com/google/devtools/build/lib/packages/PackageFactory.java:609 — 3.extractGlobPatterns has cognitive complexity 48 (threshold 15). Drivers by points: if/else 12 (35 pts), ternaries 1 (6 pts), loops 2 (5 pts), boolean chains 2 (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 · ProxyHelper.createProxyIfNeeded (cognitive 48) · ×1
  • ProxyHelper.createProxyIfNeeded (cognitive 48) src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/ProxyHelper.java:83 — ProxyHelper.createProxyIfNeeded has cognitive complexity 48 (threshold 15). Drivers by points: if/else 22 (41 pts), loops 2 (4 pts), ternaries 2, boolean chains 1 (nesting depth added 21). 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 · FilesystemValueChecker.batchStatJob (cognitive 47) · ×1
  • FilesystemValueChecker.batchStatJob (cognitive 47) src/main/java/com/google/devtools/build/lib/skyframe/FilesystemValueChecker.java:314 — FilesystemValueChecker.batchStatJob has cognitive complexity 47 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 6 (13 pts), error handling 5 (10 pts), boolean chains 1 (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 · CompletionFunction.compute (cognitive 47) · ×1
  • CompletionFunction.compute (cognitive 47) src/main/java/com/google/devtools/build/lib/skyframe/CompletionFunction.java:152 — CompletionFunction.compute has cognitive complexity 47 (threshold 15). Drivers by points: if/else 21 (37 pts), error handling 2 (4 pts), ternaries 1 (3 pts), boolean chains 2, loops 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 · ActionCacheChecker.loadCachedOutputMetadata (cognitive 47) · ×1
  • ActionCacheChecker.loadCachedOutputMetadata (cognitive 47) src/main/java/com/google/devtools/build/lib/actions/ActionCacheChecker.java:338 — ActionCacheChecker.loadCachedOutputMetadata has cognitive complexity 47 (threshold 15). Drivers by points: if/else 9 (23 pts), error handling 6 (20 pts), ternaries 1 (3 pts), loops 1 (nesting depth added 30). 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 · BuildDocCollector.processJavaSourceRuleAttributeDocs (cognitive 47) · ×1
  • BuildDocCollector.processJavaSourceRuleAttributeDocs (cognitive 47) src/main/java/com/google/devtools/build/docgen/BuildDocCollector.java:200 — BuildDocCollector.processJavaSourceRuleAttributeDocs has cognitive complexity 47 (threshold 15). Drivers by points: if/else 11 (33 pts), loops 3 (11 pts), boolean chains 3 (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 · Decoder.parse (cognitive 46) · ×1
  • Decoder.parse (cognitive 46) src/main/java/net/starlark/java/lib/json/Json.java:374 — Decoder.parse has cognitive complexity 46 (threshold 15). Drivers by points: if/else 12 (38 pts), loops 2 (6 pts), boolean chains 1, match/switch 1 (nesting depth added 30). 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 · ObjectGraphTraverser.process (cognitive 46) · ×1
  • ObjectGraphTraverser.process (cognitive 46) src/main/java/com/google/devtools/build/lib/util/ObjectGraphTraverser.java:407 — ObjectGraphTraverser.process has cognitive complexity 46 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 5 (15 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 28). 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 · UiStateTracker.describeAction (cognitive 46) · ×1
  • UiStateTracker.describeAction (cognitive 46) src/main/java/com/google/devtools/build/lib/runtime/UiStateTracker.java:819 — UiStateTracker.describeAction has cognitive complexity 46 (threshold 15). Drivers by points: if/else 21 (41 pts), boolean chains 5 (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 · TestSummaryPrinter.print (cognitive 46) · ×1
  • TestSummaryPrinter.print (cognitive 46) src/main/java/com/google/devtools/build/lib/runtime/TestSummaryPrinter.java:135 — TestSummaryPrinter.print has cognitive complexity 46 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 6 (13 pts), error handling 2 (5 pts), boolean chains 3, ternaries 1 (nesting depth added 23). 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 · UserDefinedFlagMatch.fromAttributeValueAndPrerequisites (cognitive 46) · ×1
  • UserDefinedFlagMatch.fromAttributeValueAndPrerequisites (cognitive 46) src/main/java/com/google/devtools/build/lib/rules/config/ConfigSetting.java:642 — UserDefinedFlagMatch.fromAttributeValueAndPrerequisites has cognitive complexity 46 (threshold 15). Drivers by points: if/else 19 (34 pts), ternaries 1 (4 pts), error handling 1 (3 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 21). 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 · VarInt.getVarLong (cognitive 45) · ×1
  • VarInt.getVarLong (cognitive 45) src/main/java/com/google/devtools/build/lib/util/VarInt.java:149 — VarInt.getVarLong has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (45 pts) (nesting depth added 28). 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 · JsonProfile.<init> (cognitive 45) · ×1
  • JsonProfile.<init> (cognitive 45) src/main/java/com/google/devtools/build/lib/profiler/JsonProfile.java:48 — JsonProfile.<init> has cognitive complexity 45 (threshold 15). Drivers by points: if/else 11 (39 pts), loops 2 (6 pts) (nesting depth added 32). 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 · StarlarkRuleContext.<init> (cognitive 45) · ×1
  • StarlarkRuleContext.<init> (cognitive 45) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleContext.java:195 — StarlarkRuleContext.<init> has cognitive complexity 45 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 8 (18 pts), error handling 1 (2 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 · ExecutionServer.execute (cognitive 44) · ×1
  • ExecutionServer.execute (cognitive 44) src/tools/remote/src/main/java/com/google/devtools/build/remote/worker/ExecutionServer.java:287 — ExecutionServer.execute has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (25 pts), error handling 5 (8 pts), loops 4 (7 pts), boolean chains 3, ternaries 1 (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 · NodePrinter.printExpr (cognitive 44) · ×1
  • NodePrinter.printExpr (cognitive 44) src/main/java/net/starlark/java/syntax/NodePrinter.java:313 — NodePrinter.printExpr has cognitive complexity 44 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 6 (12 pts), ternaries 5 (10 pts), boolean chains 1, match/switch 1 (nesting depth added 21). 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 · OptionsParserImpl.identifyOptionAndPossibleArgument (cognitive 43) · ×1
  • OptionsParserImpl.identifyOptionAndPossibleArgument (cognitive 43) src/main/java/com/google/devtools/common/options/OptionsParserImpl.java:735 — OptionsParserImpl.identifyOptionAndPossibleArgument has cognitive complexity 43 (threshold 15). Drivers by points: if/else 19 (32 pts), ternaries 3 (7 pts), boolean chains 4 (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 · SkyframeBuildView.configureTargets (cognitive 43) · ×1
  • SkyframeBuildView.configureTargets (cognitive 43) src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java:402 — SkyframeBuildView.configureTargets has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (38 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 24). 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 · CommandEnvironment.<init> (cognitive 43) · ×1
  • CommandEnvironment.<init> (cognitive 43) src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java:228 — CommandEnvironment.<init> has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 3 (5 pts), match/switch 2 (5 pts), ternaries 3 (4 pts), boolean chains 2, error handling 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 · BlazeRuntime.initProfiler (cognitive 43) · ×1
  • BlazeRuntime.initProfiler (cognitive 43) src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java:379 — BlazeRuntime.initProfiler has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (27 pts), ternaries 3 (8 pts), loops 2 (4 pts), boolean chains 3, error handling 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 · CompressedTarFunction.decompress (cognitive 43) · ×1
  • CompressedTarFunction.decompress (cognitive 43) src/main/java/com/google/devtools/build/lib/bazel/repository/decompressor/CompressedTarFunction.java:68 — CompressedTarFunction.decompress has cognitive complexity 43 (threshold 15). Drivers by points: if/else 17 (33 pts), boolean chains 5, ternaries 1 (3 pts), loops 2 (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 · PackageFunction.loadPackage (cognitive 42) · ×1
  • PackageFunction.loadPackage (cognitive 42) src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java:994 — PackageFunction.loadPackage has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (25 pts), error handling 5 (12 pts), loops 2 (4 pts), ternaries 1 (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 · Builder.createTargetMap (cognitive 42) · ×1
  • Builder.createTargetMap (cognitive 42) src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java:1750 — Builder.createTargetMap has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (29 pts), boolean chains 6, loops 3 (5 pts), ternaries 1 (2 pts) (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 · TargetPatternPhaseFunction.compute (cognitive 41) · ×1
  • TargetPatternPhaseFunction.compute (cognitive 41) src/main/java/com/google/devtools/build/lib/skyframe/TargetPatternPhaseFunction.java:76 — TargetPatternPhaseFunction.compute has cognitive complexity 41 (threshold 15). Drivers by points: if/else 17 (29 pts), boolean chains 6, loops 2 (3 pts), ternaries 3 (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 · RecursiveFilesystemTraversalFunction.lookUpFileInfo (cognitive 41) · ×1
  • RecursiveFilesystemTraversalFunction.lookUpFileInfo (cognitive 41) src/main/java/com/google/devtools/build/lib/skyframe/RecursiveFilesystemTraversalFunction.java:335 — RecursiveFilesystemTraversalFunction.lookUpFileInfo has cognitive complexity 41 (threshold 15). Drivers by points: if/else 17 (33 pts), ternaries 2 (7 pts), boolean chains 1 (nesting depth added 21). 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 · PatchUtil.getLineType (cognitive 41) · ×1
  • PatchUtil.getLineType (cognitive 41) src/main/java/com/google/devtools/build/lib/bazel/repository/decompressor/PatchUtil.java:109 — PatchUtil.getLineType has cognitive complexity 41 (threshold 15). Drivers by points: if/else 17 (36 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 21). 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 · ParsedFlagsFunction.compute (cognitive 40) · ×1
  • ParsedFlagsFunction.compute (cognitive 40) src/main/java/com/google/devtools/build/lib/skyframe/config/ParsedFlagsFunction.java:64 — ParsedFlagsFunction.compute has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (28 pts), ternaries 2 (6 pts), loops 2 (3 pts), error handling 2, 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 · SkyframeActionExecutor.checkOutputs (cognitive 40) · ×1
  • SkyframeActionExecutor.checkOutputs (cognitive 40) src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java:1752 — SkyframeActionExecutor.checkOutputs has cognitive complexity 40 (threshold 15). Drivers by points: if/else 9 (25 pts), error handling 2 (8 pts), ternaries 1 (4 pts), boolean chains 2, loops 1 (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 · PackageFunction.compute (cognitive 40) · ×1
  • PackageFunction.compute (cognitive 40) src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java:368 — PackageFunction.compute has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (20 pts), error handling 13 (17 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 6). 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 · AttributeFormatter.writeAttributeValueToBuilder (cognitive 40) · ×1
  • AttributeFormatter.writeAttributeValueToBuilder (cognitive 40) src/main/java/com/google/devtools/build/lib/packages/AttributeFormatter.java:210 — AttributeFormatter.writeAttributeValueToBuilder has cognitive complexity 40 (threshold 15). Drivers by points: loops 10 (21 pts), if/else 14, boolean chains 5 (nesting depth added 11). 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 · Hints.getPathLevelHintedInclusions (cognitive 40) · ×1
  • Hints.getPathLevelHintedInclusions (cognitive 40) src/main/java/com/google/devtools/build/lib/includescanning/IncludeParser.java:263 — Hints.getPathLevelHintedInclusions has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 5 (7 pts), error handling 3 (6 pts), boolean chains 2, ternaries 1 (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 · InMemoryFileSystem.pathWalkErrno (cognitive 39) · ×1
  • InMemoryFileSystem.pathWalkErrno (cognitive 39) src/main/java/com/google/devtools/build/lib/vfs/inmemoryfs/InMemoryFileSystem.java:240 — InMemoryFileSystem.pathWalkErrno has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (29 pts), loops 2 (5 pts), boolean chains 3, ternaries 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 · WindowsOsPathPolicy.needsToNormalize (cognitive 39) · ×1
  • WindowsOsPathPolicy.needsToNormalize (cognitive 39) src/main/java/com/google/devtools/build/lib/vfs/WindowsOsPathPolicy.java:78 — WindowsOsPathPolicy.needsToNormalize has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (31 pts), boolean chains 7, loops 1 (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 · ParsedFlagsFunction.checkPackageVisibility (cognitive 39) · ×1
  • ParsedFlagsFunction.checkPackageVisibility (cognitive 39) src/main/java/com/google/devtools/build/lib/skyframe/config/ParsedFlagsFunction.java:171 — ParsedFlagsFunction.checkPackageVisibility has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 4 (9 pts), error handling 2 (6 pts), ternaries 1 (nesting depth added 21). 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 · ActionGraphDump.dumpSingleAction (cognitive 39) · ×1
  • ActionGraphDump.dumpSingleAction (cognitive 39) src/main/java/com/google/devtools/build/lib/skyframe/actiongraph/v2/ActionGraphDump.java:150 — ActionGraphDump.dumpSingleAction has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (22 pts), loops 6 (11 pts), boolean chains 3, error handling 1 (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 · ActionOutputMetadataStore.constructTreeArtifactValueFromFilesystem (cognitive 39) · ×1
  • ActionOutputMetadataStore.constructTreeArtifactValueFromFilesystem (cognitive 39) src/main/java/com/google/devtools/build/lib/skyframe/ActionOutputMetadataStore.java:255 — ActionOutputMetadataStore.constructTreeArtifactValueFromFilesystem has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 6, error handling 2 (6 pts), ternaries 3 (6 pts), loops 1 (2 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 · ActionExecutionFunction.computeInternal (cognitive 39) · ×1
  • ActionExecutionFunction.computeInternal (cognitive 39) src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java:223 — ActionExecutionFunction.computeInternal has cognitive complexity 39 (threshold 15). Drivers by points: if/else 19 (27 pts), error handling 5 (10 pts), loops 1 (2 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 · BlazeRuntime.newRuntime (cognitive 39) · ×1
  • BlazeRuntime.newRuntime (cognitive 39) src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java:1408 — BlazeRuntime.newRuntime has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (20 pts), loops 7, error handling 4 (6 pts), boolean chains 5, ternaries 1 (nesting depth added 6). 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 · TypeTagger.extractTerm (cognitive 38) · ×1
  • TypeTagger.extractTerm (cognitive 38) src/main/java/net/starlark/java/syntax/TypeTagger.java:184 — TypeTagger.extractTerm has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (28 pts), error handling 2 (4 pts), boolean chains 3, loops 1 (2 pts), match/switch 1 (nesting depth added 18). 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 · Resolver.resolveFunction (cognitive 38) · ×1
  • Resolver.resolveFunction (cognitive 38) src/main/java/net/starlark/java/syntax/Resolver.java:1107 — Resolver.resolveFunction has cognitive complexity 38 (threshold 15). Drivers by points: if/else 21 (33 pts), boolean chains 3, loops 2 (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 · ParallelEvaluator.bubbleErrorUp (cognitive 38) · ×1
  • ParallelEvaluator.bubbleErrorUp (cognitive 38) src/main/java/com/google/devtools/build/skyframe/ParallelEvaluator.java:293 — ParallelEvaluator.bubbleErrorUp has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (20 pts), error handling 3 (6 pts), boolean chains 5, loops 2 (4 pts), match/switch 1 (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 · DefaultSyscallCache.getType (cognitive 38) · ×1
  • DefaultSyscallCache.getType (cognitive 38) src/main/java/com/google/devtools/build/lib/skyframe/DefaultSyscallCache.java:191 — DefaultSyscallCache.getType has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (32 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 20). 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 · GsonTypeAdapter.read (cognitive 38) · ×1
  • GsonTypeAdapter.read (cognitive 38) src/main/java/com/google/devtools/build/lib/authandtls/credentialhelper/GetCredentialsResponse.java:120 — GsonTypeAdapter.read has cognitive complexity 38 (threshold 15). Drivers by points: if/else 4 (16 pts), loops 3 (10 pts), match/switch 3 (8 pts), error handling 1 (4 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 · SandboxStash.takeStashedSandboxInternal (cognitive 37) · ×1
  • SandboxStash.takeStashedSandboxInternal (cognitive 37) src/main/java/com/google/devtools/build/lib/sandbox/SandboxStash.java:116 — SandboxStash.takeStashedSandboxInternal has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (26 pts), error handling 3 (5 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (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 · RunCommand.getBuiltTargets (cognitive 37) · ×1
  • RunCommand.getBuiltTargets (cognitive 37) src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java:436 — RunCommand.getBuiltTargets has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (23 pts), error handling 2 (4 pts), ternaries 2 (4 pts), boolean chains 3, loops 2 (3 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 · UploadManifest.addFiles (cognitive 37) · ×1
  • UploadManifest.addFiles (cognitive 37) src/main/java/com/google/devtools/build/lib/remote/UploadManifest.java:240 — UploadManifest.addFiles has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (31 pts), error handling 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 21). 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 · AttributeProvider.populateDefaultRuleAttributeValues (cognitive 37) · ×1
  • AttributeProvider.populateDefaultRuleAttributeValues (cognitive 37) src/main/java/com/google/devtools/build/lib/packages/AttributeProvider.java:298 — AttributeProvider.populateDefaultRuleAttributeValues has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (24 pts), ternaries 2 (7 pts), boolean chains 4, loops 2 (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 · InclusionCache.locateOnPaths (cognitive 37) · ×1
  • InclusionCache.locateOnPaths (cognitive 37) src/main/java/com/google/devtools/build/lib/includescanning/LegacyIncludeScanner.java:124 — InclusionCache.locateOnPaths has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (28 pts), boolean chains 5, ternaries 3, loops 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 · GraphvizOutputFormatter.output (cognitive 37) · ×1
  • GraphvizOutputFormatter.output (cognitive 37) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/modcommand/GraphvizOutputFormatter.java:45 — GraphvizOutputFormatter.output has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 4 (10 pts), ternaries 2 (6 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 · BuildDocCollector.collectModuleInfoDocs (cognitive 37) · ×1
  • BuildDocCollector.collectModuleInfoDocs (cognitive 37) src/main/java/com/google/devtools/build/docgen/BuildDocCollector.java:363 — BuildDocCollector.collectModuleInfoDocs has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (24 pts), ternaries 2 (8 pts), loops 2 (4 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 · StarlarkBuildSettingsDetailsFunction.compute (cognitive 36) · ×1
  • StarlarkBuildSettingsDetailsFunction.compute (cognitive 36) src/main/java/com/google/devtools/build/lib/skyframe/StarlarkBuildSettingsDetailsFunction.java:59 — StarlarkBuildSettingsDetailsFunction.compute has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (21 pts), error handling 4 (9 pts), ternaries 1 (4 pts), boolean chains 1, 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 · SkyframeTargetPatternEvaluator.preloadTargetPatterns (cognitive 36) · ×1
  • SkyframeTargetPatternEvaluator.preloadTargetPatterns (cognitive 36) src/main/java/com/google/devtools/build/lib/skyframe/SkyframeTargetPatternEvaluator.java:68 — SkyframeTargetPatternEvaluator.preloadTargetPatterns has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (31 pts), error handling 1 (3 pts), loops 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 · Rule.populateOutputFilesInternal (cognitive 36) · ×1
  • Rule.populateOutputFilesInternal (cognitive 36) src/main/java/com/google/devtools/build/lib/packages/Rule.java:518 — Rule.populateOutputFilesInternal has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (22 pts), loops 4 (10 pts), error handling 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 · VectorArgFragment.eval (cognitive 36) · ×1
  • VectorArgFragment.eval (cognitive 36) src/main/java/com/google/devtools/build/lib/analysis/actions/CustomCommandLine.java:395 — VectorArgFragment.eval has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (18 pts), loops 6 (16 pts), boolean chains 2 (nesting depth added 13). 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 · ApiExporter.appendGlobals (cognitive 36) · ×1
  • ApiExporter.appendGlobals (cognitive 36) src/main/java/com/google/devtools/build/docgen/ApiExporter.java:93 — ApiExporter.appendGlobals has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (33 pts), boolean chains 2, loops 1 (nesting depth added 20). 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 · MethodDescriptor.starlarkTypeFromJava (cognitive 35) · ×1
  • MethodDescriptor.starlarkTypeFromJava (cognitive 35) src/main/java/net/starlark/java/eval/MethodDescriptor.java:285 — MethodDescriptor.starlarkTypeFromJava has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17 (22 pts), boolean chains 13 (nesting depth added 5). 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 · SkyframeExecutor.handleDiffsWithMissingDiffInformation (cognitive 35) · ×1
  • SkyframeExecutor.handleDiffsWithMissingDiffInformation (cognitive 35) src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java:4022 — SkyframeExecutor.handleDiffsWithMissingDiffInformation has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 8, ternaries 2 (4 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 · SkyframeExecutor.processDiscardAndDetermineRemoval (cognitive 35) · ×1
  • SkyframeExecutor.processDiscardAndDetermineRemoval (cognitive 35) src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java:1441 — SkyframeExecutor.processDiscardAndDetermineRemoval has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (30 pts), boolean chains 5 (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 · UiStateTracker.writeProgressBar (cognitive 35) · ×1
  • UiStateTracker.writeProgressBar (cognitive 35) src/main/java/com/google/devtools/build/lib/runtime/UiStateTracker.java:1388 — UiStateTracker.writeProgressBar has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (33 pts), boolean chains 2 (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 · UiEventHandler.handleLocked (cognitive 35) · ×1
  • UiEventHandler.handleLocked (cognitive 35) src/main/java/com/google/devtools/build/lib/runtime/UiEventHandler.java:429 — UiEventHandler.handleLocked has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (28 pts), boolean chains 4, ternaries 1 (2 pts), match/switch 1 (nesting depth added 15). 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 · BuildEventStreamer.buildEvent (cognitive 35) · ×1
  • BuildEventStreamer.buildEvent (cognitive 35) src/main/java/com/google/devtools/build/lib/runtime/BuildEventStreamer.java:671 — BuildEventStreamer.buildEvent has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19 (25 pts), loops 3 (5 pts), boolean chains 4, match/switch 1 (nesting depth added 8). 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 · XmlOutputFormatter.createValueElement (cognitive 35) · ×1
  • XmlOutputFormatter.createValueElement (cognitive 35) src/main/java/com/google/devtools/build/lib/query2/query/output/XmlOutputFormatter.java:315 — XmlOutputFormatter.createValueElement has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 4 (10 pts), error handling 1 (4 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 · BlazeQueryEnvironment.getTargetsMatchingPatternImpl (cognitive 35) · ×1
  • BlazeQueryEnvironment.getTargetsMatchingPatternImpl (cognitive 35) src/main/java/com/google/devtools/build/lib/query2/query/BlazeQueryEnvironment.java:178 — BlazeQueryEnvironment.getTargetsMatchingPatternImpl has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (26 pts), loops 3 (5 pts), error handling 1 (4 pts) (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 · OptionsDiff.diff (cognitive 35) · ×1
  • OptionsDiff.diff (cognitive 35) src/main/java/com/google/devtools/build/lib/analysis/config/OptionsDiff.java:113 — OptionsDiff.diff has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (30 pts), loops 3 (4 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 · CompactPersistentActionCache.decodeInternal (cognitive 35) · ×1
  • CompactPersistentActionCache.decodeInternal (cognitive 35) src/main/java/com/google/devtools/build/lib/actions/cache/CompactPersistentActionCache.java:999 — CompactPersistentActionCache.decodeInternal has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (27 pts), loops 5 (7 pts), error handling 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 · PostAnalysisQueryEnvironment.targetifyValues (cognitive 34) · ×1
  • PostAnalysisQueryEnvironment.targetifyValues (cognitive 34) src/main/java/com/google/devtools/build/lib/query2/PostAnalysisQueryEnvironment.java:668 — PostAnalysisQueryEnvironment.targetifyValues has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 8, 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 · CompileOneDependencyTransformer.transformCompileOneDependency (cognitive 34) · ×1
  • CompileOneDependencyTransformer.transformCompileOneDependency (cognitive 34) src/main/java/com/google/devtools/build/lib/pkgcache/CompileOneDependencyTransformer.java:88 — CompileOneDependencyTransformer.transformCompileOneDependency has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 3 (5 pts), boolean chains 3, error handling 1 (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 · StarlarkBaseExternalContext.getAuthHeaders (cognitive 34) · ×1
  • StarlarkBaseExternalContext.getAuthHeaders (cognitive 34) src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkBaseExternalContext.java:340 — StarlarkBaseExternalContext.getAuthHeaders has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (26 pts), loops 2 (5 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 22). 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 · Resolver.bind (cognitive 33) · ×1
  • Resolver.bind (cognitive 33) src/main/java/net/starlark/java/syntax/Resolver.java:1249 — Resolver.bind has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 4, ternaries 1 (4 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 · Lexer.stringLiteral (cognitive 33) · ×1
  • Lexer.stringLiteral (cognitive 33) src/main/java/net/starlark/java/syntax/Lexer.java:436 — Lexer.stringLiteral has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 2 (6 pts), match/switch 1 (2 pts), boolean chains 1, ternaries 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 · TargetPatternsHelper.readFrom (cognitive 33) · ×1
  • TargetPatternsHelper.readFrom (cognitive 33) src/main/java/com/google/devtools/build/lib/runtime/commands/TargetPatternsHelper.java:68 — TargetPatternsHelper.readFrom has cognitive complexity 33 (threshold 15). Drivers by points: error handling 6 (17 pts), if/else 9 (11 pts), boolean chains 5 (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 · CleanCommand.actuallyClean (cognitive 33) · ×1
  • CleanCommand.actuallyClean (cognitive 33) src/main/java/com/google/devtools/build/lib/runtime/commands/CleanCommand.java:194 — CleanCommand.actuallyClean has cognitive complexity 33 (threshold 15). Drivers by points: error handling 9 (19 pts), if/else 8 (11 pts), ternaries 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 · BuildResultPrinter.outputConfiguredTargets (cognitive 33) · ×1
  • BuildResultPrinter.outputConfiguredTargets (cognitive 33) src/main/java/com/google/devtools/build/lib/buildtool/BuildResultPrinter.java:408 — BuildResultPrinter.outputConfiguredTargets has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 6 (10 pts), error handling 1 (4 pts), ternaries 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 · Indenter.indent (cognitive 32) · ×1
  • Indenter.indent (cognitive 32) src/main/java/net/starlark/java/lib/json/Json.java:716 — Indenter.indent has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (20 pts), loops 3 (7 pts), boolean chains 3, match/switch 1 (2 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 · WorkerModule.buildStarting (cognitive 32) · ×1
  • WorkerModule.buildStarting (cognitive 32) src/main/java/com/google/devtools/build/lib/worker/WorkerModule.java:90 — WorkerModule.buildStarting has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (13 pts), error handling 2 (7 pts), ternaries 4 (7 pts), loops 1 (3 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 · TestResultAggregator.incrementalAnalyze (cognitive 32) · ×1
  • TestResultAggregator.incrementalAnalyze (cognitive 32) src/main/java/com/google/devtools/build/lib/runtime/TestResultAggregator.java:165 — TestResultAggregator.incrementalAnalyze has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (24 pts), loops 2 (4 pts), boolean chains 3, ternaries 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 · AggregatingAttributeMapper.checkForDuplicateLabels (cognitive 32) · ×1
  • AggregatingAttributeMapper.checkForDuplicateLabels (cognitive 32) src/main/java/com/google/devtools/build/lib/packages/AggregatingAttributeMapper.java:241 — AggregatingAttributeMapper.checkForDuplicateLabels has cognitive complexity 32 (threshold 15). Drivers by points: loops 7 (19 pts), if/else 5 (6 pts), ternaries 3 (6 pts), boolean chains 1 (nesting depth added 16). 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 · Directory.syncTreeRecursively (cognitive 32) · ×1
  • Directory.syncTreeRecursively (cognitive 32) src/main/java/com/google/devtools/build/lib/exec/SymlinkTreeHelper.java:246 — Directory.syncTreeRecursively has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (28 pts), loops 3, 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 · NestedSetBuilder.buildInternal (cognitive 32) · ×1
  • NestedSetBuilder.buildInternal (cognitive 32) src/main/java/com/google/devtools/build/lib/collect/nestedset/NestedSetBuilder.java:221 — NestedSetBuilder.buildInternal has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 9 (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 · ModExecutor.displayExtension (cognitive 32) · ×1
  • ModExecutor.displayExtension (cognitive 32) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/modcommand/ModExecutor.java:613 — ModExecutor.displayExtension has cognitive complexity 32 (threshold 15). Drivers by points: loops 7 (16 pts), if/else 6 (11 pts), ternaries 1 (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 · _CLRParser.handle_starttag (cognitive 32) · ×1
  • _CLRParser.handle_starttag (cognitive 32) scripts/docs/clr_converter.py:124 — _CLRParser.handle_starttag has cognitive complexity 32 (threshold 15). Drivers by points: if/else 20 (24 pts), boolean chains 8 (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.
D2 · Cognitive Complexity · Encoder.encode (cognitive 31) · ×1
  • Encoder.encode (cognitive 31) src/main/java/net/starlark/java/lib/json/Json.java:121 — Encoder.encode has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (13 pts), error handling 3 (9 pts), loops 4 (8 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 · StarlarkInt.parse (cognitive 31) · ×1
  • StarlarkInt.parse (cognitive 31) src/main/java/net/starlark/java/eval/StarlarkInt.java:104 — StarlarkInt.parse has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 9, error handling 2 (3 pts), ternaries 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 · StarlarkFloat.format (cognitive 31) · ×1
  • StarlarkFloat.format (cognitive 31) src/main/java/net/starlark/java/eval/StarlarkFloat.java:130 — StarlarkFloat.format has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 2 (7 pts), boolean chains 2, ternaries 1 (2 pts), match/switch 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 · StarlarkMethodProcessor.checkParameters (cognitive 31) · ×1
  • StarlarkMethodProcessor.checkParameters (cognitive 31) src/main/java/net/starlark/java/annot/processor/StarlarkMethodProcessor.java:321 — StarlarkMethodProcessor.checkParameters has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (27 pts), boolean chains 3, loops 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 · WorkerSpawnRunner.execInWorker (cognitive 31) · ×1
  • WorkerSpawnRunner.execInWorker (cognitive 31) src/main/java/com/google/devtools/build/lib/worker/WorkerSpawnRunner.java:380 — WorkerSpawnRunner.execInWorker has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 5 (8 pts), boolean chains 5, ternaries 3 (4 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 · TimestampGranularityMonitor.waitForTimestampGranularity (cognitive 31) · ×1
  • TimestampGranularityMonitor.waitForTimestampGranularity (cognitive 31) src/main/java/com/google/devtools/build/lib/util/io/TimestampGranularityMonitor.java:158 — TimestampGranularityMonitor.waitForTimestampGranularity has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (16 pts), error handling 2 (8 pts), loops 2 (6 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 · SingleToolchainResolutionFunction.computeResolutionDiagnostic (cognitive 31) · ×1
  • SingleToolchainResolutionFunction.computeResolutionDiagnostic (cognitive 31) src/main/java/com/google/devtools/build/lib/skyframe/toolchains/SingleToolchainResolutionFunction.java:263 — SingleToolchainResolutionFunction.computeResolutionDiagnostic has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (23 pts), ternaries 2 (6 pts), boolean chains 1, loops 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 · ActionRewindStrategy.getLostInputOwningDirectDeps (cognitive 31) · ×1
  • ActionRewindStrategy.getLostInputOwningDirectDeps (cognitive 31) src/main/java/com/google/devtools/build/lib/skyframe/rewinding/ActionRewindStrategy.java:719 — ActionRewindStrategy.getLostInputOwningDirectDeps has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 5 (11 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 · SandboxHelpers.updateContentMap (cognitive 31) · ×1
  • SandboxHelpers.updateContentMap (cognitive 31) src/main/java/com/google/devtools/build/lib/sandbox/SandboxHelpers.java:848 — SandboxHelpers.updateContentMap has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 2 (4 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 · ConfigExpander.getExpansion (cognitive 31) · ×1
  • ConfigExpander.getExpansion (cognitive 31) src/main/java/com/google/devtools/build/lib/runtime/ConfigExpander.java:284 — ConfigExpander.getExpansion has cognitive complexity 31 (threshold 15). Drivers by points: if/else 5 (20 pts), loops 3 (6 pts), ternaries 1 (4 pts), boolean chains 1 (nesting depth added 21). 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 · BuildEventStreamer.post (cognitive 31) · ×1
  • BuildEventStreamer.post (cognitive 31) src/main/java/com/google/devtools/build/lib/runtime/BuildEventStreamer.java:337 — BuildEventStreamer.post has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 5 (12 pts), boolean chains 3 (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 · IncludeParser.extractInclusion (cognitive 31) · ×1
  • IncludeParser.extractInclusion (cognitive 31) src/main/java/com/google/devtools/build/lib/includescanning/IncludeParser.java:756 — IncludeParser.extractInclusion has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (21 pts), ternaries 3 (8 pts), boolean chains 2 (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 · ModuleFileFunction.advanceHorizon (cognitive 31) · ×1
  • ModuleFileFunction.advanceHorizon (cognitive 31) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleFileFunction.java:413 — ModuleFileFunction.advanceHorizon has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (20 pts), error handling 3 (6 pts), loops 5 (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 · VectorArg.addToFingerprint (cognitive 31) · ×1
  • VectorArg.addToFingerprint (cognitive 31) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkCustomCommandLine.java:602 — VectorArg.addToFingerprint has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (21 pts), ternaries 3 (6 pts), loops 1 (3 pts), boolean chains 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 · OptionsDiffCodec.serialize (cognitive 31) · ×1
  • OptionsDiffCodec.serialize (cognitive 31) src/main/java/com/google/devtools/build/lib/analysis/config/OptionsDiff.java:667 — OptionsDiffCodec.serialize has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 8 (10 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 · ArgumentProcessor.call (cognitive 30) · ×1
  • ArgumentProcessor.call (cognitive 30) src/main/java/net/starlark/java/eval/StarlarkFunction.java:581 — ArgumentProcessor.call has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (18 pts), ternaries 3 (7 pts), loops 2 (3 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 · OptionsClassProcessor.generateWrapper (cognitive 30) · ×1
  • OptionsClassProcessor.generateWrapper (cognitive 30) src/main/java/com/google/devtools/common/options/processor/OptionsClassProcessor.java:151 — OptionsClassProcessor.generateWrapper has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 3 (4 pts), error handling 2 (3 pts), ternaries 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 · DependencySet.process (cognitive 30) · ×1
  • DependencySet.process (cognitive 30) src/main/java/com/google/devtools/build/lib/util/DependencySet.java:131 — DependencySet.process has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (18 pts), match/switch 3 (8 pts), boolean chains 3, loops 1 (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 · ExecuteRetrier.resultClassifier (cognitive 30) · ×1
  • ExecuteRetrier.resultClassifier (cognitive 30) src/main/java/com/google/devtools/build/lib/remote/ExecuteRetrier.java:92 — ExecuteRetrier.resultClassifier has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (5 pts), error handling 1 (4 pts), boolean chains 2, ternaries 1 (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 · GraphOutputWriter.getConditionsGraphLabel (cognitive 30) · ×1
  • GraphOutputWriter.getConditionsGraphLabel (cognitive 30) src/main/java/com/google/devtools/build/lib/query2/query/output/GraphOutputWriter.java:343 — GraphOutputWriter.getConditionsGraphLabel has cognitive complexity 30 (threshold 15). Drivers by points: if/else 5 (18 pts), loops 3 (7 pts), ternaries 1 (4 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 · ActionGraphTextOutputFormatterCallback.writeText (cognitive 30) · ×1
  • ActionGraphTextOutputFormatterCallback.writeText (cognitive 30) src/main/java/com/google/devtools/build/lib/query2/aquery/ActionGraphTextOutputFormatterCallback.java:167 — ActionGraphTextOutputFormatterCallback.writeText has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (21 pts), loops 2 (4 pts), ternaries 3 (4 pts), boolean chains 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 · AttributeProvider.populateDefinedRuleAttributeValues (cognitive 30) · ×1
  • AttributeProvider.populateDefinedRuleAttributeValues (cognitive 30) src/main/java/com/google/devtools/build/lib/packages/AttributeProvider.java:186 — AttributeProvider.populateDefinedRuleAttributeValues has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (18 pts), error handling 2 (6 pts), ternaries 1 (3 pts), boolean chains 2, loops 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 · StarlarkActionFactory.symlink (cognitive 30) · ×1
  • StarlarkActionFactory.symlink (cognitive 30) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkActionFactory.java:259 — StarlarkActionFactory.symlink has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (22 pts), ternaries 3 (7 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 · CommonPrerequisiteValidator.validateDirectPrerequisiteVisibility (cognitive 30) · ×1
  • CommonPrerequisiteValidator.validateDirectPrerequisiteVisibility (cognitive 30) src/main/java/com/google/devtools/build/lib/analysis/CommonPrerequisiteValidator.java:187 — CommonPrerequisiteValidator.validateDirectPrerequisiteVisibility has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 3, 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 · BuildView.createTopLevelAspectKeys (cognitive 30) · ×1
  • BuildView.createTopLevelAspectKeys (cognitive 30) src/main/java/com/google/devtools/build/lib/analysis/BuildView.java:532 — BuildView.createTopLevelAspectKeys has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (24 pts), error handling 2 (4 pts), boolean chains 1, loops 1 (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 · mirror_external_deps.collect_candidates (cognitive 30) · ×1
  • mirror_external_deps.collect_candidates (cognitive 30) tools/mirror_external_deps.py:185 — mirror_external_deps.collect_candidates has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 5, loops 3 (4 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 · TypeChecker.inferIndexUnfolded (cognitive 29) · ×1
  • TypeChecker.inferIndexUnfolded (cognitive 29) src/main/java/net/starlark/java/syntax/TypeChecker.java:341 — TypeChecker.inferIndexUnfolded has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (27 pts), boolean chains 1, loops 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 · Resolver.visit (cognitive 29) · ×1
  • Resolver.visit (cognitive 29) src/main/java/net/starlark/java/syntax/Resolver.java:783 — Resolver.visit has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (28 pts), loops 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 · Decoder.parseString (cognitive 29) · ×1
  • Decoder.parseString (cognitive 29) src/main/java/net/starlark/java/lib/json/Json.java:485 — Decoder.parseString has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (4 pts), error handling 1 (3 pts), ternaries 1 (3 pts), match/switch 1 (2 pts), boolean chains 1 (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 · Printer.formatWithList (cognitive 29) · ×1
  • Printer.formatWithList (cognitive 29) src/main/java/net/starlark/java/eval/Printer.java:462 — Printer.formatWithList has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 3 (12 pts), if/else 6 (11 pts), error handling 1 (3 pts), match/switch 1 (2 pts), loops 1 (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 · IsolatedOptionsData.from (cognitive 29) · ×1
  • IsolatedOptionsData.from (cognitive 29) src/main/java/com/google/devtools/common/options/IsolatedOptionsData.java:270 — IsolatedOptionsData.from has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (19 pts), error handling 2 (5 pts), loops 3 (5 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 · DeletingNodeVisitor.visit (cognitive 29) · ×1
  • DeletingNodeVisitor.visit (cognitive 29) src/main/java/com/google/devtools/build/skyframe/InvalidatingNodeVisitor.java:300 — DeletingNodeVisitor.visit has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (14 pts), error handling 2 (6 pts), loops 4 (6 pts), ternaries 1 (2 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 · CommandFailureUtils.describeCommand (cognitive 29) · ×1
  • CommandFailureUtils.describeCommand (cognitive 29) src/main/java/com/google/devtools/build/lib/util/CommandFailureUtils.java:44 — CommandFailureUtils.describeCommand has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (20 pts), ternaries 2 (7 pts), boolean chains 1, loops 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 · NodeDependencyHandler.reduce (cognitive 29) · ×1
  • NodeDependencyHandler.reduce (cognitive 29) src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/FileDependencySerializer.java:955 — NodeDependencyHandler.reduce has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 5 (11 pts), loops 2, boolean chains 1 (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 · BuildOptionsScopeFunction.compute (cognitive 29) · ×1
  • BuildOptionsScopeFunction.compute (cognitive 29) src/main/java/com/google/devtools/build/lib/skyframe/BuildOptionsScopeFunction.java:61 — BuildOptionsScopeFunction.compute has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (21 pts), ternaries 2 (4 pts), loops 3, error handling 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 · DiskCacheClient.refreshActionResult (cognitive 29) · ×1
  • DiskCacheClient.refreshActionResult (cognitive 29) src/main/java/com/google/devtools/build/lib/remote/disk/DiskCacheClient.java:253 — DiskCacheClient.refreshActionResult has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 4, loops 3 (4 pts), error handling 1 (2 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 · RuleClass.checkAspectAllowedValues (cognitive 29) · ×1
  • RuleClass.checkAspectAllowedValues (cognitive 29) src/main/java/com/google/devtools/build/lib/packages/RuleClass.java:2165 — RuleClass.checkAspectAllowedValues has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (20 pts), loops 3 (9 pts) (nesting depth added 21). 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 · Builder.<init> (cognitive 29) · ×1
  • Builder.<init> (cognitive 29) src/main/java/com/google/devtools/build/lib/packages/RuleClass.java:765 — Builder.<init> has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 5, loops 2 (3 pts), error handling 1 (2 pts) (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 · MacroClass.instantiateMacro (cognitive 29) · ×1
  • MacroClass.instantiateMacro (cognitive 29) src/main/java/com/google/devtools/build/lib/packages/MacroClass.java:210 — MacroClass.instantiateMacro has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 4, loops 2, ternaries 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 · LabelValidator.validateTargetName (cognitive 29) · ×1
  • LabelValidator.validateTargetName (cognitive 29) src/main/java/com/google/devtools/build/lib/cmdline/LabelValidator.java:146 — LabelValidator.validateTargetName has cognitive complexity 29 (threshold 15). Drivers by points: if/else 18 (26 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 · UrlRewriterConfig.parseConfig (cognitive 29) · ×1
  • UrlRewriterConfig.parseConfig (cognitive 29) src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/UrlRewriterConfig.java:125 — UrlRewriterConfig.parseConfig has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (22 pts), error handling 2 (4 pts), match/switch 1 (2 pts), loops 1 (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 · StarlarkRuleConfiguredTargetUtil.addProviders (cognitive 29) · ×1
  • StarlarkRuleConfiguredTargetUtil.addProviders (cognitive 29) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleConfiguredTargetUtil.java:239 — StarlarkRuleConfiguredTargetUtil.addProviders has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (24 pts), loops 2 (3 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 · FunctionTransitionUtil.applyStarlarkFlagsAliases (cognitive 29) · ×1
  • FunctionTransitionUtil.applyStarlarkFlagsAliases (cognitive 29) src/main/java/com/google/devtools/build/lib/analysis/starlark/FunctionTransitionUtil.java:345 — FunctionTransitionUtil.applyStarlarkFlagsAliases has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (17 pts), ternaries 3 (7 pts), boolean chains 4, loops 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 · DependencyMapProducer.attributeResolutionStep (cognitive 29) · ×1
  • DependencyMapProducer.attributeResolutionStep (cognitive 29) src/main/java/com/google/devtools/build/lib/analysis/producers/DependencyMapProducer.java:329 — DependencyMapProducer.attributeResolutionStep has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (8 pts), ternaries 2 (4 pts), boolean chains 2 (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 · BuildView.update (cognitive 29) · ×1
  • BuildView.update (cognitive 29) src/main/java/com/google/devtools/build/lib/analysis/BuildView.java:224 — BuildView.update has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 5, ternaries 1 (2 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 · CompactPersistentActionCache.encode (cognitive 29) · ×1
  • CompactPersistentActionCache.encode (cognitive 29) src/main/java/com/google/devtools/build/lib/actions/cache/CompactPersistentActionCache.java:868 — CompactPersistentActionCache.encode has cognitive complexity 29 (threshold 15). Drivers by points: loops 6 (13 pts), if/else 8 (12 pts), ternaries 3 (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 · CommandLines.expand (cognitive 29) · ×1
  • CommandLines.expand (cognitive 29) src/main/java/com/google/devtools/build/lib/actions/CommandLines.java:84 — CommandLines.expand has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 2 (6 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 · Main.main (cognitive 28) · ×1
  • Main.main (cognitive 28) src/main/java/net/starlark/java/cmd/Main.java:171 — Main.main has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (25 pts), error handling 1 (2 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 · PathFragment.isNormalizedImpl (cognitive 28) · ×1
  • PathFragment.isNormalizedImpl (cognitive 28) src/main/java/com/google/devtools/build/lib/vfs/PathFragment.java:879 — PathFragment.isNormalizedImpl has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (24 pts), match/switch 2 (3 pts), loops 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 · BlazeOptionHandler.structureRcOptionsAndConfigs (cognitive 28) · ×1
  • BlazeOptionHandler.structureRcOptionsAndConfigs (cognitive 28) src/main/java/com/google/devtools/build/lib/runtime/BlazeOptionHandler.java:730 — BlazeOptionHandler.structureRcOptionsAndConfigs has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 3 (7 pts), boolean chains 4 (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 · CppConfiguration.<init> (cognitive 28) · ×1
  • CppConfiguration.<init> (cognitive 28) src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java:169 — CppConfiguration.<init> has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (16 pts), error handling 3 (6 pts), ternaries 4, 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 · ConfigSetting.optionMatches (cognitive 28) · ×1
  • ConfigSetting.optionMatches (cognitive 28) src/main/java/com/google/devtools/build/lib/rules/config/ConfigSetting.java:518 — ConfigSetting.optionMatches has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 7 (17 pts), if/else 5 (7 pts), boolean chains 2, loops 1 (2 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 · RemoteSpawnRunner.exec (cognitive 28) · ×1
  • RemoteSpawnRunner.exec (cognitive 28) src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java:182 — RemoteSpawnRunner.exec has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 8 (10 pts), boolean chains 4, ternaries 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 · RemoteExecutionService.waitForAndReuseOutputs (cognitive 28) · ×1
  • RemoteExecutionService.waitForAndReuseOutputs (cognitive 28) src/main/java/com/google/devtools/build/lib/remote/RemoteExecutionService.java:1671 — RemoteExecutionService.waitForAndReuseOutputs has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (15 pts), error handling 5 (9 pts), loops 2 (3 pts), ternaries 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 · RepositoryUtils.replantSymlinks (cognitive 28) · ×1
  • RepositoryUtils.replantSymlinks (cognitive 28) src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryUtils.java:109 — RepositoryUtils.replantSymlinks has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (22 pts), error handling 2 (4 pts), boolean chains 1, loops 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 · GoogleAuthUtils.newChannel (cognitive 28) · ×1
  • GoogleAuthUtils.newChannel (cognitive 28) src/main/java/com/google/devtools/build/lib/authandtls/GoogleAuthUtils.java:74 — GoogleAuthUtils.newChannel has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 5 (11 pts), boolean chains 3, error handling 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 · TestRunnerAction.getTestOutputsMapping (cognitive 28) · ×1
  • TestRunnerAction.getTestOutputsMapping (cognitive 28) src/main/java/com/google/devtools/build/lib/analysis/test/TestRunnerAction.java:418 — TestRunnerAction.getTestOutputsMapping has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 3 (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 · NodePrinter.printStmt (cognitive 27) · ×1
  • NodePrinter.printStmt (cognitive 27) src/main/java/net/starlark/java/syntax/NodePrinter.java:159 — NodePrinter.printStmt has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 2 (5 pts), ternaries 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 13). 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 · Starlark.slice (cognitive 27) · ×1
  • Starlark.slice (cognitive 27) src/main/java/net/starlark/java/eval/Starlark.java:796 — Starlark.slice has cognitive complexity 27 (threshold 15). Drivers by points: if/else 20 (27 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 · MethodLibrary.floatForStarlark (cognitive 27) · ×1
  • MethodLibrary.floatForStarlark (cognitive 27) src/main/java/net/starlark/java/eval/MethodLibrary.java:555 — MethodLibrary.floatForStarlark has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 3, error handling 1 (3 pts), match/switch 1 (2 pts), ternaries 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 · ObjectGraphTraverser.getFields (cognitive 27) · ×1
  • ObjectGraphTraverser.getFields (cognitive 27) src/main/java/com/google/devtools/build/lib/util/ObjectGraphTraverser.java:480 — ObjectGraphTraverser.getFields has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 3 (5 pts), error handling 1 (3 pts), boolean chains 1 (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 · RecursiveFilesystemTraversalFunction.compute (cognitive 27) · ×1
  • RecursiveFilesystemTraversalFunction.compute (cognitive 27) src/main/java/com/google/devtools/build/lib/skyframe/RecursiveFilesystemTraversalFunction.java:180 — RecursiveFilesystemTraversalFunction.compute has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 2, loops 1 (2 pts), error handling 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 · IgnoredSubdirectoriesFunction.computeIgnoredPrefixes (cognitive 27) · ×1
  • IgnoredSubdirectoriesFunction.computeIgnoredPrefixes (cognitive 27) src/main/java/com/google/devtools/build/lib/skyframe/IgnoredSubdirectoriesFunction.java:128 — IgnoredSubdirectoriesFunction.computeIgnoredPrefixes has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 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 · EvalMacroFunction.compute (cognitive 27) · ×1
  • EvalMacroFunction.compute (cognitive 27) src/main/java/com/google/devtools/build/lib/skyframe/EvalMacroFunction.java:71 — EvalMacroFunction.compute has cognitive complexity 27 (threshold 15). Drivers by points: error handling 11 (15 pts), if/else 9 (11 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 · ConfiguredTargetFunction.compute (cognitive 27) · ×1
  • ConfiguredTargetFunction.compute (cognitive 27) src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetFunction.java:256 — ConfiguredTargetFunction.compute has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (16 pts), error handling 5, boolean chains 2, loops 1 (2 pts), match/switch 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 · ActionExecutionFunction.addDiscoveredInputs (cognitive 27) · ×1
  • ActionExecutionFunction.addDiscoveredInputs (cognitive 27) src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java:874 — ActionExecutionFunction.addDiscoveredInputs has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (20 pts), error handling 2 (4 pts), loops 2, ternaries 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 · ActionDumpWriter.maybeAddEdges (cognitive 27) · ×1
  • ActionDumpWriter.maybeAddEdges (cognitive 27) src/main/java/com/google/devtools/build/lib/runtime/ExecutionGraphModule.java:573 — ActionDumpWriter.maybeAddEdges has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 4 (5 pts), boolean chains 3 (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 · JavaUtil.javaSegmentIndexImpl (cognitive 27) · ×1
  • JavaUtil.javaSegmentIndexImpl (cognitive 27) src/main/java/com/google/devtools/build/lib/rules/java/JavaUtil.java:89 — JavaUtil.javaSegmentIndexImpl has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 8, loops 1 (2 pts), ternaries 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 · JsonTraceFileWriter.run (cognitive 27) · ×1
  • JsonTraceFileWriter.run (cognitive 27) src/main/java/com/google/devtools/build/lib/profiler/JsonTraceFileWriter.java:252 — JsonTraceFileWriter.run has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 3 (5 pts), error handling 2, boolean chains 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 · SubprocessHandler.start (cognitive 27) · ×1
  • SubprocessHandler.start (cognitive 27) src/main/java/com/google/devtools/build/lib/exec/local/LocalSpawnRunner.java:310 — SubprocessHandler.start has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 5 (7 pts), boolean chains 5, error handling 4, loops 1 (nesting depth added 3). 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 · ExpandedSpawnLogContext.logSpawn (cognitive 27) · ×1
  • ExpandedSpawnLogContext.logSpawn (cognitive 27) src/main/java/com/google/devtools/build/lib/exec/ExpandedSpawnLogContext.java:156 — ExpandedSpawnLogContext.logSpawn has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 6, loops 3, error handling 2 (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 · DownloadManager.downloadAndReadOneUrlForBzlmod (cognitive 27) · ×1
  • DownloadManager.downloadAndReadOneUrlForBzlmod (cognitive 27) src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/DownloadManager.java:409 — DownloadManager.downloadAndReadOneUrlForBzlmod has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (17 pts), error handling 4 (8 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 · IndexRegistry.createArchiveRepoSpec (cognitive 27) · ×1
  • IndexRegistry.createArchiveRepoSpec (cognitive 27) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/IndexRegistry.java:472 — IndexRegistry.createArchiveRepoSpec has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 3 (6 pts), loops 3 (5 pts), boolean chains 3, error handling 1 (2 pts) (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 · Eval.execFor (cognitive 26) · ×1
  • Eval.execFor (cognitive 26) src/main/java/net/starlark/java/eval/Eval.java:155 — Eval.execFor has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 4 (12 pts), if/else 5 (9 pts), loops 2 (4 pts), error handling 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 · Driver.drive (cognitive 26) · ×1
  • Driver.drive (cognitive 26) src/main/java/com/google/devtools/build/skyframe/state/Driver.java:54 — Driver.drive has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 4 (8 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 · ChangePrunableNodesFinder.scanCandidates (cognitive 26) · ×1
  • ChangePrunableNodesFinder.scanCandidates (cognitive 26) src/main/java/com/google/devtools/build/skyframe/ChangePrunableNodesFinder.java:102 — ChangePrunableNodesFinder.scanCandidates has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 3 (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 · ObjectCodecRegistry.<init> (cognitive 26) · ×1
  • ObjectCodecRegistry.<init> (cognitive 26) src/main/java/com/google/devtools/build/lib/skyframe/serialization/ObjectCodecRegistry.java:84 — ObjectCodecRegistry.<init> has cognitive complexity 26 (threshold 15). Drivers by points: loops 7 (15 pts), if/else 11 (nesting depth added 8). 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 · EnvironmentBackedRecursivePackageProvider.streamPackagesUnderDirectory (cognitive 26) · ×1
  • EnvironmentBackedRecursivePackageProvider.streamPackagesUnderDirectory (cognitive 26) src/main/java/com/google/devtools/build/lib/skyframe/EnvironmentBackedRecursivePackageProvider.java:176 — EnvironmentBackedRecursivePackageProvider.streamPackagesUnderDirectory has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 2 (3 pts), error handling 1 (2 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 · ActionExecutionFunction.checkCacheAndExecuteIfNeeded (cognitive 26) · ×1
  • ActionExecutionFunction.checkCacheAndExecuteIfNeeded (cognitive 26) src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java:669 — ActionExecutionFunction.checkCacheAndExecuteIfNeeded has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 2, ternaries 1 (2 pts) (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 · SandboxHelpers.cleanRecursively (cognitive 26) · ×1
  • SandboxHelpers.cleanRecursively (cognitive 26) src/main/java/com/google/devtools/build/lib/sandbox/SandboxHelpers.java:401 — SandboxHelpers.cleanRecursively has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (23 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 · LinuxSandboxUtil.validateBindMounts (cognitive 26) · ×1
  • LinuxSandboxUtil.validateBindMounts (cognitive 26) src/main/java/com/google/devtools/build/lib/sandbox/LinuxSandboxUtil.java:56 — LinuxSandboxUtil.validateBindMounts has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 2 (8 pts), boolean chains 5, error handling 2 (4 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 · QueryCommand.doQuery (cognitive 26) · ×1
  • QueryCommand.doQuery (cognitive 26) src/main/java/com/google/devtools/build/lib/runtime/commands/QueryCommand.java:76 — QueryCommand.doQuery has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (11 pts), error handling 8 (10 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 5). 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 · HttpDownloadHandler.channelRead0 (cognitive 26) · ×1
  • HttpDownloadHandler.channelRead0 (cognitive 26) src/main/java/com/google/devtools/build/lib/remote/http/HttpDownloadHandler.java:71 — HttpDownloadHandler.channelRead0 has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (24 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 · RemoteImportantOutputHandler.downloadArtifact (cognitive 26) · ×1
  • RemoteImportantOutputHandler.downloadArtifact (cognitive 26) src/main/java/com/google/devtools/build/lib/remote/RemoteImportantOutputHandler.java:183 — RemoteImportantOutputHandler.downloadArtifact has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (17 pts), ternaries 2 (6 pts), loops 1 (2 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 · RemoteExternalOverlayFileSystem.injectRecursively (cognitive 26) · ×1
  • RemoteExternalOverlayFileSystem.injectRecursively (cognitive 26) src/main/java/com/google/devtools/build/lib/remote/RemoteExternalOverlayFileSystem.java:288 — RemoteExternalOverlayFileSystem.injectRecursively has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 3 (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 · ProtoOutputFormatterCallback.processOutput (cognitive 26) · ×1
  • ProtoOutputFormatterCallback.processOutput (cognitive 26) src/main/java/com/google/devtools/build/lib/query2/cquery/ProtoOutputFormatterCallback.java:267 — ProtoOutputFormatterCallback.processOutput has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (18 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 · RBuildFilesVisitor.getSkyKeysForFileFragments (cognitive 26) · ×1
  • RBuildFilesVisitor.getSkyKeysForFileFragments (cognitive 26) src/main/java/com/google/devtools/build/lib/query2/RBuildFilesVisitor.java:200 — RBuildFilesVisitor.getSkyKeysForFileFragments has cognitive complexity 26 (threshold 15). Drivers by points: loops 5 (14 pts), if/else 5 (12 pts) (nesting depth added 16). 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 · PostAnalysisQueryEnvironment.getConfiguredTargetsForConfigFunction (cognitive 26) · ×1
  • PostAnalysisQueryEnvironment.getConfiguredTargetsForConfigFunction (cognitive 26) src/main/java/com/google/devtools/build/lib/query2/PostAnalysisQueryEnvironment.java:270 — PostAnalysisQueryEnvironment.getConfiguredTargetsForConfigFunction has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 2 (5 pts), match/switch 1 (2 pts), ternaries 1 (2 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 · ImplicitOutputsFunction.attributeValues (cognitive 26) · ×1
  • ImplicitOutputsFunction.attributeValues (cognitive 26) src/main/java/com/google/devtools/build/lib/packages/ImplicitOutputsFunction.java:374 — ImplicitOutputsFunction.attributeValues has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 8 (16 pts), if/else 10 (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 · TestXmlOutputParser.parseContainedElements (cognitive 26) · ×1
  • TestXmlOutputParser.parseContainedElements (cognitive 26) src/main/java/com/google/devtools/build/lib/exec/TestXmlOutputParser.java:222 — TestXmlOutputParser.parseContainedElements has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 2 (5 pts), loops 2 (4 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 · BuildTool.processRequestHandleCheckedExceptions (cognitive 26) · ×1
  • BuildTool.processRequestHandleCheckedExceptions (cognitive 26) src/main/java/com/google/devtools/build/lib/buildtool/BuildTool.java:1005 — BuildTool.processRequestHandleCheckedExceptions has cognitive complexity 26 (threshold 15). Drivers by points: error handling 12 (13 pts), if/else 7 (11 pts), boolean chains 2 (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 · ModuleFileFunction.getModuleFile (cognitive 26) · ×1
  • ModuleFileFunction.getModuleFile (cognitive 26) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleFileFunction.java:816 — ModuleFileFunction.getModuleFile has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (18 pts), error handling 3 (6 pts), loops 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 · RuleContextConstraintSemantics.getConstraintCheckedDependencies (cognitive 26) · ×1
  • RuleContextConstraintSemantics.getConstraintCheckedDependencies (cognitive 26) src/main/java/com/google/devtools/build/lib/analysis/constraints/RuleContextConstraintSemantics.java:730 — RuleContextConstraintSemantics.getConstraintCheckedDependencies has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (17 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (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 · BuildView.addExtraActionsIfRequested (cognitive 26) · ×1
  • BuildView.addExtraActionsIfRequested (cognitive 26) src/main/java/com/google/devtools/build/lib/analysis/BuildView.java:815 — BuildView.addExtraActionsIfRequested has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (6 pts), error handling 1 (4 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 · Starlark.classType (cognitive 25) · ×1
  • Starlark.classType (cognitive 25) src/main/java/net/starlark/java/eval/Starlark.java:423 — Starlark.classType has cognitive complexity 25 (threshold 15). Drivers by points: if/else 23, ternaries 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 · TestCompletionFunction.compute (cognitive 25) · ×1
  • TestCompletionFunction.compute (cognitive 25) src/main/java/com/google/devtools/build/lib/skyframe/TestCompletionFunction.java:50 — TestCompletionFunction.compute has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 2 (4 pts), error handling 1 (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 · RecursiveExpander.expand (cognitive 25) · ×1
  • RecursiveExpander.expand (cognitive 25) src/main/java/com/google/devtools/build/lib/skyframe/EvalMacroFunction.java:305 — RecursiveExpander.expand has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 2 (4 pts), boolean chains 2, ternaries 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 · BzlLoadFunction.getAndDigestPredeclaredEnvironment (cognitive 25) · ×1
  • BzlLoadFunction.getAndDigestPredeclaredEnvironment (cognitive 25) src/main/java/com/google/devtools/build/lib/skyframe/BzlLoadFunction.java:1329 — BzlLoadFunction.getAndDigestPredeclaredEnvironment has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 3 (10 pts), boolean chains 2 (nesting depth added 12). 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 · SandboxModule.cleanSandboxBaseOnFirstBuild (cognitive 25) · ×1
  • SandboxModule.cleanSandboxBaseOnFirstBuild (cognitive 25) src/main/java/com/google/devtools/build/lib/sandbox/SandboxModule.java:380 — SandboxModule.cleanSandboxBaseOnFirstBuild has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 2 (3 pts), boolean chains 2, error handling 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 · BlazeRuntime.deleteOutputBase (cognitive 25) · ×1
  • BlazeRuntime.deleteOutputBase (cognitive 25) src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java:2069 — BlazeRuntime.deleteOutputBase has cognitive complexity 25 (threshold 15). Drivers by points: error handling 6 (11 pts), if/else 6 (7 pts), boolean chains 4, ternaries 2 (3 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 · BlazeCommandDispatcher.exec (cognitive 25) · ×1
  • BlazeCommandDispatcher.exec (cognitive 25) src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java:193 — BlazeCommandDispatcher.exec has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (15 pts), ternaries 3 (6 pts), error handling 1 (2 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 · RemoteSpawnRunner.handleError (cognitive 25) · ×1
  • RemoteSpawnRunner.handleError (cognitive 25) src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java:600 — RemoteSpawnRunner.handleError has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (21 pts), error handling 1 (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 · TaskData.writeTraceData (cognitive 25) · ×1
  • TaskData.writeTraceData (cognitive 25) src/main/java/com/google/devtools/build/lib/profiler/TaskData.java:74 — TaskData.writeTraceData has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 4, ternaries 3 (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 · DynamicSpawnStrategy.stopBranch (cognitive 25) · ×1
  • DynamicSpawnStrategy.stopBranch (cognitive 25) src/main/java/com/google/devtools/build/lib/dynamic/DynamicSpawnStrategy.java:680 — DynamicSpawnStrategy.stopBranch has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (20 pts), ternaries 1 (4 pts), boolean chains 1 (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 · BuildTool.buildTargetsWithoutMergedAnalysisExecution (cognitive 25) · ×1
  • BuildTool.buildTargetsWithoutMergedAnalysisExecution (cognitive 25) src/main/java/com/google/devtools/build/lib/buildtool/BuildTool.java:557 — BuildTool.buildTargetsWithoutMergedAnalysisExecution has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 2 (6 pts), boolean chains 3, 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 · ConfiguredTargetFactory.createRule (cognitive 25) · ×1
  • ConfiguredTargetFactory.createRule (cognitive 25) src/main/java/com/google/devtools/build/lib/analysis/ConfiguredTargetFactory.java:383 — ConfiguredTargetFactory.createRule has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (18 pts), ternaries 2 (4 pts), error handling 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 · BuildView.checkUnknownOutputGroups (cognitive 25) · ×1
  • BuildView.checkUnknownOutputGroups (cognitive 25) src/main/java/com/google/devtools/build/lib/analysis/BuildView.java:952 — BuildView.checkUnknownOutputGroups has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 5, loops 2 (3 pts), ternaries 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 · TypeChecker.checkCallMissingMandatoryArgs (cognitive 24) · ×1
  • TypeChecker.checkCallMissingMandatoryArgs (cognitive 24) src/main/java/net/starlark/java/syntax/TypeChecker.java:896 — TypeChecker.checkCallMissingMandatoryArgs has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 3, loops 1 (2 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 · TypeChecker.inferBinaryOperator (cognitive 24) · ×1
  • TypeChecker.inferBinaryOperator (cognitive 24) src/main/java/net/starlark/java/syntax/TypeChecker.java:516 — TypeChecker.inferBinaryOperator has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 4, ternaries 3 (4 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 · WorkerFilesHash.getWorkerFilesWithDigests (cognitive 24) · ×1
  • WorkerFilesHash.getWorkerFilesWithDigests (cognitive 24) src/main/java/com/google/devtools/build/lib/worker/WorkerFilesHash.java:66 — WorkerFilesHash.getWorkerFilesWithDigests has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 2 (4 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 · JsonWorkerMessageProcessor.readWorkRequest (cognitive 24) · ×1
  • JsonWorkerMessageProcessor.readWorkRequest (cognitive 24) src/main/java/com/google/devtools/build/lib/worker/JsonWorkerMessageProcessor.java:103 — JsonWorkerMessageProcessor.readWorkRequest has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 1 (2 pts), error handling 1, 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 · GlobVisitor.reallyGlob (cognitive 24) · ×1
  • GlobVisitor.reallyGlob (cognitive 24) src/main/java/com/google/devtools/build/lib/vfs/UnixGlob.java:776 — GlobVisitor.reallyGlob has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 5, 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 · FlagSetFunction.expandConfigFlags (cognitive 24) · ×1
  • FlagSetFunction.expandConfigFlags (cognitive 24) src/main/java/com/google/devtools/build/lib/skyframe/config/FlagSetFunction.java:547 — FlagSetFunction.expandConfigFlags has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (6 pts), ternaries 1 (3 pts), boolean chains 2, error handling 1 (2 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 · ActionExecutionFunctionExceptionHandler.accumulateAndMaybeThrowExceptions (cognitive 24) · ×1
  • ActionExecutionFunctionExceptionHandler.accumulateAndMaybeThrowExceptions (cognitive 24) src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java:1461 — ActionExecutionFunctionExceptionHandler.accumulateAndMaybeThrowExceptions has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (13 pts), error handling 3 (6 pts), loops 2 (4 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 · CommandServer.run (cognitive 24) · ×1
  • CommandServer.run (cognitive 24) src/main/java/com/google/devtools/build/lib/server/CommandServer.java:427 — CommandServer.run has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (8 pts), error handling 6 (7 pts), ternaries 5 (7 pts), boolean chains 1, loops 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.
D2 · Cognitive Complexity · RemoteRewoundActionSynchronizer.prepareOutputsForRewinding (cognitive 24) · ×1
  • RemoteRewoundActionSynchronizer.prepareOutputsForRewinding (cognitive 24) src/main/java/com/google/devtools/build/lib/remote/RemoteRewoundActionSynchronizer.java:236 — RemoteRewoundActionSynchronizer.prepareOutputsForRewinding has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (7 pts), error handling 1 (4 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 · XmlOutputFormatter.createTargetElement (cognitive 24) · ×1
  • XmlOutputFormatter.createTargetElement (cognitive 24) src/main/java/com/google/devtools/build/lib/query2/query/output/XmlOutputFormatter.java:147 — XmlOutputFormatter.createTargetElement has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 4 (8 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 · SyntheticAttributeHashCalculator.compute (cognitive 24) · ×1
  • SyntheticAttributeHashCalculator.compute (cognitive 24) src/main/java/com/google/devtools/build/lib/query2/query/output/SyntheticAttributeHashCalculator.java:56 — SyntheticAttributeHashCalculator.compute has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 6 (10 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 · NetworkMetricsCollector.collectSystemNetworkUsages (cognitive 24) · ×1
  • NetworkMetricsCollector.collectSystemNetworkUsages (cognitive 24) src/main/java/com/google/devtools/build/lib/profiler/NetworkMetricsCollector.java:55 — NetworkMetricsCollector.collectSystemNetworkUsages has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (18 pts), error handling 2 (3 pts), loops 1 (2 pts), boolean chains 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 · CompileOneDependencyTransformer.listContainsFile (cognitive 24) · ×1
  • CompileOneDependencyTransformer.listContainsFile (cognitive 24) src/main/java/com/google/devtools/build/lib/pkgcache/CompileOneDependencyTransformer.java:209 — CompileOneDependencyTransformer.listContainsFile has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 2 (4 pts), error handling 1 (2 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 · BuildType.selectableConvert (cognitive 24) · ×1
  • BuildType.selectableConvert (cognitive 24) src/main/java/com/google/devtools/build/lib/packages/BuildType.java:166 — BuildType.selectableConvert has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 1 (2 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 · RepositoryFetchFunction.fetch (cognitive 24) · ×1
  • RepositoryFetchFunction.fetch (cognitive 24) src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryFetchFunction.java:602 — RepositoryFetchFunction.fetch has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (15 pts), error handling 7 (9 pts) (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 · RepoMappingManifestAction.newDeterministicWriter (cognitive 24) · ×1
  • RepoMappingManifestAction.newDeterministicWriter (cognitive 24) src/main/java/com/google/devtools/build/lib/analysis/RepoMappingManifestAction.java:191 — RepoMappingManifestAction.newDeterministicWriter has cognitive complexity 24 (threshold 15). Drivers by points: loops 7 (15 pts), if/else 4 (5 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 11). 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 · MethodDescriptor.buildStarlarkType (cognitive 23) · ×1
  • MethodDescriptor.buildStarlarkType (cognitive 23) src/main/java/net/starlark/java/eval/MethodDescriptor.java:159 — MethodDescriptor.buildStarlarkType has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 2, ternaries 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 · BuiltinFunction.applyDefaultsReportMissingArgs (cognitive 23) · ×1
  • BuiltinFunction.applyDefaultsReportMissingArgs (cognitive 23) src/main/java/net/starlark/java/eval/BuiltinFunction.java:472 — BuiltinFunction.applyDefaultsReportMissingArgs has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 1 (nesting depth added 14). 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 · StarlarkMethodProcessor.checkParameter (cognitive 23) · ×1
  • StarlarkMethodProcessor.checkParameter (cognitive 23) src/main/java/net/starlark/java/annot/processor/StarlarkMethodProcessor.java:400 — StarlarkMethodProcessor.checkParameter has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 3, loops 2 (3 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 · AttributeInfoExtractor.getAttributeType (cognitive 23) · ×1
  • AttributeInfoExtractor.getAttributeType (cognitive 23) src/main/java/com/google/devtools/build/lib/starlarkdocextract/AttributeInfoExtractor.java:111 — AttributeInfoExtractor.getAttributeType has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18 (19 pts), boolean chains 4 (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 · SingleToolchainResolutionFunction.resolveConstraints (cognitive 23) · ×1
  • SingleToolchainResolutionFunction.resolveConstraints (cognitive 23) src/main/java/com/google/devtools/build/lib/skyframe/toolchains/SingleToolchainResolutionFunction.java:153 — SingleToolchainResolutionFunction.resolveConstraints has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (14 pts), ternaries 1 (4 pts), loops 2 (3 pts), boolean chains 2 (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 · FileOpNodeMemoizingLookup.accumulateTransitiveFileSystemOperations (cognitive 23) · ×1
  • FileOpNodeMemoizingLookup.accumulateTransitiveFileSystemOperations (cognitive 23) src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/FileOpNodeMemoizingLookup.java:226 — FileOpNodeMemoizingLookup.accumulateTransitiveFileSystemOperations has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 2 (6 pts), loops 2 (4 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 · RewindableGraphInconsistencyReceiver.noteInconsistencyAndMaybeThrow (cognitive 23) · ×1
  • RewindableGraphInconsistencyReceiver.noteInconsistencyAndMaybeThrow (cognitive 23) src/main/java/com/google/devtools/build/lib/skyframe/rewinding/RewindableGraphInconsistencyReceiver.java:65 — RewindableGraphInconsistencyReceiver.noteInconsistencyAndMaybeThrow has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 6, ternaries 2 (4 pts), match/switch 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 · SkyframeBuildView.analyzeAndExecuteTargets (cognitive 23) · ×1
  • SkyframeBuildView.analyzeAndExecuteTargets (cognitive 23) src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java:620 — SkyframeBuildView.analyzeAndExecuteTargets has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5, ternaries 3 (4 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 · ActionLookupValueProgressReceiver.evaluated (cognitive 23) · ×1
  • ActionLookupValueProgressReceiver.evaluated (cognitive 23) src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java:1511 — ActionLookupValueProgressReceiver.evaluated has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 1 (3 pts) (nesting depth added 13). 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 · LinuxSandboxCommandLineBuilder.buildForCommand (cognitive 23) · ×1
  • LinuxSandboxCommandLineBuilder.buildForCommand (cognitive 23) src/main/java/com/google/devtools/build/lib/sandbox/LinuxSandboxCommandLineBuilder.java:233 — LinuxSandboxCommandLineBuilder.buildForCommand has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17 (18 pts), loops 4, boolean chains 1 (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 · ConfigExpander.expandConfigOptions (cognitive 23) · ×1
  • ConfigExpander.expandConfigOptions (cognitive 23) src/main/java/com/google/devtools/build/lib/runtime/ConfigExpander.java:93 — ConfigExpander.expandConfigOptions has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 4 (5 pts), boolean chains 3 (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 · Builder.build (cognitive 23) · ×1
  • Builder.build (cognitive 23) src/main/java/com/google/devtools/build/lib/rules/java/JavaHeaderCompileAction.java:435 — Builder.build has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 4, ternaries 3 (nesting depth added 2). 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 · PathCanonicalizer.resolveSymbolicLinks (cognitive 23) · ×1
  • PathCanonicalizer.resolveSymbolicLinks (cognitive 23) src/main/java/com/google/devtools/build/lib/remote/PathCanonicalizer.java:119 — PathCanonicalizer.resolveSymbolicLinks has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (20 pts), match/switch 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 · SkyQueryEnvironment.processRawReverseDeps (cognitive 23) · ×1
  • SkyQueryEnvironment.processRawReverseDeps (cognitive 23) src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java:819 — SkyQueryEnvironment.processRawReverseDeps has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 3 (8 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 · TargetRecorder.checkRuleAndOutputs (cognitive 23) · ×1
  • TargetRecorder.checkRuleAndOutputs (cognitive 23) src/main/java/com/google/devtools/build/lib/packages/TargetRecorder.java:542 — TargetRecorder.checkRuleAndOutputs has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 3 (5 pts), boolean chains 2 (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 · AggregatingAttributeMapper.visitLabels (cognitive 23) · ×1
  • AggregatingAttributeMapper.visitLabels (cognitive 23) src/main/java/com/google/devtools/build/lib/packages/AggregatingAttributeMapper.java:107 — AggregatingAttributeMapper.visitLabels has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 4, loops 1 (2 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 · InclusionCache.locateOnFrameworkPaths (cognitive 23) · ×1
  • InclusionCache.locateOnFrameworkPaths (cognitive 23) src/main/java/com/google/devtools/build/lib/includescanning/LegacyIncludeScanner.java:243 — InclusionCache.locateOnFrameworkPaths has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (19 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 · AbstractSpawnStrategy.exec (cognitive 23) · ×1
  • AbstractSpawnStrategy.exec (cognitive 23) src/main/java/com/google/devtools/build/lib/exec/AbstractSpawnStrategy.java:101 — AbstractSpawnStrategy.exec has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (14 pts), error handling 4 (5 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 5). 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 · ConcurrentIdentitySet.add (cognitive 23) · ×1
  • ConcurrentIdentitySet.add (cognitive 23) src/main/java/com/google/devtools/build/lib/collect/ConcurrentIdentitySet.java:58 — ConcurrentIdentitySet.add has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (20 pts), loops 2 (3 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 · Parts.parse (cognitive 23) · ×1
  • Parts.parse (cognitive 23) src/main/java/com/google/devtools/build/lib/cmdline/LabelParser.java:109 — Parts.parse has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 4 (9 pts), boolean chains 3 (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 · ModCommand.getReposToShow (cognitive 23) · ×1
  • ModCommand.getReposToShow (cognitive 23) src/main/java/com/google/devtools/build/lib/bazel/commands/ModCommand.java:656 — ModCommand.getReposToShow has cognitive complexity 23 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 5 (9 pts), error handling 1 (3 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 · ModuleExtensionMetadata.create (cognitive 23) · ×1
  • ModuleExtensionMetadata.create (cognitive 23) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleExtensionMetadata.java:88 — ModuleExtensionMetadata.create has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5, error handling 2 (4 pts), loops 2 (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 · StarlarkRuleClassFunctions.macro (cognitive 23) · ×1
  • StarlarkRuleClassFunctions.macro (cognitive 23) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleClassFunctions.java:407 — StarlarkRuleClassFunctions.macro has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, error handling 1 (2 pts), loops 2, ternaries 1 (2 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 · MutableArgs.addVectorArg (cognitive 23) · ×1
  • MutableArgs.addVectorArg (cognitive 23) src/main/java/com/google/devtools/build/lib/analysis/starlark/Args.java:438 — MutableArgs.addVectorArg has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 5, loops 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 · LocationExpander.buildLocationMap (cognitive 23) · ×1
  • LocationExpander.buildLocationMap (cognitive 23) src/main/java/com/google/devtools/build/lib/analysis/LocationExpander.java:420 — LocationExpander.buildLocationMap has cognitive complexity 23 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 7, boolean chains 2, ternaries 1 (2 pts) (nesting depth added 7). 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 · ActionConflictException.debugSuffix (cognitive 23) · ×1
  • ActionConflictException.debugSuffix (cognitive 23) src/main/java/com/google/devtools/build/lib/actions/ActionConflictException.java:254 — ActionConflictException.debugSuffix has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 10, boolean chains 7, if/else 4 (5 pts), error handling 1 (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 · RuleLinkExpander.expandRuleLinks (cognitive 23) · ×1
  • RuleLinkExpander.expandRuleLinks (cognitive 23) src/main/java/com/google/devtools/build/docgen/RuleLinkExpander.java:91 — RuleLinkExpander.expandRuleLinks has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (17 pts), ternaries 1 (3 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.
D2 · Cognitive Complexity · BuildDocCollector.collectJavaSourceDocs (cognitive 23) · ×1
  • BuildDocCollector.collectJavaSourceDocs (cognitive 23) src/main/java/com/google/devtools/build/docgen/BuildDocCollector.java:284 — BuildDocCollector.collectJavaSourceDocs has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 13). 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 · Eval.evalCall (cognitive 22) · ×1
  • Eval.evalCall (cognitive 22) src/main/java/net/starlark/java/eval/Eval.java:743 — Eval.evalCall has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 4 (6 pts), boolean chains 3, error handling 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 · ParallelEvaluator.constructResult (cognitive 22) · ×1
  • ParallelEvaluator.constructResult (cognitive 22) src/main/java/com/google/devtools/build/skyframe/ParallelEvaluator.java:509 — ParallelEvaluator.constructResult has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 5, ternaries 1 (2 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 · PathFragment.subFragmentImpl (cognitive 22) · ×1
  • PathFragment.subFragmentImpl (cognitive 22) src/main/java/com/google/devtools/build/lib/vfs/PathFragment.java:652 — PathFragment.subFragmentImpl has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, loops 2 (3 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 · FileWatcher.run (cognitive 22) · ×1
  • FileWatcher.run (cognitive 22) src/main/java/com/google/devtools/build/lib/util/io/FileWatcher.java:75 — FileWatcher.run has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (3 pts), boolean chains 2, error handling 2 (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 · SkyframeBuildView.reportActionConflictErrors (cognitive 22) · ×1
  • SkyframeBuildView.reportActionConflictErrors (cognitive 22) src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java:1046 — SkyframeBuildView.reportActionConflictErrors has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 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 · BlazeOptionHandler.parseRcOptions (cognitive 22) · ×1
  • BlazeOptionHandler.parseRcOptions (cognitive 22) src/main/java/com/google/devtools/build/lib/runtime/BlazeOptionHandler.java:217 — BlazeOptionHandler.parseRcOptions has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (11 pts), ternaries 2 (8 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 · JavaCompileActionContext.addDependencies (cognitive 22) · ×1
  • JavaCompileActionContext.addDependencies (cognitive 22) src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileActionContext.java:48 — JavaCompileActionContext.addDependencies has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (7 pts), error handling 2 (3 pts) (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 · HttpCacheClient.uploadAsync (cognitive 22) · ×1
  • HttpCacheClient.uploadAsync (cognitive 22) src/main/java/com/google/devtools/build/lib/remote/http/HttpCacheClient.java:694 — HttpCacheClient.uploadAsync has cognitive complexity 22 (threshold 15). Drivers by points: error handling 3 (11 pts), if/else 7 (10 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.
D2 · Cognitive Complexity · Type.inferBinaryOperator (cognitive 22) · ×1
  • Type.inferBinaryOperator (cognitive 22) src/main/java/com/google/devtools/build/lib/packages/SelectorValue.java:191 — Type.inferBinaryOperator has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 3 (7 pts), boolean chains 3, 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 · SpawnLogReconstructor.visitInputSet (cognitive 22) · ×1
  • SpawnLogReconstructor.visitInputSet (cognitive 22) src/main/java/com/google/devtools/build/lib/exec/SpawnLogReconstructor.java:200 — SpawnLogReconstructor.visitInputSet has cognitive complexity 22 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (7 pts), match/switch 2 (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 · EagerRequestBatcher.submit (cognitive 22) · ×1
  • EagerRequestBatcher.submit (cognitive 22) src/main/java/com/google/devtools/build/lib/concurrent/EagerRequestBatcher.java:166 — EagerRequestBatcher.submit has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 1, 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 · BuildTool.buildTargets (cognitive 22) · ×1
  • BuildTool.buildTargets (cognitive 22) src/main/java/com/google/devtools/build/lib/buildtool/BuildTool.java:222 — BuildTool.buildTargets has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 2, error handling 1, loops 1, ternaries 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.
D2 · Cognitive Complexity · ProxyHelper.createProxyInfo (cognitive 22) · ×1
  • ProxyHelper.createProxyInfo (cognitive 22) src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/ProxyHelper.java:233 — ProxyHelper.createProxyInfo has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 2, error handling 1 (2 pts), match/switch 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 · TextOutputFormatter.printModule (cognitive 22) · ×1
  • TextOutputFormatter.printModule (cognitive 22) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/modcommand/TextOutputFormatter.java:143 — TextOutputFormatter.printModule has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 3). 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 · ModExecutor.expandPathsToTargets (cognitive 22) · ×1
  • ModExecutor.expandPathsToTargets (cognitive 22) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/modcommand/ModExecutor.java:269 — ModExecutor.expandPathsToTargets has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 6, 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 · SingleExtensionFunction.compute (cognitive 22) · ×1
  • SingleExtensionFunction.compute (cognitive 22) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/SingleExtensionFunction.java:37 — SingleExtensionFunction.compute has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 5 (9 pts), boolean chains 3 (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 · Builder.addAttribute (cognitive 22) · ×1
  • Builder.addAttribute (cognitive 22) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttributesCollection.java:390 — Builder.addAttribute has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 1, ternaries 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 · RuleContextConstraintSemantics.getUnsupportedEnvironments (cognitive 22) · ×1
  • RuleContextConstraintSemantics.getUnsupportedEnvironments (cognitive 22) src/main/java/com/google/devtools/build/lib/analysis/constraints/RuleContextConstraintSemantics.java:673 — RuleContextConstraintSemantics.getUnsupportedEnvironments has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (5 pts), boolean chains 3 (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 · RegularTransition.evaluate (cognitive 22) · ×1
  • RegularTransition.evaluate (cognitive 22) src/main/java/com/google/devtools/build/lib/analysis/config/StarlarkDefinedConfigTransition.java:547 — RegularTransition.evaluate has cognitive complexity 22 (threshold 15). Drivers by points: error handling 6 (10 pts), if/else 6 (8 pts), loops 2 (4 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 · OptionsDiff.applyDiff (cognitive 22) · ×1
  • OptionsDiff.applyDiff (cognitive 22) src/main/java/com/google/devtools/build/lib/analysis/config/OptionsDiff.java:489 — OptionsDiff.applyDiff has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 10 (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.getRequiredConfigFragments (cognitive 22) · ×1
  • RuleContext.getRequiredConfigFragments (cognitive 22) src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java:1137 — RuleContext.getRequiredConfigFragments has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 3 (5 pts), ternaries 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 · ConfiguredTargetFactory.createConfiguredTarget (cognitive 22) · ×1
  • ConfiguredTargetFactory.createConfiguredTarget (cognitive 22) src/main/java/com/google/devtools/build/lib/analysis/ConfiguredTargetFactory.java:221 — ConfiguredTargetFactory.createConfiguredTarget has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 3, error handling 1, ternaries 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 · ActionExecutedEvent.asStreamProto (cognitive 22) · ×1
  • ActionExecutedEvent.asStreamProto (cognitive 22) src/main/java/com/google/devtools/build/lib/actions/ActionExecutedEvent.java:175 — ActionExecutedEvent.asStreamProto has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 1, error handling 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 · ActionCacheChecker.isUpToDate (cognitive 22) · ×1
  • ActionCacheChecker.isUpToDate (cognitive 22) src/main/java/com/google/devtools/build/lib/actions/ActionCacheChecker.java:199 — ActionCacheChecker.isUpToDate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 2, 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 · SingleOptionValueDescription.addOptionInstance (cognitive 21) · ×1
  • SingleOptionValueDescription.addOptionInstance (cognitive 21) src/main/java/com/google/devtools/common/options/OptionValueDescription.java:208 — SingleOptionValueDescription.addOptionInstance has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 6 (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 · TargetPatternValue.computeTargetPatternKeyWithExclusions (cognitive 21) · ×1
  • TargetPatternValue.computeTargetPatternKeyWithExclusions (cognitive 21) src/main/java/com/google/devtools/build/lib/skyframe/TargetPatternValue.java:133 — TargetPatternValue.computeTargetPatternKeyWithExclusions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 1 (5 pts), boolean chains 1, 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 · SequencedSkyframeExecutor.sync (cognitive 21) · ×1
  • SequencedSkyframeExecutor.sync (cognitive 21) src/main/java/com/google/devtools/build/lib/skyframe/SequencedSkyframeExecutor.java:264 — SequencedSkyframeExecutor.sync has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 1 (2 pts), boolean chains 1, ternaries 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 · IncrementalPackageRoots.plantSingleSymlinkForPackage (cognitive 21) · ×1
  • IncrementalPackageRoots.plantSingleSymlinkForPackage (cognitive 21) src/main/java/com/google/devtools/build/lib/skyframe/IncrementalPackageRoots.java:329 — IncrementalPackageRoots.plantSingleSymlinkForPackage has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (15 pts), error handling 2 (4 pts), boolean chains 2 (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 · FileSystemValueCheckerInferringAncestors.visitEntry (cognitive 21) · ×1
  • FileSystemValueCheckerInferringAncestors.visitEntry (cognitive 21) src/main/java/com/google/devtools/build/lib/skyframe/FileSystemValueCheckerInferringAncestors.java:287 — FileSystemValueCheckerInferringAncestors.visitEntry has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (12 pts), error handling 3 (5 pts), boolean chains 3, ternaries 1 (nesting depth added 5). 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.
D2 · Cognitive Complexity · AspectFunction.createAspect (cognitive 21) · ×1
  • AspectFunction.createAspect (cognitive 21) src/main/java/com/google/devtools/build/lib/skyframe/AspectFunction.java:968 — AspectFunction.createAspect has cognitive complexity 21 (threshold 15). Drivers by points: error handling 5 (10 pts), if/else 7 (8 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 7). 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 · SandboxModule.setup (cognitive 21) · ×1
  • SandboxModule.setup (cognitive 21) src/main/java/com/google/devtools/build/lib/sandbox/SandboxModule.java:198 — SandboxModule.setup has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 4 (nesting depth added 3). 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.
D2 · Cognitive Complexity · SandboxHelpers.cleanRecursivelyWithInMemoryContents (cognitive 21) · ×1
  • SandboxHelpers.cleanRecursivelyWithInMemoryContents (cognitive 21) src/main/java/com/google/devtools/build/lib/sandbox/SandboxHelpers.java:335 — SandboxHelpers.cleanRecursivelyWithInMemoryContents has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, loops 2, ternaries 1 (2 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 · WorkerMetricsInfoItem.get (cognitive 21) · ×1
  • WorkerMetricsInfoItem.get (cognitive 21) src/main/java/com/google/devtools/build/lib/runtime/commands/info/WorkerMetricsInfoItem.java:37 — WorkerMetricsInfoItem.get has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 1 (2 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 · DumpCommand.exec (cognitive 21) · ×1
  • DumpCommand.exec (cognitive 21) src/main/java/com/google/devtools/build/lib/runtime/commands/DumpCommand.java:399 — DumpCommand.exec has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (11 pts), error handling 3 (5 pts), boolean chains 4, match/switch 1 (nesting depth added 3). 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 · TerminalTestResultNotifier.printStats (cognitive 21) · ×1
  • TerminalTestResultNotifier.printStats (cognitive 21) src/main/java/com/google/devtools/build/lib/runtime/TerminalTestResultNotifier.java:273 — TerminalTestResultNotifier.printStats has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 6 (8 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 · HttpCacheClient.get (cognitive 21) · ×1
  • HttpCacheClient.get (cognitive 21) src/main/java/com/google/devtools/build/lib/remote/http/HttpCacheClient.java:522 — HttpCacheClient.get has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (12 pts), error handling 2 (8 pts), boolean chains 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 · RemoteActionFileSystem.getDirectoryContents (cognitive 21) · ×1
  • RemoteActionFileSystem.getDirectoryContents (cognitive 21) src/main/java/com/google/devtools/build/lib/remote/RemoteActionFileSystem.java:836 — RemoteActionFileSystem.getDirectoryContents has cognitive complexity 21 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 5 (7 pts), error handling 2 (5 pts) (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 · ActionGraphTextOutputFormatterCallback.processOutput (cognitive 21) · ×1
  • ActionGraphTextOutputFormatterCallback.processOutput (cognitive 21) src/main/java/com/google/devtools/build/lib/query2/aquery/ActionGraphTextOutputFormatterCallback.java:106 — ActionGraphTextOutputFormatterCallback.processOutput has cognitive complexity 21 (threshold 15). Drivers by points: loops 4 (11 pts), if/else 3 (8 pts), boolean chains 1, error handling 1 (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 · SpawnLogReconstructor.visitSymlinkEntries (cognitive 21) · ×1
  • SpawnLogReconstructor.visitSymlinkEntries (cognitive 21) src/main/java/com/google/devtools/build/lib/exec/SpawnLogReconstructor.java:247 — SpawnLogReconstructor.visitSymlinkEntries has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (7 pts), match/switch 1 (2 pts), ternaries 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 · DynamicSpawnStrategy.maybeExecuteNonDynamically (cognitive 21) · ×1
  • DynamicSpawnStrategy.maybeExecuteNonDynamically (cognitive 21) src/main/java/com/google/devtools/build/lib/dynamic/DynamicSpawnStrategy.java:355 — DynamicSpawnStrategy.maybeExecuteNonDynamically has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 5 (6 pts), boolean chains 5 (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 · ModCommand.validateArgs (cognitive 21) · ×1
  • ModCommand.validateArgs (cognitive 21) src/main/java/com/google/devtools/build/lib/bazel/commands/ModCommand.java:142 — ModCommand.validateArgs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 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 · JsonOutputFormatter.printModule (cognitive 21) · ×1
  • JsonOutputFormatter.printModule (cognitive 21) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/modcommand/JsonOutputFormatter.java:92 — JsonOutputFormatter.printModule has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 2, 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 · IndexRegistry.doGrabFile (cognitive 21) · ×1
  • IndexRegistry.doGrabFile (cognitive 21) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/IndexRegistry.java:167 — IndexRegistry.doGrabFile has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), error handling 3 (4 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 · TestStrategy.processTestOutput (cognitive 21) · ×1
  • TestStrategy.processTestOutput (cognitive 21) src/main/java/com/google/devtools/build/lib/analysis/test/TestStrategy.java:375 — TestStrategy.processTestOutput has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 3 (9 pts), boolean chains 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 · TemplateExpander.expand (cognitive 21) · ×1
  • TemplateExpander.expand (cognitive 21) src/main/java/com/google/devtools/build/lib/analysis/stringtemplate/TemplateExpander.java:73 — TemplateExpander.expand has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 1 (nesting depth added 12). 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 · StarlarkCustomCommandLine.applyMapEach (cognitive 21) · ×1
  • StarlarkCustomCommandLine.applyMapEach (cognitive 21) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkCustomCommandLine.java:1293 — StarlarkCustomCommandLine.applyMapEach has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (4 pts), boolean chains 2, error handling 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 · Util.findImplicitDeps (cognitive 21) · ×1
  • Util.findImplicitDeps (cognitive 21) src/main/java/com/google/devtools/build/lib/analysis/Util.java:82 — Util.findImplicitDeps has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (7 pts), boolean chains 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 · _CLRParser._parse_dt (cognitive 21) · ×1
  • _CLRParser._parse_dt (cognitive 21) scripts/docs/clr_converter.py:388 — _CLRParser._parse_dt has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 3 (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.parseSmallStatement (cognitive 20) · ×1
  • Parser.parseSmallStatement (cognitive 20) src/main/java/net/starlark/java/syntax/Parser.java:1562 — Parser.parseSmallStatement has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 3 (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 · Eval.newFunction (cognitive 20) · ×1
  • Eval.newFunction (cognitive 20) src/main/java/net/starlark/java/eval/Eval.java:228 — Eval.newFunction has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 3 (4 pts), boolean chains 2, loops 2, match/switch 1 (2 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 · StarlarkAnnotations.getAnnotationOnClassMatchingSignature (cognitive 20) · ×1
  • StarlarkAnnotations.getAnnotationOnClassMatchingSignature (cognitive 20) src/main/java/net/starlark/java/annot/StarlarkAnnotations.java:222 — StarlarkAnnotations.getAnnotationOnClassMatchingSignature has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (5 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 · OptionsUsage.getUsage (cognitive 20) · ×1
  • OptionsUsage.getUsage (cognitive 20) src/main/java/com/google/devtools/common/options/OptionsUsage.java:51 — OptionsUsage.getUsage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (16 pts), loops 2 (4 pts) (nesting depth added 5). 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 · AbstractInMemoryMemoizingEvaluator.pruneInjectedValues (cognitive 20) · ×1
  • AbstractInMemoryMemoizingEvaluator.pruneInjectedValues (cognitive 20) src/main/java/com/google/devtools/build/skyframe/AbstractInMemoryMemoizingEvaluator.java:463 — AbstractInMemoryMemoizingEvaluator.pruneInjectedValues has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · UnixGlob.removeExcludes (cognitive 20) · ×1
  • UnixGlob.removeExcludes (cognitive 20) src/main/java/com/google/devtools/build/lib/vfs/UnixGlob.java:894 — UnixGlob.removeExcludes has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 4 (5 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 · AnsiStrippingOutputStream.processByte (cognitive 20) · ×1
  • AnsiStrippingOutputStream.processByte (cognitive 20) src/main/java/com/google/devtools/build/lib/util/AnsiStrippingOutputStream.java:90 — AnsiStrippingOutputStream.processByte has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 5, match/switch 1 (nesting depth added 4). 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 · ToolchainContextUtil.getPerExecGroupExecutionPlatformConstraints (cognitive 20) · ×1
  • ToolchainContextUtil.getPerExecGroupExecutionPlatformConstraints (cognitive 20) src/main/java/com/google/devtools/build/lib/skyframe/toolchains/ToolchainContextUtil.java:169 — ToolchainContextUtil.getPerExecGroupExecutionPlatformConstraints has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), error handling 1 (3 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 · TargetPatternPhaseFunction.determineTests (cognitive 20) · ×1
  • TargetPatternPhaseFunction.determineTests (cognitive 20) src/main/java/com/google/devtools/build/lib/skyframe/TargetPatternPhaseFunction.java:412 — TargetPatternPhaseFunction.determineTests has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 3 (6 pts), loops 3 (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 · TargetPatternPhaseFunction.getTargetsToBuild (cognitive 20) · ×1
  • TargetPatternPhaseFunction.getTargetsToBuild (cognitive 20) src/main/java/com/google/devtools/build/lib/skyframe/TargetPatternPhaseFunction.java:285 — TargetPatternPhaseFunction.getTargetsToBuild has cognitive complexity 20 (threshold 15). Drivers by points: error handling 3 (7 pts), if/else 3 (7 pts), ternaries 2 (4 pts), loops 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 · SkyframeExecutor.handleDiffs (cognitive 20) · ×1
  • SkyframeExecutor.handleDiffs (cognitive 20) src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java:3854 — SkyframeExecutor.handleDiffs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4, loops 1 (2 pts), ternaries 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 · IncrementalArtifactConflictFinder.checkOutputPrefix (cognitive 20) · ×1
  • IncrementalArtifactConflictFinder.checkOutputPrefix (cognitive 20) src/main/java/com/google/devtools/build/lib/skyframe/IncrementalArtifactConflictFinder.java:378 — IncrementalArtifactConflictFinder.checkOutputPrefix has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 4, ternaries 1 (2 pts), 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 · GlobsFunction.compute (cognitive 20) · ×1
  • GlobsFunction.compute (cognitive 20) src/main/java/com/google/devtools/build/lib/skyframe/GlobsFunction.java:108 — GlobsFunction.compute has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 4 (6 pts), error handling 1 (nesting depth added 5). 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.
D2 · Cognitive Complexity · DependencyResolver.computeDependencies (cognitive 20) · ×1
  • DependencyResolver.computeDependencies (cognitive 20) src/main/java/com/google/devtools/build/lib/skyframe/DependencyResolver.java:672 — DependencyResolver.computeDependencies has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), error handling 2 (3 pts), match/switch 1 (2 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 · ActionExecutionFunction.checkInputs (cognitive 20) · ×1
  • ActionExecutionFunction.checkInputs (cognitive 20) src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java:1017 — ActionExecutionFunction.checkInputs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4 (8 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 · ServerWatcherRunnable.run (cognitive 20) · ×1
  • ServerWatcherRunnable.run (cognitive 20) src/main/java/com/google/devtools/build/lib/server/ServerWatcherRunnable.java:164 — ServerWatcherRunnable.run has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, loops 3 (4 pts), error handling 1 (2 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 · SandboxModule.afterCommand (cognitive 20) · ×1
  • SandboxModule.afterCommand (cognitive 20) src/main/java/com/google/devtools/build/lib/sandbox/SandboxModule.java:512 — SandboxModule.afterCommand has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 2 (4 pts), loops 1 (2 pts), boolean chains 1, ternaries 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 · TestCommand.doTest (cognitive 20) · ×1
  • TestCommand.doTest (cognitive 20) src/main/java/com/google/devtools/build/lib/runtime/commands/TestCommand.java:128 — TestCommand.doTest has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 2 (4 pts), boolean chains 3, error handling 3 (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 · RunCommand.exec (cognitive 20) · ×1
  • RunCommand.exec (cognitive 20) src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java:249 — RunCommand.exec has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (8 pts), error handling 5 (7 pts), ternaries 4, boolean chains 1 (nesting depth added 3). 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 · GetInitPyFiles.getInitPyFiles (cognitive 20) · ×1
  • GetInitPyFiles.getInitPyFiles (cognitive 20) src/main/java/com/google/devtools/build/lib/rules/python/PythonUtils.java:72 — GetInitPyFiles.getInitPyFiles has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 3 (5 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 · JavaHeaderCompileAction.filterJavacoptsForTurbine (cognitive 20) · ×1
  • JavaHeaderCompileAction.filterJavacoptsForTurbine (cognitive 20) src/main/java/com/google/devtools/build/lib/rules/java/JavaHeaderCompileAction.java:749 — JavaHeaderCompileAction.filterJavacoptsForTurbine 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 · CcToolchainVariables.lookupVariable (cognitive 20) · ×1
  • CcToolchainVariables.lookupVariable (cognitive 20) src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainVariables.java:341 — CcToolchainVariables.lookupVariable has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 2 (4 pts), error handling 1 (2 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 · Retrier.execute (cognitive 20) · ×1
  • Retrier.execute (cognitive 20) src/main/java/com/google/devtools/build/lib/remote/Retrier.java:319 — Retrier.execute has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), error handling 2 (4 pts), boolean chains 1, 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 · IncludeParser.skipWhitespace (cognitive 20) · ×1
  • IncludeParser.skipWhitespace (cognitive 20) src/main/java/com/google/devtools/build/lib/includescanning/IncludeParser.java:580 — IncludeParser.skipWhitespace has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (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 · BuildObjectTraverser.admit (cognitive 20) · ×1
  • BuildObjectTraverser.admit (cognitive 20) src/main/java/com/google/devtools/build/lib/buildtool/BuildObjectTraverser.java:93 — BuildObjectTraverser.admit has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (20 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 · BugReport.handleCrash (cognitive 20) · ×1
  • BugReport.handleCrash (cognitive 20) src/main/java/com/google/devtools/build/lib/bugreport/BugReport.java:270 — BugReport.handleCrash has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 1, error handling 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 · PatchUtil.applyPatchToFile (cognitive 20) · ×1
  • PatchUtil.applyPatchToFile (cognitive 20) src/main/java/com/google/devtools/build/lib/bazel/repository/decompressor/PatchUtil.java:200 — PatchUtil.applyPatchToFile has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5, error handling 1 (2 pts), loops 1 (nesting depth added 3). 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 · BazelFetchAllFunction.compute (cognitive 20) · ×1
  • BazelFetchAllFunction.compute (cognitive 20) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/BazelFetchAllFunction.java:43 — BazelFetchAllFunction.compute has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (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 · DependencyProducer.evaluateMaterializerTargets (cognitive 20) · ×1
  • DependencyProducer.evaluateMaterializerTargets (cognitive 20) src/main/java/com/google/devtools/build/lib/analysis/producers/DependencyProducer.java:422 — DependencyProducer.evaluateMaterializerTargets has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3 (6 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 · DependencyMapProducer.evaluateAspectHintsTargets (cognitive 20) · ×1
  • DependencyMapProducer.evaluateAspectHintsTargets (cognitive 20) src/main/java/com/google/devtools/build/lib/analysis/producers/DependencyMapProducer.java:518 — DependencyMapProducer.evaluateAspectHintsTargets has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (6 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 · ResolvedToolchainContext.load (cognitive 20) · ×1
  • ResolvedToolchainContext.load (cognitive 20) src/main/java/com/google/devtools/build/lib/analysis/ResolvedToolchainContext.java:48 — ResolvedToolchainContext.load has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 3 (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 · Actions.assignOwnersAndThrowIfConflictMaybeToleratingSharedActions (cognitive 20) · ×1
  • Actions.assignOwnersAndThrowIfConflictMaybeToleratingSharedActions (cognitive 20) src/main/java/com/google/devtools/build/lib/actions/Actions.java:238 — Actions.assignOwnersAndThrowIfConflictMaybeToleratingSharedActions has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (3 pts), ternaries 1 (2 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.
D2 · Cognitive Complexity · ActionCacheChecker.getCachedInputs (cognitive 20) · ×1
  • ActionCacheChecker.getCachedInputs (cognitive 20) src/main/java/com/google/devtools/build/lib/actions/ActionCacheChecker.java:760 — ActionCacheChecker.getCachedInputs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 5 (6 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 · 1.readLineImpl (cognitive 20) · ×1
  • 1.readLineImpl (cognitive 20) src/main/java/com/google/devtools/build/docgen/SourceFileReader.java:109 — 1.readLineImpl has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16 (20 pts) (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 · TypeTagger.createFunctionType (cognitive 19) · ×1
  • TypeTagger.createFunctionType (cognitive 19) src/main/java/net/starlark/java/syntax/TypeTagger.java:333 — TypeTagger.createFunctionType has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 3 (6 pts), boolean chains 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 · Lexer.computeIndentation (cognitive 19) · ×1
  • Lexer.computeIndentation (cognitive 19) src/main/java/net/starlark/java/syntax/Lexer.java:201 — Lexer.computeIndentation has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 2 (3 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.
D2 · Cognitive Complexity · ArgumentProcessor.applyDefaultsReportMissingArgs (cognitive 19) · ×1
  • ArgumentProcessor.applyDefaultsReportMissingArgs (cognitive 19) src/main/java/net/starlark/java/eval/StarlarkFunction.java:479 — ArgumentProcessor.applyDefaultsReportMissingArgs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (18 pts), 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 · MethodDescriptor.call (cognitive 19) · ×1
  • MethodDescriptor.call (cognitive 19) src/main/java/net/starlark/java/eval/MethodDescriptor.java:400 — MethodDescriptor.call has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 3, loops 1 (2 pts), ternaries 1 (2 pts), boolean chains 1, 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 · HtmlUtils.getUsageHtml (cognitive 19) · ×1
  • HtmlUtils.getUsageHtml (cognitive 19) src/main/java/com/google/devtools/common/options/HtmlUtils.java:78 — HtmlUtils.getUsageHtml has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (17 pts), loops 1 (2 pts) (nesting depth added 3). 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 · SkyFunctionEnvironment.commitAndGetParents (cognitive 19) · ×1
  • SkyFunctionEnvironment.commitAndGetParents (cognitive 19) src/main/java/com/google/devtools/build/skyframe/SkyFunctionEnvironment.java:945 — SkyFunctionEnvironment.commitAndGetParents has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, ternaries 3 (4 pts), loops 1 (2 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 · ReverseDepsUtility.consolidateDataAndReturnNewElements (cognitive 19) · ×1
  • ReverseDepsUtility.consolidateDataAndReturnNewElements (cognitive 19) src/main/java/com/google/devtools/build/skyframe/ReverseDepsUtility.java:194 — ReverseDepsUtility.consolidateDataAndReturnNewElements has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 1 (2 pts), ternaries 1 (2 pts), boolean chains 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 · WorkerParser.splitSpawnArgsIntoWorkerArgsAndFlagFiles (cognitive 19) · ×1
  • WorkerParser.splitSpawnArgsIntoWorkerArgsAndFlagFiles (cognitive 19) src/main/java/com/google/devtools/build/lib/worker/WorkerParser.java:212 — WorkerParser.splitSpawnArgsIntoWorkerArgsAndFlagFiles has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 2 (4 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 · WorkerLifecycleManager.evictWorkers (cognitive 19) · ×1
  • WorkerLifecycleManager.evictWorkers (cognitive 19) src/main/java/com/google/devtools/build/lib/worker/WorkerLifecycleManager.java:152 — WorkerLifecycleManager.evictWorkers has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 4 (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 · ObjectGraphTraverser.enqueueMaybe (cognitive 19) · ×1
  • ObjectGraphTraverser.enqueueMaybe (cognitive 19) src/main/java/com/google/devtools/build/lib/util/ObjectGraphTraverser.java:329 — ObjectGraphTraverser.enqueueMaybe has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 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 · AutoCodecProcessor.determineInstantiator (cognitive 19) · ×1
  • AutoCodecProcessor.determineInstantiator (cognitive 19) src/main/java/com/google/devtools/build/lib/skyframe/serialization/autocodec/AutoCodecProcessor.java:159 — AutoCodecProcessor.determineInstantiator has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (17 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 · FlagSetFunction.getSclConfig (cognitive 19) · ×1
  • FlagSetFunction.getSclConfig (cognitive 19) src/main/java/com/google/devtools/build/lib/skyframe/config/FlagSetFunction.java:120 — FlagSetFunction.getSclConfig has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 3 (5 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.
D2 · Cognitive Complexity · SkyframeProgressReceiver.evaluated (cognitive 19) · ×1
  • SkyframeProgressReceiver.evaluated (cognitive 19) src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java:3622 — SkyframeProgressReceiver.evaluated has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 3, loops 1 (2 pts) (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.
D2 · Cognitive Complexity · SequencedSkyframeExecutor.shouldDeleteOnAnalysisInvalidatingChange (cognitive 19) · ×1
  • SequencedSkyframeExecutor.shouldDeleteOnAnalysisInvalidatingChange (cognitive 19) src/main/java/com/google/devtools/build/lib/skyframe/SequencedSkyframeExecutor.java:737 — SequencedSkyframeExecutor.shouldDeleteOnAnalysisInvalidatingChange has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 3 (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 · PackageFunction.handleLabelsCrossingSubpackagesAndPropagateInconsistentFilesystemExceptions (cognitive 19) · ×1
  • PackageFunction.handleLabelsCrossingSubpackagesAndPropagateInconsistentFilesystemExceptions (cognitive 19) src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java:871 — PackageFunction.handleLabelsCrossingSubpackagesAndPropagateInconsistentFilesystemExceptions has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (7 pts), error handling 2 (6 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 · ConfiguredTargetFunction.createConfiguredTarget (cognitive 19) · ×1
  • ConfiguredTargetFunction.createConfiguredTarget (cognitive 19) src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetFunction.java:427 — ConfiguredTargetFunction.createConfiguredTarget has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 3, ternaries 1 (2 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 · ArtifactNestedSetFunction.compute (cognitive 19) · ×1
  • ArtifactNestedSetFunction.compute (cognitive 19) src/main/java/com/google/devtools/build/lib/skyframe/ArtifactNestedSetFunction.java:57 — ArtifactNestedSetFunction.compute has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 3 (6 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 · ArtifactFunction.createTreeArtifactValueFromActionKey (cognitive 19) · ×1
  • ArtifactFunction.createTreeArtifactValueFromActionKey (cognitive 19) src/main/java/com/google/devtools/build/lib/skyframe/ArtifactFunction.java:230 — ArtifactFunction.createTreeArtifactValueFromActionKey has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 4 (9 pts) (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 · HtmlEmitter.emit (cognitive 19) · ×1
  • HtmlEmitter.emit (cognitive 19) src/main/java/com/google/devtools/build/lib/runtime/commands/HelpCommand.java:474 — HtmlEmitter.emit has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 6 (8 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 · SynchronizedOutputStream.write (cognitive 19) · ×1
  • SynchronizedOutputStream.write (cognitive 19) src/main/java/com/google/devtools/build/lib/runtime/SynchronizedOutputStream.java:91 — SynchronizedOutputStream.write has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3, 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 · CppCompileActionTemplate.generateActionsForInputArtifacts (cognitive 19) · ×1
  • CppCompileActionTemplate.generateActionsForInputArtifacts (cognitive 19) src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionTemplate.java:119 — CppCompileActionTemplate.generateActionsForInputArtifacts has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, error handling 1 (2 pts), 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 · CppCompileAction.discoverInputs (cognitive 19) · ×1
  • CppCompileAction.discoverInputs (cognitive 19) src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java:671 — CppCompileAction.discoverInputs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, error handling 1 (2 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 · CcToolchainFeatures.<init> (cognitive 19) · ×1
  • CcToolchainFeatures.<init> (cognitive 19) src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainFeatures.java:1098 — CcToolchainFeatures.<init> has cognitive complexity 19 (threshold 15). Drivers by points: loops 9 (15 pts), if/else 2 (4 pts) (nesting depth added 8). 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 · CcCompilationContext.computeUsedModules (cognitive 19) · ×1
  • CcCompilationContext.computeUsedModules (cognitive 19) src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationContext.java:362 — CcCompilationContext.computeUsedModules has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 4 (7 pts), ternaries 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 · DirectoryBuilder.visit (cognitive 19) · ×1
  • DirectoryBuilder.visit (cognitive 19) src/main/java/com/google/devtools/build/lib/remote/UploadManifest.java:479 — DirectoryBuilder.visit has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 2 (3 pts), boolean chains 2, loops 1 (2 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 · BazelOutputService.getBatchStatter (cognitive 19) · ×1
  • BazelOutputService.getBatchStatter (cognitive 19) src/main/java/com/google/devtools/build/lib/remote/BazelOutputService.java:654 — BazelOutputService.getBatchStatter has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 2, 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.
D2 · Cognitive Complexity · MinrankOutputFormatter.output (cognitive 19) · ×1
  • MinrankOutputFormatter.output (cognitive 19) src/main/java/com/google/devtools/build/lib/query2/query/output/MinrankOutputFormatter.java:69 — MinrankOutputFormatter.output has cognitive complexity 19 (threshold 15). Drivers by points: loops 6 (13 pts), if/else 2 (5 pts), ternaries 1 (nesting depth added 10). 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 · MacroClass.executeMacroImplementation (cognitive 19) · ×1
  • MacroClass.executeMacroImplementation (cognitive 19) src/main/java/com/google/devtools/build/lib/packages/MacroClass.java:401 — MacroClass.executeMacroImplementation has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, error handling 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 · AspectsList.validateRulePropagatedAspectsParameters (cognitive 19) · ×1
  • AspectsList.validateRulePropagatedAspectsParameters (cognitive 19) src/main/java/com/google/devtools/build/lib/packages/AspectsList.java:87 — AspectsList.validateRulePropagatedAspectsParameters has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 2 (3 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 · AggregatingAttributeMapper.getAllValues (cognitive 19) · ×1
  • AggregatingAttributeMapper.getAllValues (cognitive 19) src/main/java/com/google/devtools/build/lib/packages/AggregatingAttributeMapper.java:616 — AggregatingAttributeMapper.getAllValues has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 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 · CriticalPathComputer.finalizeActionStat (cognitive 19) · ×1
  • CriticalPathComputer.finalizeActionStat (cognitive 19) src/main/java/com/google/devtools/build/lib/metrics/criticalpath/CriticalPathComputer.java:357 — CriticalPathComputer.finalizeActionStat has cognitive complexity 19 (threshold 15). Drivers by points: loops 3 (7 pts), if/else 3 (5 pts), ternaries 1 (5 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 · TestXmlOutputParser.parseXmlToTree (cognitive 19) · ×1
  • TestXmlOutputParser.parseXmlToTree (cognitive 19) src/main/java/com/google/devtools/build/lib/exec/TestXmlOutputParser.java:51 — TestXmlOutputParser.parseXmlToTree has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 5 (6 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 · StableSort.stableSort (cognitive 19) · ×1
  • StableSort.stableSort (cognitive 19) src/main/java/com/google/devtools/build/lib/exec/StableSort.java:55 — StableSort.stableSort has cognitive complexity 19 (threshold 15). Drivers by points: loops 8 (13 pts), if/else 3 (6 pts) (nesting depth added 8). 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 · SpawnInputExpander.addSingleRunfilesTreeToInputs (cognitive 19) · ×1
  • SpawnInputExpander.addSingleRunfilesTreeToInputs (cognitive 19) src/main/java/com/google/devtools/build/lib/exec/SpawnInputExpander.java:82 — SpawnInputExpander.addSingleRunfilesTreeToInputs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (5 pts), ternaries 1 (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 · CompactSpawnLogContext.logSpawn (cognitive 19) · ×1
  • CompactSpawnLogContext.logSpawn (cognitive 19) src/main/java/com/google/devtools/build/lib/exec/CompactSpawnLogContext.java:231 — CompactSpawnLogContext.logSpawn has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3, error handling 1 (2 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 · LabelValidator.validatePackageName (cognitive 19) · ×1
  • LabelValidator.validatePackageName (cognitive 19) src/main/java/com/google/devtools/build/lib/cmdline/LabelValidator.java:96 — LabelValidator.validatePackageName has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 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 · RepositoryFetchFunction.tryGettingValueUsingVendoredRepo (cognitive 19) · ×1
  • RepositoryFetchFunction.tryGettingValueUsingVendoredRepo (cognitive 19) src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryFetchFunction.java:425 — RepositoryFetchFunction.tryGettingValueUsingVendoredRepo has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 2 (4 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 · VendorManager.vendorRepos (cognitive 19) · ×1
  • VendorManager.vendorRepos (cognitive 19) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/VendorManager.java:61 — VendorManager.vendorRepos has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 1 (3 pts), boolean chains 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 · ModuleFileFunction.compute (cognitive 19) · ×1
  • ModuleFileFunction.compute (cognitive 19) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleFileFunction.java:167 — ModuleFileFunction.compute has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (15 pts), error handling 2 (3 pts), boolean chains 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 · LazySubstitution.getValue (cognitive 19) · ×1
  • LazySubstitution.getValue (cognitive 19) src/main/java/com/google/devtools/build/lib/analysis/starlark/TemplateDict.java:121 — LazySubstitution.getValue has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (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 · StarlarkRuleContext.buildSplitAttributeInfo (cognitive 19) · ×1
  • StarlarkRuleContext.buildSplitAttributeInfo (cognitive 19) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleContext.java:526 — StarlarkRuleContext.buildSplitAttributeInfo has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (3 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 · StarlarkRuleContext.runfiles (cognitive 19) · ×1
  • StarlarkRuleContext.runfiles (cognitive 19) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleContext.java:1101 — StarlarkRuleContext.runfiles has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (12 pts), loops 2 (4 pts), error handling 1 (2 pts), 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 · StarlarkRuleConfiguredTargetUtil.addSimpleProviders (cognitive 19) · ×1
  • StarlarkRuleConfiguredTargetUtil.addSimpleProviders (cognitive 19) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleConfiguredTargetUtil.java:434 — StarlarkRuleConfiguredTargetUtil.addSimpleProviders has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 2 (4 pts), boolean chains 3 (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 · StarlarkCustomCommandLineWithIndexes.expand (cognitive 19) · ×1
  • StarlarkCustomCommandLineWithIndexes.expand (cognitive 19) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkCustomCommandLine.java:1156 — StarlarkCustomCommandLineWithIndexes.expand has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), match/switch 1 (4 pts), loops 2 (3 pts), ternaries 1 (2 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 · ActionOutputDirectoryHelper.createAndCheckForSymlinks (cognitive 19) · ×1
  • ActionOutputDirectoryHelper.createAndCheckForSymlinks (cognitive 19) src/main/java/com/google/devtools/build/lib/actions/ActionOutputDirectoryHelper.java:261 — ActionOutputDirectoryHelper.createAndCheckForSymlinks has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 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 · ActionCacheChecker.updateActionCache (cognitive 19) · ×1
  • ActionCacheChecker.updateActionCache (cognitive 19) src/main/java/com/google/devtools/build/lib/actions/ActionCacheChecker.java:678 — ActionCacheChecker.updateActionCache has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (3 pts), boolean chains 2, ternaries 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 · TypeChecker.assignSequence (cognitive 18) · ×1
  • TypeChecker.assignSequence (cognitive 18) src/main/java/net/starlark/java/syntax/TypeChecker.java:1172 — TypeChecker.assignSequence has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 4 (6 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 · TypeChecker.visit (cognitive 18) · ×1
  • TypeChecker.visit (cognitive 18) src/main/java/net/starlark/java/syntax/TypeChecker.java:1301 — TypeChecker.visit has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (5 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 · Resolver.lookupLexical (cognitive 18) · ×1
  • Resolver.lookupLexical (cognitive 18) src/main/java/net/starlark/java/syntax/Resolver.java:1065 — Resolver.lookupLexical has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 2 (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 · Eval.inplaceBinaryOp (cognitive 18) · ×1
  • Eval.inplaceBinaryOp (cognitive 18) src/main/java/net/starlark/java/eval/Eval.java:558 — Eval.inplaceBinaryOp has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 6, match/switch 1 (nesting depth added 5). 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 · BuiltinFunction.getPositionalOnlyArgumentVector (cognitive 18) · ×1
  • BuiltinFunction.getPositionalOnlyArgumentVector (cognitive 18) src/main/java/net/starlark/java/eval/BuiltinFunction.java:105 — BuiltinFunction.getPositionalOnlyArgumentVector has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 1, loops 1 (nesting depth added 3). 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 · StarlarkMethodProcessor.checkSpecialParams (cognitive 18) · ×1
  • StarlarkMethodProcessor.checkSpecialParams (cognitive 18) src/main/java/net/starlark/java/annot/processor/StarlarkMethodProcessor.java:493 — StarlarkMethodProcessor.checkSpecialParams has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 2 (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 · WorkerMultiplexer.createProcess (cognitive 18) · ×1
  • WorkerMultiplexer.createProcess (cognitive 18) src/main/java/com/google/devtools/build/lib/worker/WorkerMultiplexer.java:213 — WorkerMultiplexer.createProcess has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 3, match/switch 1 (3 pts), loops 2, ternaries 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 · JsonWorkerProtocol.parseResponse (cognitive 18) · ×1
  • JsonWorkerProtocol.parseResponse (cognitive 18) src/main/java/com/google/devtools/build/lib/worker/JsonWorkerProtocol.java:74 — JsonWorkerProtocol.parseResponse has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 2, match/switch 1 (2 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 · JsonWorkerMessageProcessor.readInputs (cognitive 18) · ×1
  • JsonWorkerMessageProcessor.readInputs (cognitive 18) src/main/java/com/google/devtools/build/lib/worker/JsonWorkerMessageProcessor.java:58 — JsonWorkerMessageProcessor.readInputs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (3 pts), match/switch 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 · GlobalsVisitor.maybeVisit (cognitive 18) · ×1
  • GlobalsVisitor.maybeVisit (cognitive 18) src/main/java/com/google/devtools/build/lib/starlarkdocextract/ModuleInfoExtractor.java:224 — GlobalsVisitor.maybeVisit has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 2 (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 · ActionRewindStrategy.checkActions (cognitive 18) · ×1
  • ActionRewindStrategy.checkActions (cognitive 18) src/main/java/com/google/devtools/build/lib/skyframe/rewinding/ActionRewindStrategy.java:825 — ActionRewindStrategy.checkActions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (5 pts), boolean chains 1, ternaries 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 · FlagSetFunction.validateStarlarkFlags (cognitive 18) · ×1
  • FlagSetFunction.validateStarlarkFlags (cognitive 18) src/main/java/com/google/devtools/build/lib/skyframe/config/FlagSetFunction.java:435 — FlagSetFunction.validateStarlarkFlags has cognitive complexity 18 (threshold 15). Drivers by points: error handling 4 (6 pts), if/else 4 (5 pts), ternaries 2 (4 pts), loops 2, 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.
D2 · Cognitive Complexity · ActionRunner.actuallyCompleteAction (cognitive 18) · ×1
  • ActionRunner.actuallyCompleteAction (cognitive 18) src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java:1411 — ActionRunner.actuallyCompleteAction has cognitive complexity 18 (threshold 15). Drivers by points: error handling 5 (7 pts), if/else 5 (6 pts), ternaries 2 (4 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.
D2 · Cognitive Complexity · BzlLoadFunction.getLoadLabels (cognitive 18) · ×1
  • BzlLoadFunction.getLoadLabels (cognitive 18) src/main/java/com/google/devtools/build/lib/skyframe/BzlLoadFunction.java:1047 — BzlLoadFunction.getLoadLabels has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 2, error handling 1 (2 pts), loops 1, ternaries 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 · SandboxStash.initialize (cognitive 18) · ×1
  • SandboxStash.initialize (cognitive 18) src/main/java/com/google/devtools/build/lib/sandbox/SandboxStash.java:424 — SandboxStash.initialize has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (7 pts), boolean chains 1 (nesting depth added 9). 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 · PrintActionRunner.gatherActionsForTargets (cognitive 18) · ×1
  • PrintActionRunner.gatherActionsForTargets (cognitive 18) src/main/java/com/google/devtools/build/lib/runtime/commands/PrintActionCommand.java:178 — PrintActionRunner.gatherActionsForTargets has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 2 (7 pts), 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 · StarlarkOptionsParser.parseArg (cognitive 18) · ×1
  • StarlarkOptionsParser.parseArg (cognitive 18) src/main/java/com/google/devtools/build/lib/runtime/StarlarkOptionsParser.java:363 — StarlarkOptionsParser.parseArg has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), ternaries 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 · JavaCompileAction.createFullOutputDeps (cognitive 18) · ×1
  • JavaCompileAction.createFullOutputDeps (cognitive 18) src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileAction.java:716 — JavaCompileAction.createFullOutputDeps has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, loops 2 (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 · SkyframeEnvTargetPatternEvaluator.preloadTargetPatterns (cognitive 18) · ×1
  • SkyframeEnvTargetPatternEvaluator.preloadTargetPatterns (cognitive 18) src/main/java/com/google/devtools/build/lib/rules/genquery/GenQuery.java:410 — SkyframeEnvTargetPatternEvaluator.preloadTargetPatterns has cognitive complexity 18 (threshold 15). Drivers by points: loops 6 (9 pts), if/else 5 (7 pts), error handling 1 (2 pts) (nesting depth added 6). 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 · RemoteExecutionService.buildCommand (cognitive 18) · ×1
  • RemoteExecutionService.buildCommand (cognitive 18) src/main/java/com/google/devtools/build/lib/remote/RemoteExecutionService.java:278 — RemoteExecutionService.buildCommand has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4 (6 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 · TextEncoder.field (cognitive 18) · ×1
  • TextEncoder.field (cognitive 18) src/main/java/com/google/devtools/build/lib/packages/Proto.java:159 — TextEncoder.field has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (7 pts), error handling 2 (6 pts), loops 2 (4 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 · IncludeVisitor.processInternal (cognitive 18) · ×1
  • IncludeVisitor.processInternal (cognitive 18) src/main/java/com/google/devtools/build/lib/includescanning/LegacyIncludeScanner.java:696 — IncludeVisitor.processInternal has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 3 (6 pts), boolean chains 1, error handling 1 (nesting depth added 9). 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 · StarlarkBaseExternalContext.getUrls (cognitive 18) · ×1
  • StarlarkBaseExternalContext.getUrls (cognitive 18) src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkBaseExternalContext.java:463 — StarlarkBaseExternalContext.getUrls has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, error handling 1 (2 pts), loops 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.
D2 · Cognitive Complexity · AttributeUtils.typeCheckAttrValues (cognitive 18) · ×1
  • AttributeUtils.typeCheckAttrValues (cognitive 18) src/main/java/com/google/devtools/build/lib/bazel/repository/AttributeUtils.java:51 — AttributeUtils.typeCheckAttrValues has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 2, error handling 1 (2 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 · VendorCommand.exec (cognitive 18) · ×1
  • VendorCommand.exec (cognitive 18) src/main/java/com/google/devtools/build/lib/bazel/commands/VendorCommand.java:133 — VendorCommand.exec has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 2 (4 pts), error handling 3, 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.
D2 · Cognitive Complexity · VendorCommand.vendorTargets (cognitive 18) · ×1
  • VendorCommand.vendorTargets (cognitive 18) src/main/java/com/google/devtools/build/lib/bazel/commands/VendorCommand.java:303 — VendorCommand.vendorTargets has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 4 (6 pts), error handling 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 · ModuleFileFunction.maybePatchModuleFile (cognitive 18) · ×1
  • ModuleFileFunction.maybePatchModuleFile (cognitive 18) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleFileFunction.java:941 — ModuleFileFunction.maybePatchModuleFile has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 2 (3 pts), loops 3 (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 · StarlarkTransition.validate (cognitive 18) · ×1
  • StarlarkTransition.validate (cognitive 18) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkTransition.java:144 — StarlarkTransition.validate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (4 pts), boolean chains 2, ternaries 1 (2 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 · StarlarkSubrule.call (cognitive 18) · ×1
  • StarlarkSubrule.call (cognitive 18) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkSubrule.java:141 — StarlarkSubrule.call has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), ternaries 1 (2 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 · CustomCommandLine.arguments (cognitive 18) · ×1
  • CustomCommandLine.arguments (cognitive 18) src/main/java/com/google/devtools/build/lib/analysis/actions/CustomCommandLine.java:1303 — CustomCommandLine.arguments has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 1, loops 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.
D2 · Cognitive Complexity · VectorArgFragment.addToFingerprint (cognitive 18) · ×1
  • VectorArgFragment.addToFingerprint (cognitive 18) src/main/java/com/google/devtools/build/lib/analysis/actions/CustomCommandLine.java:471 — VectorArgFragment.addToFingerprint has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 2 (6 pts), ternaries 1 (nesting depth added 6). 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 · Project.differentProjectFilesError (cognitive 18) · ×1
  • Project.differentProjectFilesError (cognitive 18) src/main/java/com/google/devtools/build/lib/analysis/Project.java:203 — Project.differentProjectFilesError has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 5 (7 pts), ternaries 1 (2 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 · ResourceManager.areResourcesAvailable (cognitive 18) · ×1
  • ResourceManager.areResourcesAvailable (cognitive 18) src/main/java/com/google/devtools/build/lib/actions/ResourceManager.java:673 — ResourceManager.areResourcesAvailable has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2, 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 · InputMetadataProvider.expandArtifacts (cognitive 18) · ×1
  • InputMetadataProvider.expandArtifacts (cognitive 18) src/main/java/com/google/devtools/build/lib/actions/InputMetadataProvider.java:127 — InputMetadataProvider.expandArtifacts has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 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 · ExecutionRequirements.parseResources (cognitive 18) · ×1
  • ExecutionRequirements.parseResources (cognitive 18) src/main/java/com/google/devtools/build/lib/actions/ExecutionRequirements.java:204 — ExecutionRequirements.parseResources has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 1 (2 pts), ternaries 1 (2 pts), 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 · clr_converter._render_option (cognitive 18) · ×1
  • clr_converter._render_option (cognitive 18) scripts/docs/clr_converter.py:537 — clr_converter._render_option has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), loops 2 (4 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 5). 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.
D2 · Cognitive Complexity · relnotes.extract_relnotes (cognitive 18) · ×1
  • relnotes.extract_relnotes (cognitive 18) scripts/release/relnotes.py:36 — relnotes.extract_relnotes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 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 · FetchServer.parseQualifiers (cognitive 17) · ×1
  • FetchServer.parseQualifiers (cognitive 17) src/tools/remote/src/main/java/com/google/devtools/build/remote/worker/FetchServer.java:182 — FetchServer.parseQualifiers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 2 (7 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 · ExecLogParser.main (cognitive 17) · ×1
  • ExecLogParser.main (cognitive 17) src/tools/execlog/src/main/java/com/google/devtools/build/execlog/ExecLogParser.java:217 — ExecLogParser.main has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 4 (nesting depth added 2). 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 · 1Lambda.execClauses (cognitive 17) · ×1
  • 1Lambda.execClauses (cognitive 17) src/main/java/net/starlark/java/eval/Eval.java:962 — 1Lambda.execClauses has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 2 (5 pts), loops 1 (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 · ParallelEvaluator.eval (cognitive 17) · ×1
  • ParallelEvaluator.eval (cognitive 17) src/main/java/com/google/devtools/build/skyframe/ParallelEvaluator.java:644 — ParallelEvaluator.eval has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (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 · ResourceUsage.readPressureStallIndicator (cognitive 17) · ×1
  • ResourceUsage.readPressureStallIndicator (cognitive 17) src/main/java/com/google/devtools/build/lib/util/ResourceUsage.java:166 — ResourceUsage.readPressureStallIndicator has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 1 (2 pts), error handling 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 · RegisteredExecutionPlatformsFunction.compute (cognitive 17) · ×1
  • RegisteredExecutionPlatformsFunction.compute (cognitive 17) src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredExecutionPlatformsFunction.java:76 — RegisteredExecutionPlatformsFunction.compute has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (7 pts), error handling 3 (5 pts), ternaries 3 (4 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.
D2 · Cognitive Complexity · WaitForNestedNodeBytes.apply (cognitive 17) · ×1
  • WaitForNestedNodeBytes.apply (cognitive 17) src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/FileDependencyDeserializer.java:596 — WaitForNestedNodeBytes.apply has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 4 (8 pts), loops 4, if/else 3, error handling 1, ternaries 1 (nesting depth added 4). 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 · PackageCollectingParallelVisitor.getVisitResult (cognitive 17) · ×1
  • PackageCollectingParallelVisitor.getVisitResult (cognitive 17) src/main/java/com/google/devtools/build/lib/skyframe/TraversalInfoRootPackageExtractor.java:143 — PackageCollectingParallelVisitor.getVisitResult has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 3 (5 pts) (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 · SkymeldModule.determineIfMergingAnalysisExecution (cognitive 17) · ×1
  • SkymeldModule.determineIfMergingAnalysisExecution (cognitive 17) src/main/java/com/google/devtools/build/lib/skyframe/SkymeldModule.java:34 — SkymeldModule.determineIfMergingAnalysisExecution has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 7 (8 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ProjectFunction.parseLegacyProjectSchema (cognitive 17) · ×1
  • ProjectFunction.parseLegacyProjectSchema (cognitive 17) src/main/java/com/google/devtools/build/lib/skyframe/ProjectFunction.java:214 — ProjectFunction.parseLegacyProjectSchema has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), error handling 1 (3 pts), loops 2 (3 pts), boolean chains 2, ternaries 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 · ProjectFilesLookupFunction.compute (cognitive 17) · ×1
  • ProjectFilesLookupFunction.compute (cognitive 17) src/main/java/com/google/devtools/build/lib/skyframe/ProjectFilesLookupFunction.java:47 — ProjectFilesLookupFunction.compute has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 2 (4 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 · FileSystemValueCheckerInferringAncestors.processEntries (cognitive 17) · ×1
  • FileSystemValueCheckerInferringAncestors.processEntries (cognitive 17) src/main/java/com/google/devtools/build/lib/skyframe/FileSystemValueCheckerInferringAncestors.java:183 — FileSystemValueCheckerInferringAncestors.processEntries has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (2 pts) (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 · BzlLoadFunction.computeInternalWithCompiledBzl (cognitive 17) · ×1
  • BzlLoadFunction.computeInternalWithCompiledBzl (cognitive 17) src/main/java/com/google/devtools/build/lib/skyframe/BzlLoadFunction.java:757 — BzlLoadFunction.computeInternalWithCompiledBzl has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, ternaries 2 (3 pts), boolean chains 2, error handling 1 (2 pts), loops 2 (nesting depth added 2). 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 · AspectFunction.getInitialValues (cognitive 17) · ×1
  • AspectFunction.getInitialValues (cognitive 17) src/main/java/com/google/devtools/build/lib/skyframe/AspectFunction.java:703 — AspectFunction.getInitialValues has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), error handling 4 (6 pts), ternaries 1 (nesting depth added 3). 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 · LinuxSandboxedSpawnRunner.prepareSpawn (cognitive 17) · ×1
  • LinuxSandboxedSpawnRunner.prepareSpawn (cognitive 17) src/main/java/com/google/devtools/build/lib/sandbox/LinuxSandboxedSpawnRunner.java:250 — LinuxSandboxedSpawnRunner.prepareSpawn has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 1 (2 pts), boolean chains 1, ternaries 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 · MobileInstallCommand.doMobileInstall (cognitive 17) · ×1
  • MobileInstallCommand.doMobileInstall (cognitive 17) src/main/java/com/google/devtools/build/lib/runtime/mobileinstall/MobileInstallCommand.java:200 — MobileInstallCommand.doMobileInstall has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (15 pts), loops 2 (nesting depth added 3). 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 · TerminalTestResultNotifier.printSummary (cognitive 17) · ×1
  • TerminalTestResultNotifier.printSummary (cognitive 17) src/main/java/com/google/devtools/build/lib/runtime/TerminalTestResultNotifier.java:112 — TerminalTestResultNotifier.printSummary has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 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 · CommandLinePathFactory.create (cognitive 17) · ×1
  • CommandLinePathFactory.create (cognitive 17) src/main/java/com/google/devtools/build/lib/runtime/CommandLinePathFactory.java:83 — CommandLinePathFactory.create has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, 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 · Builder.build (cognitive 17) · ×1
  • Builder.build (cognitive 17) src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java:1764 — Builder.build has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), loops 6, ternaries 3, boolean chains 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 · JavaCompilationHelper.createCompileAction (cognitive 17) · ×1
  • JavaCompilationHelper.createCompileAction (cognitive 17) src/main/java/com/google/devtools/build/lib/rules/java/JavaCompilationHelper.java:140 — JavaCompilationHelper.createCompileAction has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, ternaries 2 (3 pts), boolean chains 2 (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 · StarlarkStructureAdapter.getFieldValue (cognitive 17) · ×1
  • StarlarkStructureAdapter.getFieldValue (cognitive 17) src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainVariables.java:858 — StarlarkStructureAdapter.getFieldValue has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 1 (2 pts), boolean chains 1, error handling 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 · ConfigGlobalLibrary.validateBuildSettingKeys (cognitive 17) · ×1
  • ConfigGlobalLibrary.validateBuildSettingKeys (cognitive 17) src/main/java/com/google/devtools/build/lib/rules/config/ConfigGlobalLibrary.java:142 — ConfigGlobalLibrary.validateBuildSettingKeys has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), error handling 1 (3 pts), boolean chains 1, loops 1, ternaries 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 · BulkTransfers.mergeBulkTransfer (cognitive 17) · ×1
  • BulkTransfers.mergeBulkTransfer (cognitive 17) src/main/java/com/google/devtools/build/lib/remote/util/BulkTransfers.java:73 — BulkTransfers.mergeBulkTransfer has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 3 (6 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 · BulkTransfers.waitForBulkTransfer (cognitive 17) · ×1
  • BulkTransfers.waitForBulkTransfer (cognitive 17) src/main/java/com/google/devtools/build/lib/remote/util/BulkTransfers.java:36 — BulkTransfers.waitForBulkTransfer has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 2 (4 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 · FastCdcChunker.chunkToDigests (cognitive 17) · ×1
  • FastCdcChunker.chunkToDigests (cognitive 17) src/main/java/com/google/devtools/build/lib/remote/chunking/FastCdcChunker.java:192 — FastCdcChunker.chunkToDigests has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (4 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 · RemoteModule.executorInit (cognitive 17) · ×1
  • RemoteModule.executorInit (cognitive 17) src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java:1236 — RemoteModule.executorInit has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 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 · RemoteExecutionService.initUseOutputPaths (cognitive 17) · ×1
  • RemoteExecutionService.initUseOutputPaths (cognitive 17) src/main/java/com/google/devtools/build/lib/remote/RemoteExecutionService.java:461 — RemoteExecutionService.initUseOutputPaths has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 4, error handling 1 (nesting depth added 2). 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.
D2 · Cognitive Complexity · ConditionalEdges.getAllConditions (cognitive 17) · ×1
  • ConditionalEdges.getAllConditions (cognitive 17) src/main/java/com/google/devtools/build/lib/query2/query/output/ConditionalEdges.java:117 — ConditionalEdges.getAllConditions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (5 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 · StarlarkNativeModule.starlarkifyValue (cognitive 17) · ×1
  • StarlarkNativeModule.starlarkifyValue (cognitive 17) src/main/java/com/google/devtools/build/lib/packages/StarlarkNativeModule.java:716 — StarlarkNativeModule.starlarkifyValue has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 3, boolean chains 2, error handling 1, 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 · PackageSpecification.fromStringPositive (cognitive 17) · ×1
  • PackageSpecification.fromStringPositive (cognitive 17) src/main/java/com/google/devtools/build/lib/packages/PackageSpecification.java:160 — PackageSpecification.fromStringPositive has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), error handling 2, boolean chains 1, ternaries 1 (nesting depth added 3). 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 · ConfiguredAttributeMapper.resolveSelector (cognitive 17) · ×1
  • ConfiguredAttributeMapper.resolveSelector (cognitive 17) src/main/java/com/google/devtools/build/lib/packages/ConfiguredAttributeMapper.java:279 — ConfiguredAttributeMapper.resolveSelector has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (15 pts), loops 1 (2 pts) (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.
D2 · Cognitive Complexity · AspectsList.validateTopLevelAspectsParameters (cognitive 17) · ×1
  • AspectsList.validateTopLevelAspectsParameters (cognitive 17) src/main/java/com/google/devtools/build/lib/packages/AspectsList.java:125 — AspectsList.validateTopLevelAspectsParameters has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts), boolean chains 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 · IncludeParser.extractInclusions (cognitive 17) · ×1
  • IncludeParser.extractInclusions (cognitive 17) src/main/java/com/google/devtools/build/lib/includescanning/IncludeParser.java:814 — IncludeParser.extractInclusions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 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 · DefaultNestedSetBuilder.addTransitiveImpl (cognitive 17) · ×1
  • DefaultNestedSetBuilder.addTransitiveImpl (cognitive 17) src/main/java/com/google/devtools/build/lib/collect/nestedset/NestedSetBuilder.java:480 — DefaultNestedSetBuilder.addTransitiveImpl has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (5 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 · SymlinkForest.plantSymlinkForest (cognitive 17) · ×1
  • SymlinkForest.plantSymlinkForest (cognitive 17) src/main/java/com/google/devtools/build/lib/buildtool/SymlinkForest.java:275 — SymlinkForest.plantSymlinkForest 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 · OutputDirectoryLinksUtils.createOutputDirectoryLinks (cognitive 17) · ×1
  • OutputDirectoryLinksUtils.createOutputDirectoryLinks (cognitive 17) src/main/java/com/google/devtools/build/lib/buildtool/OutputDirectoryLinksUtils.java:75 — OutputDirectoryLinksUtils.createOutputDirectoryLinks 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 · UrlRewriter.updateAuthHeaders (cognitive 17) · ×1
  • UrlRewriter.updateAuthHeaders (cognitive 17) src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/UrlRewriter.java:191 — UrlRewriter.updateAuthHeaders has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), error handling 1 (3 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 · Factory.create (cognitive 17) · ×1
  • Factory.create (cognitive 17) src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/HttpStream.java:71 — Factory.create has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 3 (4 pts), loops 1 (2 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.
D2 · Cognitive Complexity · StarlarkRuleConfiguredTargetUtil.parseDefaultProviderFields (cognitive 17) · ×1
  • StarlarkRuleConfiguredTargetUtil.parseDefaultProviderFields (cognitive 17) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleConfiguredTargetUtil.java:364 — StarlarkRuleConfiguredTargetUtil.parseDefaultProviderFields has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 5, boolean chains 3 (nesting depth added 2). 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 · BuildConfigurationKeyProducer.resetFlags (cognitive 17) · ×1
  • BuildConfigurationKeyProducer.resetFlags (cognitive 17) src/main/java/com/google/devtools/build/lib/analysis/producers/BuildConfigurationKeyProducer.java:329 — BuildConfigurationKeyProducer.resetFlags has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 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 · SuccessfulArtifactFilter.filterArtifactNestedSetToBuiltArtifacts (cognitive 17) · ×1
  • SuccessfulArtifactFilter.filterArtifactNestedSetToBuiltArtifacts (cognitive 17) src/main/java/com/google/devtools/build/lib/analysis/TopLevelArtifactHelper.java:357 — SuccessfulArtifactFilter.filterArtifactNestedSetToBuiltArtifacts has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 4, boolean chains 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.
D2 · Cognitive Complexity · Runfiles.filterListForObscuringSymlinks (cognitive 17) · ×1
  • Runfiles.filterListForObscuringSymlinks (cognitive 17) src/main/java/com/google/devtools/build/lib/analysis/Runfiles.java:266 — Runfiles.filterListForObscuringSymlinks has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (14 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 · AnnotParamDoc.getType (cognitive 17) · ×1
  • AnnotParamDoc.getType (cognitive 17) src/main/java/com/google/devtools/build/docgen/starlark/AnnotParamDoc.java:41 — AnnotParamDoc.getType has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 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 · DocCheckerUtils.getFirstUnclosedTag (cognitive 17) · ×1
  • DocCheckerUtils.getFirstUnclosedTag (cognitive 17) src/main/java/com/google/devtools/build/docgen/DocCheckerUtils.java:58 — DocCheckerUtils.getFirstUnclosedTag has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (15 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.
D2 · Cognitive Complexity · aquery_differ._aquery_diff (cognitive 17) · ×1
  • aquery_differ._aquery_diff (cognitive 17) scripts/aquery_differ/aquery_differ.py:215 — aquery_differ._aquery_diff has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (4 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 · ExecutionServer.getCommand (cognitive 16) · ×1
  • ExecutionServer.getCommand (cognitive 16) src/tools/remote/src/main/java/com/google/devtools/build/remote/worker/ExecutionServer.java:570 — ExecutionServer.getCommand has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (6 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 · CallableType.toSignatureString (cognitive 16) · ×1
  • CallableType.toSignatureString (cognitive 16) src/main/java/net/starlark/java/syntax/Types.java:713 — CallableType.toSignatureString has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 3 (nesting depth added 3). 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 · TypeTagger.resolveTypeConstructor (cognitive 16) · ×1
  • TypeTagger.resolveTypeConstructor (cognitive 16) src/main/java/net/starlark/java/syntax/TypeTagger.java:141 — TypeTagger.resolveTypeConstructor has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 1 (2 pts), boolean chains 1, error handling 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.
D2 · Cognitive Complexity · Printer.appendTripleQuoted (cognitive 16) · ×1
  • Printer.appendTripleQuoted (cognitive 16) src/main/java/net/starlark/java/eval/Printer.java:319 — Printer.appendTripleQuoted has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, loops 1, ternaries 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.
D2 · Cognitive Complexity · EvalException.formatCallStack (cognitive 16) · ×1
  • EvalException.formatCallStack (cognitive 16) src/main/java/net/starlark/java/eval/EvalException.java:201 — EvalException.formatCallStack has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 1 (2 pts), ternaries 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 · ArgumentProcessor.addNamedArg (cognitive 16) · ×1
  • ArgumentProcessor.addNamedArg (cognitive 16) src/main/java/net/starlark/java/eval/BuiltinFunction.java:333 — ArgumentProcessor.addNamedArg has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (16 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 · OptionsParser.describeOptionsWithDeprecatedCategories (cognitive 16) · ×1
  • OptionsParser.describeOptionsWithDeprecatedCategories (cognitive 16) src/main/java/com/google/devtools/common/options/OptionsParser.java:495 — OptionsParser.describeOptionsWithDeprecatedCategories has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (4 pts), boolean chains 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 · FilterValueOperation.checkUserValue (cognitive 16) · ×1
  • FilterValueOperation.checkUserValue (cognitive 16) src/main/java/com/google/devtools/common/options/InvocationPolicyEnforcer.java:864 — FilterValueOperation.checkUserValue has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 1 (2 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 · DirtyingNodeVisitor.visit (cognitive 16) · ×1
  • DirtyingNodeVisitor.visit (cognitive 16) src/main/java/com/google/devtools/build/skyframe/InvalidatingNodeVisitor.java:456 — DirtyingNodeVisitor.visit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 3, boolean chains 2, error handling 1, 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 · UnixOsPathPolicy.needsToNormalize (cognitive 16) · ×1
  • UnixOsPathPolicy.needsToNormalize (cognitive 16) src/main/java/com/google/devtools/build/lib/vfs/UnixOsPathPolicy.java:26 — UnixOsPathPolicy.needsToNormalize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, loops 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.
D2 · Cognitive Complexity · ThreadDumpAnalyzer.analyze (cognitive 16) · ×1
  • ThreadDumpAnalyzer.analyze (cognitive 16) src/main/java/com/google/devtools/build/lib/util/ThreadDumpAnalyzer.java:60 — ThreadDumpAnalyzer.analyze has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 5 (8 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 · SimpleLogHandler.openOutputIfNeeded (cognitive 16) · ×1
  • SimpleLogHandler.openOutputIfNeeded (cognitive 16) src/main/java/com/google/devtools/build/lib/util/SimpleLogHandler.java:827 — SimpleLogHandler.openOutputIfNeeded has cognitive complexity 16 (threshold 15). Drivers by points: error handling 3 (8 pts), if/else 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 · RemoteAnalysisCacheFactory.create (cognitive 16) · ×1
  • RemoteAnalysisCacheFactory.create (cognitive 16) src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/RemoteAnalysisCacheFactory.java:80 — RemoteAnalysisCacheFactory.create has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 3, error handling 1 (nesting depth added 2). 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 · ActionRewindStrategy.calculateLostInputOwners (cognitive 16) · ×1
  • ActionRewindStrategy.calculateLostInputOwners (cognitive 16) src/main/java/com/google/devtools/build/lib/skyframe/rewinding/ActionRewindStrategy.java:671 — ActionRewindStrategy.calculateLostInputOwners has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (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 · PlatformMappingFunction.compute (cognitive 16) · ×1
  • PlatformMappingFunction.compute (cognitive 16) src/main/java/com/google/devtools/build/lib/skyframe/config/PlatformMappingFunction.java:70 — PlatformMappingFunction.compute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 2 (4 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 · TestExpansionFunction.getPrerequisites (cognitive 16) · ×1
  • TestExpansionFunction.getPrerequisites (cognitive 16) src/main/java/com/google/devtools/build/lib/skyframe/TestExpansionFunction.java:147 — TestExpansionFunction.getPrerequisites has cognitive complexity 16 (threshold 15). Drivers by points: error handling 3 (7 pts), if/else 4 (7 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 · StarlarkBuildSettingsDetailsFunction.getBuildSettingPackages (cognitive 16) · ×1
  • StarlarkBuildSettingsDetailsFunction.getBuildSettingPackages (cognitive 16) src/main/java/com/google/devtools/build/lib/skyframe/StarlarkBuildSettingsDetailsFunction.java:245 — StarlarkBuildSettingsDetailsFunction.getBuildSettingPackages has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (5 pts), error handling 1 (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 · SequencedSkyframeExecutor.decideKeepIncrementalState (cognitive 16) · ×1
  • SequencedSkyframeExecutor.decideKeepIncrementalState (cognitive 16) src/main/java/com/google/devtools/build/lib/skyframe/SequencedSkyframeExecutor.java:439 — SequencedSkyframeExecutor.decideKeepIncrementalState has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4 (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 · RecursiveFilesystemTraversalFunction.checkIfPackage (cognitive 16) · ×1
  • RecursiveFilesystemTraversalFunction.checkIfPackage (cognitive 16) src/main/java/com/google/devtools/build/lib/skyframe/RecursiveFilesystemTraversalFunction.java:551 — RecursiveFilesystemTraversalFunction.checkIfPackage 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.
D2 · Cognitive Complexity · RecursiveFilesystemTraversalFunction.traverseSourceChildren (cognitive 16) · ×1
  • RecursiveFilesystemTraversalFunction.traverseSourceChildren (cognitive 16) src/main/java/com/google/devtools/build/lib/skyframe/RecursiveFilesystemTraversalFunction.java:722 — RecursiveFilesystemTraversalFunction.traverseSourceChildren has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2, ternaries 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.
D2 · Cognitive Complexity · ProjectFunction.parseConfigs (cognitive 16) · ×1
  • ProjectFunction.parseConfigs (cognitive 16) src/main/java/com/google/devtools/build/lib/skyframe/ProjectFunction.java:274 — ProjectFunction.parseConfigs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (5 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 · ProcessPackageDirectory.getPackageExistenceAndSubdirDeps (cognitive 16) · ×1
  • ProcessPackageDirectory.getPackageExistenceAndSubdirDeps (cognitive 16) src/main/java/com/google/devtools/build/lib/skyframe/ProcessPackageDirectory.java:78 — ProcessPackageDirectory.getPackageExistenceAndSubdirDeps has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), error handling 6, boolean chains 2 (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 · BzlLoadCycleReporter.maybeReportCycle (cognitive 16) · ×1
  • BzlLoadCycleReporter.maybeReportCycle (cognitive 16) src/main/java/com/google/devtools/build/lib/skyframe/BzlLoadCycleReporter.java:65 — BzlLoadCycleReporter.maybeReportCycle has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 4, loops 2 (4 pts) (nesting depth added 2). 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 · RunCommand.validateTargets (cognitive 16) · ×1
  • RunCommand.validateTargets (cognitive 16) src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java:1066 — RunCommand.validateTargets has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 2, loops 1, ternaries 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.
D2 · Cognitive Complexity · UiStateTracker.writeExecutionProgress (cognitive 16) · ×1
  • UiStateTracker.writeExecutionProgress (cognitive 16) src/main/java/com/google/devtools/build/lib/runtime/UiStateTracker.java:1315 — UiStateTracker.writeExecutionProgress has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2 (nesting depth added 3). 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 · LocationPrinter.getRelativeLocationString (cognitive 16) · ×1
  • LocationPrinter.getRelativeLocationString (cognitive 16) src/main/java/com/google/devtools/build/lib/runtime/LocationPrinter.java:49 — LocationPrinter.getRelativeLocationString has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 1 (3 pts), boolean chains 1, ternaries 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 · BlazeRuntime.afterCommand (cognitive 16) · ×1
  • BlazeRuntime.afterCommand (cognitive 16) src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java:806 — BlazeRuntime.afterCommand has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), error handling 3 (4 pts), boolean chains 2, loops 2 (nesting depth added 2). 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 · AggregatingTestListener.differentialAnalyzeAndReport (cognitive 16) · ×1
  • AggregatingTestListener.differentialAnalyzeAndReport (cognitive 16) src/main/java/com/google/devtools/build/lib/runtime/AggregatingTestListener.java:251 — AggregatingTestListener.differentialAnalyzeAndReport has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (4 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 · JavaCompileAction.execute (cognitive 16) · ×1
  • JavaCompileAction.execute (cognitive 16) src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileAction.java:356 — JavaCompileAction.execute has cognitive complexity 16 (threshold 15). Drivers by points: error handling 7 (8 pts), if/else 7, boolean chains 1 (nesting depth added 1). 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 · FilterShowIncludesOutputStream.write (cognitive 16) · ×1
  • FilterShowIncludesOutputStream.write (cognitive 16) src/main/java/com/google/devtools/build/lib/rules/cpp/ShowIncludesFilter.java:115 — FilterShowIncludesOutputStream.write has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 1 (2 pts), boolean chains 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 · GrpcRemoteDownloader.newFetchBlobRequest (cognitive 16) · ×1
  • GrpcRemoteDownloader.newFetchBlobRequest (cognitive 16) src/main/java/com/google/devtools/build/lib/remote/downloader/GrpcRemoteDownloader.java:247 — GrpcRemoteDownloader.newFetchBlobRequest has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), loops 4 (7 pts), boolean chains 2 (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 · ProtoOutputFormatter.getFlattenedAttributeValues (cognitive 16) · ×1
  • ProtoOutputFormatter.getFlattenedAttributeValues (cognitive 16) src/main/java/com/google/devtools/build/lib/query2/query/output/ProtoOutputFormatter.java:505 — ProtoOutputFormatter.getFlattenedAttributeValues has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 4, boolean chains 2 (nesting depth added 6). 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 · StarlarkOutputFormatterCallback.<init> (cognitive 16) · ×1
  • StarlarkOutputFormatterCallback.<init> (cognitive 16) src/main/java/com/google/devtools/build/lib/query2/cquery/StarlarkOutputFormatterCallback.java:129 — StarlarkOutputFormatterCallback.<init> has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), error handling 4 (6 pts), ternaries 1 (2 pts) (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 · ConfiguredTargetQueryEnvironment.getConfiguredTargetsForLabel (cognitive 16) · ×1
  • ConfiguredTargetQueryEnvironment.getConfiguredTargetsForLabel (cognitive 16) src/main/java/com/google/devtools/build/lib/query2/cquery/ConfiguredTargetQueryEnvironment.java:343 — ConfiguredTargetQueryEnvironment.getConfiguredTargetsForLabel has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 1, 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 · AbstractBlazeQueryEnvironment.transitiveLoadFiles (cognitive 16) · ×1
  • AbstractBlazeQueryEnvironment.transitiveLoadFiles (cognitive 16) src/main/java/com/google/devtools/build/lib/query2/common/AbstractBlazeQueryEnvironment.java:510 — AbstractBlazeQueryEnvironment.transitiveLoadFiles 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 · ActionGraphQueryEnvironment.getConfiguredTargetsForLabel (cognitive 16) · ×1
  • ActionGraphQueryEnvironment.getConfiguredTargetsForLabel (cognitive 16) src/main/java/com/google/devtools/build/lib/query2/aquery/ActionGraphQueryEnvironment.java:463 — ActionGraphQueryEnvironment.getConfiguredTargetsForLabel has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 1, 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 · MemoryProfiler.prepareBeanAndGetLocalMinUsage (cognitive 16) · ×1
  • MemoryProfiler.prepareBeanAndGetLocalMinUsage (cognitive 16) src/main/java/com/google/devtools/build/lib/profiler/MemoryProfiler.java:148 — MemoryProfiler.prepareBeanAndGetLocalMinUsage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 2 (5 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 · PathPackageLocator.getPackageBuildFileNullable (cognitive 16) · ×1
  • PathPackageLocator.getPackageBuildFileNullable (cognitive 16) src/main/java/com/google/devtools/build/lib/pkgcache/PathPackageLocator.java:83 — PathPackageLocator.getPackageBuildFileNullable has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (4 pts), error handling 1 (3 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 · PostGCMemoryUseRecorder.handleNotification (cognitive 16) · ×1
  • PostGCMemoryUseRecorder.handleNotification (cognitive 16) src/main/java/com/google/devtools/build/lib/metrics/PostGCMemoryUseRecorder.java:229 — PostGCMemoryUseRecorder.handleNotification has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 3, ternaries 2 (3 pts) (nesting depth added 3). 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 · IncludeScannerHelper.createInclusionWithContext (cognitive 16) · ×1
  • IncludeScannerHelper.createInclusionWithContext (cognitive 16) src/main/java/com/google/devtools/build/lib/includescanning/IncludeScannerHelper.java:66 — IncludeScannerHelper.createInclusionWithContext has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 1 (2 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 · Digraph.isSubgraph (cognitive 16) · ×1
  • Digraph.isSubgraph (cognitive 16) src/main/java/com/google/devtools/build/lib/graph/Digraph.java:164 — Digraph.isSubgraph has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (3 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 · RunfilesTreeUpdater.updateRunfiles (cognitive 16) · ×1
  • RunfilesTreeUpdater.updateRunfiles (cognitive 16) src/main/java/com/google/devtools/build/lib/exec/RunfilesTreeUpdater.java:67 — RunfilesTreeUpdater.updateRunfiles has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), error handling 2 (6 pts), 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 · BuildEventServiceModule.createBepTransports (cognitive 16) · ×1
  • BuildEventServiceModule.createBepTransports (cognitive 16) src/main/java/com/google/devtools/build/lib/buildeventservice/BuildEventServiceModule.java:866 — BuildEventServiceModule.createBepTransports has cognitive complexity 16 (threshold 15). Drivers by points: error handling 3 (6 pts), ternaries 3 (6 pts), if/else 4 (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 · LocalRepoContentsCache.runGc (cognitive 16) · ×1
  • LocalRepoContentsCache.runGc (cognitive 16) src/main/java/com/google/devtools/build/lib/bazel/repository/cache/LocalRepoContentsCache.java:240 — LocalRepoContentsCache.runGc has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (3 pts), boolean chains 2, ternaries 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 · BazelModuleInspectorFunction.computeAugmentedGraph (cognitive 16) · ×1
  • BazelModuleInspectorFunction.computeAugmentedGraph (cognitive 16) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/BazelModuleInspectorFunction.java:92 — BazelModuleInspectorFunction.computeAugmentedGraph 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 · BazelLockFileModule.afterCommand (cognitive 16) · ×1
  • BazelLockFileModule.afterCommand (cognitive 16) src/main/java/com/google/devtools/build/lib/bazel/bzlmod/BazelLockFileModule.java:62 — BazelLockFileModule.afterCommand has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 2, error handling 2, loops 1 (nesting depth added 2). 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.
D2 · Cognitive Complexity · TestRunnerAction.executeAllAttempts (cognitive 16) · ×1
  • TestRunnerAction.executeAllAttempts (cognitive 16) src/main/java/com/google/devtools/build/lib/analysis/test/TestRunnerAction.java:1236 — TestRunnerAction.executeAllAttempts has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 1 (2 pts), boolean chains 1, 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 · Builder.validateDirectPrerequisiteFileTypes (cognitive 16) · ×1
  • Builder.validateDirectPrerequisiteFileTypes (cognitive 16) src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java:1996 — Builder.validateDirectPrerequisiteFileTypes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, 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 · DependencyResolutionHelpers.resolveAttributes (cognitive 16) · ×1
  • DependencyResolutionHelpers.resolveAttributes (cognitive 16) src/main/java/com/google/devtools/build/lib/analysis/DependencyResolutionHelpers.java:427 — DependencyResolutionHelpers.resolveAttributes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 4 (6 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 · CommonPrerequisiteValidator.maybeAddMoreDelegationNeededBullet (cognitive 16) · ×1
  • CommonPrerequisiteValidator.maybeAddMoreDelegationNeededBullet (cognitive 16) src/main/java/com/google/devtools/build/lib/analysis/CommonPrerequisiteValidator.java:629 — CommonPrerequisiteValidator.maybeAddMoreDelegationNeededBullet has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 3 (4 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 · CommandHelper.<init> (cognitive 16) · ×1
  • CommandHelper.<init> (cognitive 16) src/main/java/com/google/devtools/build/lib/analysis/CommandHelper.java:127 — CommandHelper.<init> has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 4 (5 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 · BuildView.collectTests (cognitive 16) · ×1
  • BuildView.collectTests (cognitive 16) src/main/java/com/google/devtools/build/lib/analysis/BuildView.java:898 — BuildView.collectTests has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, 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 · ActionInputMap.getInputMetadataChecked (cognitive 16) · ×1
  • ActionInputMap.getInputMetadataChecked (cognitive 16) src/main/java/com/google/devtools/build/lib/actions/ActionInputMap.java:209 — ActionInputMap.getInputMetadataChecked has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 3 (6 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.
D2 · Cognitive Complexity · StarlarkDoc.getTypeAnchor (cognitive 16) · ×1
  • StarlarkDoc.getTypeAnchor (cognitive 16) src/main/java/com/google/devtools/build/docgen/starlark/StarlarkDoc.java:84 — StarlarkDoc.getTypeAnchor has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 4 (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 · mirror_external_deps.extract_lockfile_source_urls (cognitive 16) · ×1
  • mirror_external_deps.extract_lockfile_source_urls (cognitive 16) tools/mirror_external_deps.py:142 — mirror_external_deps.extract_lockfile_source_urls has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (5 pts), error handling 1 (2 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 · mirror_external_deps.main (cognitive 16) · ×1
  • mirror_external_deps.main (cognitive 16) tools/mirror_external_deps.py:377 — mirror_external_deps.main has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 1 (nesting depth added 3). 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.
D35 · Change Coupling · Change-coupling hub · ×1
  • Change-coupling hub: BuildTool.java → Project.java, ProjectValue.java, FlagSetValue.java, RemoteAnalysisCacheDeps.java, RemoteAnalysisCachingEventListener.java, RemoteAnalysisCachingOptions.java src/main/java/com/google/devtools/build/lib/buildtool/BuildTool.java — `src/main/java/com/google/devtools/build/lib/buildtool/BuildTool.java` changes together with 6 other files — `src/main/java/com/google/devtools/build/lib/analysis/Project.java`, `src/main/java/com/google/devtools/build/lib/skyframe/ProjectValue.java`, `src/main/java/com/google/devtools/build/lib/skyframe/config/FlagSetValue.java`, `src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/RemoteAnalysisCacheDeps.java`, `src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/RemoteAnalysisCachingEventListener.java`, `src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/RemoteAnalysisCachingOptions.java` — none of which declares a dependency on it: one file is the hub of 6 separate couplings, not 6 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 6.
D36 · Supply-chain Provenance & Signing REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (5 members, 50+ identical tokens) src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java:672 — src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java:672-764 | src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java:1005-1016 | src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java:1620-1666 | src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java:1765-1842 | src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java:1979-2042 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. 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. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Duplicated block (37 lines × 2) · ×1
  • Duplicated block (37 lines × 2) src/main/java/com/google/devtools/build/lib/buildtool/AnalysisAndExecutionPhaseRunner.java:234 — src/main/java/com/google/devtools/build/lib/buildtool/AnalysisAndExecutionPhaseRunner.java:234-270 | src/main/java/com/google/devtools/build/lib/buildtool/AnalysisPhaseRunner.java:448-484 — before extracting anything, compare `src/main/java/com/google/devtools/build/lib/buildtool/AnalysisAndExecutionPhaseRunner.java` and `src/main/java/com/google/devtools/build/lib/buildtool/AnalysisPhaseRunner.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 84 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 (31 lines × 2) · ×1
  • Duplicated block (31 lines × 2) src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/ProxyHelper.java:141 — src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/ProxyHelper.java:141-171 | src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/ProxyHelper.java:173-203 — 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 `src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/ProxyHelper.java:141` 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 (29 lines × 2) · ×1
  • Duplicated block (29 lines × 2) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttrModule.java:988 — src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttrModule.java:988-1016 | src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttrModule.java:1042-1070 — 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 `src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttrModule.java:988` 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 (28 lines × 2) · ×1
  • Duplicated block (28 lines × 2) src/main/java/com/google/devtools/build/lib/remote/util/RxFutures.java:88 — src/main/java/com/google/devtools/build/lib/remote/util/RxFutures.java:88-115 | src/main/java/com/google/devtools/build/lib/remote/util/RxFutures.java:159-186 — 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 `src/main/java/com/google/devtools/build/lib/remote/util/RxFutures.java:88` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `t` to `Void` in one and `T` 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 (25 lines × 2) · ×1
  • Duplicated block (25 lines × 2) src/main/java/com/google/devtools/build/lib/query2/aquery/ActionGraphQueryEnvironment.java:421 — src/main/java/com/google/devtools/build/lib/query2/aquery/ActionGraphQueryEnvironment.java:421-445 | src/main/java/com/google/devtools/build/lib/query2/cquery/ConfiguredTargetQueryEnvironment.java:259-283 — before extracting anything, compare `src/main/java/com/google/devtools/build/lib/query2/aquery/ActionGraphQueryEnvironment.java` and `src/main/java/com/google/devtools/build/lib/query2/cquery/ConfiguredTargetQueryEnvironment.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/google/devtools/build/lib/query2/aquery/ActionGraphQueryEnvironment.java:421` 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 (23–25 lines × 2) · ×1
  • Duplicated block (23–25 lines × 2) src/main/java/com/google/devtools/common/options/IsolatedOptionsData.java:320 — src/main/java/com/google/devtools/common/options/IsolatedOptionsData.java:320-342 | src/main/java/com/google/devtools/common/options/IsolatedOptionsData.java:346-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.
D4 · Code Duplication · Duplicated block (22–24 lines × 2) · ×1
  • Duplicated block (22–24 lines × 2) src/main/java/com/google/devtools/build/lib/runtime/commands/AqueryCommand.java:92 — src/main/java/com/google/devtools/build/lib/runtime/commands/AqueryCommand.java:92-113 | src/main/java/com/google/devtools/build/lib/runtime/commands/CqueryCommand.java:121-144 — before extracting anything, compare `src/main/java/com/google/devtools/build/lib/runtime/commands/AqueryCommand.java` and `src/main/java/com/google/devtools/build/lib/runtime/commands/CqueryCommand.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/google/devtools/build/lib/runtime/commands/AqueryCommand.java:92` 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 before the matched lines, `src/main/java/com/google/devtools/build/lib/runtime/commands/AqueryCommand.java:88` calls `getOptions`, `resetDeserializedKeysFromRemoteAnalysisCache`, `getQueryCurrentSkyframeState` and `src/main/java/com/google/devtools/build/lib/runtime/commands/CqueryCommand.java:120` 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 (23 lines × 2) · ×1
  • Duplicated block (23 lines × 2) src/main/java/com/google/devtools/build/lib/collect/compacthashmap/CompactHashMap.java:456 — src/main/java/com/google/devtools/build/lib/collect/compacthashmap/CompactHashMap.java:456-478 | src/main/java/com/google/devtools/build/lib/collect/compacthashset/CompactHashSet.java:415-437 — `src/main/java/com/google/devtools/build/lib/collect/compacthashmap/CompactHashMap.java` and `src/main/java/com/google/devtools/build/lib/collect/compacthashset/CompactHashSet.java` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 79 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/google/devtools/build/lib/collect/compacthashmap/CompactHashMap.java:456` 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.
D4 · Code Duplication · Duplicated block (15–23 lines × 2) · ×1
  • Duplicated block (15–23 lines × 2) src/main/java/com/google/devtools/build/lib/rules/platform/ConstraintSettingRule.java:42 — src/main/java/com/google/devtools/build/lib/rules/platform/ConstraintSettingRule.java:42-64 | src/main/java/com/google/devtools/build/lib/rules/platform/ConstraintValueRule.java:41-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/google/devtools/build/lib/rules/platform/ConstraintSettingRule.java:42` 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.
D4 · Code Duplication · Duplicated block (21–22 lines × 2) · ×1
  • Duplicated block (21–22 lines × 2) src/main/java/com/google/devtools/build/lib/remote/http/HttpCacheClient.java:337 — src/main/java/com/google/devtools/build/lib/remote/http/HttpCacheClient.java:337-358 | src/main/java/com/google/devtools/build/lib/remote/http/HttpCacheClient.java:412-432 — 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 `src/main/java/com/google/devtools/build/lib/remote/http/HttpCacheClient.java:337` 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 (20–22 lines × 2) · ×1
  • Duplicated block (20–22 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredExecutionPlatformsCycleReporter.java:86 — src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredExecutionPlatformsCycleReporter.java:86-107 | src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredToolchainsCycleReporter.java:98-117 — 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 `src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredExecutionPlatformsCycleReporter.java:86` 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 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 (18–20 lines × 2) · ×1
  • Duplicated block (18–20 lines × 2) src/main/java/com/google/devtools/build/lib/profiler/TraceProfilerServiceImpl.java:477 — src/main/java/com/google/devtools/build/lib/profiler/TraceProfilerServiceImpl.java:477-496 | src/main/java/com/google/devtools/build/lib/profiler/TraceProfilerServiceImpl.java:523-540 — 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 `src/main/java/com/google/devtools/build/lib/profiler/TraceProfilerServiceImpl.java:477` 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–20 lines × 2) · ×1
  • Duplicated block (17–20 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java:1467 — src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java:1467-1486 | src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java:1490-1506 — 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 `src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java:1490` 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. 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.
D4 · Code Duplication · Duplicated block (19–20 lines × 2) · ×1
  • Duplicated block (19–20 lines × 2) src/main/java/com/google/devtools/build/lib/util/HashCodes.java:143 — src/main/java/com/google/devtools/build/lib/util/HashCodes.java:143-161 | src/main/java/com/google/devtools/build/lib/util/HashCodes.java:177-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/google/devtools/build/lib/util/HashCodes.java: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. 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 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 before the matched lines, `src/main/java/com/google/devtools/build/lib/util/HashCodes.java:175` calls `hashObject` and `src/main/java/com/google/devtools/build/lib/util/HashCodes.java:141` 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.
D4 · Code Duplication · Duplicated block (15–19 lines × 2) · ×1
  • Duplicated block (15–19 lines × 2) src/main/java/com/google/devtools/build/lib/profiler/TraceProfilerServiceImpl.java:498 — src/main/java/com/google/devtools/build/lib/profiler/TraceProfilerServiceImpl.java:498-512 | src/main/java/com/google/devtools/build/lib/profiler/TraceProfilerServiceImpl.java:547-565 — 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 `src/main/java/com/google/devtools/build/lib/profiler/TraceProfilerServiceImpl.java:498` 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 (18–19 lines × 2) · ×1
  • Duplicated block (18–19 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/config/PlatformMappingFunction.java:238 — src/main/java/com/google/devtools/build/lib/skyframe/config/PlatformMappingFunction.java:238-256 | src/main/java/com/google/devtools/build/lib/skyframe/config/PlatformMappingFunction.java:271-288 — 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 `src/main/java/com/google/devtools/build/lib/skyframe/config/PlatformMappingFunction.java:238` 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 (16–18 lines × 3) · ×1
  • Duplicated block (16–18 lines × 3) src/main/java/com/google/devtools/build/lib/util/HashCodes.java:114 — src/main/java/com/google/devtools/build/lib/util/HashCodes.java:114-129 | src/main/java/com/google/devtools/build/lib/util/HashCodes.java:143-160 | src/main/java/com/google/devtools/build/lib/util/HashCodes.java:177-194 — all 3 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 `src/main/java/com/google/devtools/build/lib/util/HashCodes.java:114` 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. 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 before the matched lines, `src/main/java/com/google/devtools/build/lib/util/HashCodes.java:142` calls `hashObject` and `src/main/java/com/google/devtools/build/lib/util/HashCodes.java:113` 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.
D4 · Code Duplication · Duplicated block (12–18 lines × 2) · ×1
  • Duplicated block (12–18 lines × 2) src/main/java/com/google/devtools/build/lib/query2/aquery/ActionGraphQueryEnvironment.java:466 — src/main/java/com/google/devtools/build/lib/query2/aquery/ActionGraphQueryEnvironment.java:466-483 | src/main/java/com/google/devtools/build/lib/query2/cquery/ConfiguredTargetQueryEnvironment.java:346-357 — before extracting anything, compare `src/main/java/com/google/devtools/build/lib/query2/aquery/ActionGraphQueryEnvironment.java` and `src/main/java/com/google/devtools/build/lib/query2/cquery/ConfiguredTargetQueryEnvironment.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/google/devtools/build/lib/query2/aquery/ActionGraphQueryEnvironment.java:466` 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. 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 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.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×1
  • Duplicated block (16–17 lines × 2) src/main/java/com/google/devtools/build/lib/remote/http/HttpCacheClient.java:373 — src/main/java/com/google/devtools/build/lib/remote/http/HttpCacheClient.java:373-388 | src/main/java/com/google/devtools/build/lib/remote/http/HttpCacheClient.java:440-456 — 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 `src/main/java/com/google/devtools/build/lib/remote/http/HttpCacheClient.java:373` 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 (14–16 lines × 2) · ×1
  • Duplicated block (14–16 lines × 2) src/main/java/com/google/devtools/build/lib/skyframe/BzlCompileFunction.java:525 — src/main/java/com/google/devtools/build/lib/skyframe/BzlCompileFunction.java:525-538 | src/main/java/com/google/devtools/build/lib/skyframe/BzlCompileFunction.java:555-570 — 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 `src/main/java/com/google/devtools/build/lib/skyframe/BzlCompileFunction.java:525` 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. 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.
D4 · Code Duplication · Duplicated block (9–15 lines × 4) · ×1
  • Duplicated block (9–15 lines × 4) src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainFeaturesLib.java:159 — src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainFeaturesLib.java:159-169 | src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainFeaturesLib.java:181-189 | src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainFeaturesLib.java:197-211 | src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainFeaturesLib.java:218-226 — 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.
D4 · Code Duplication · Duplicated block (12–15 lines × 4) · ×1
  • Duplicated block (12–15 lines × 4) src/main/java/com/google/devtools/build/lib/util/HashCodes.java:91 — src/main/java/com/google/devtools/build/lib/util/HashCodes.java:91-102 | src/main/java/com/google/devtools/build/lib/util/HashCodes.java:115-129 | src/main/java/com/google/devtools/build/lib/util/HashCodes.java:144-158 | src/main/java/com/google/devtools/build/lib/util/HashCodes.java:178-192 — 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 `src/main/java/com/google/devtools/build/lib/util/HashCodes.java:91` 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. 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 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 before the matched lines, `src/main/java/com/google/devtools/build/lib/util/HashCodes.java:114` calls `hashObject` and `src/main/java/com/google/devtools/build/lib/util/HashCodes.java:90` 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.
D4 · Code Duplication · Duplicated block (11–14 lines × 3) · ×1
  • Duplicated block (11–14 lines × 3) src/main/java/com/google/devtools/build/lib/bazel/repository/decompressor/ArFunction.java:57 — src/main/java/com/google/devtools/build/lib/bazel/repository/decompressor/ArFunction.java:57-67 | src/main/java/com/google/devtools/build/lib/bazel/repository/decompressor/CompressedFunction.java:74-84 | src/main/java/com/google/devtools/build/lib/bazel/repository/decompressor/CompressedTarFunction.java:109-122 — 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.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×1
  • Duplicated block (14 lines × 3) src/main/java/com/google/devtools/build/lib/bazel/repository/decompressor/PatchUtil.java:590 — src/main/java/com/google/devtools/build/lib/bazel/repository/decompressor/PatchUtil.java:590-603 | src/main/java/com/google/devtools/build/lib/bazel/repository/decompressor/PatchUtil.java:605-618 | src/main/java/com/google/devtools/build/lib/bazel/repository/decompressor/PatchUtil.java:621-634 — all 3 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 `src/main/java/com/google/devtools/build/lib/bazel/repository/decompressor/PatchUtil.java:590` 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.
D4 · Code Duplication · Duplicated block (10–14 lines × 2) · ×1
  • Duplicated block (10–14 lines × 2) src/main/java/com/google/devtools/build/lib/remote/http/HttpCacheClient.java:582 — src/main/java/com/google/devtools/build/lib/remote/http/HttpCacheClient.java:582-595 | src/main/java/com/google/devtools/build/lib/remote/http/HttpCacheClient.java:635-644 — 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 `src/main/java/com/google/devtools/build/lib/remote/http/HttpCacheClient.java:582` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/main/java/com/google/devtools/build/lib/remote/http/HttpCacheClient.java:634` calls `getNow` and `src/main/java/com/google/devtools/build/lib/remote/http/HttpCacheClient.java:581` 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 (13–14 lines × 2) · ×1
  • Duplicated block (13–14 lines × 2) src/main/java/net/starlark/java/eval/Starlark.java:927 — src/main/java/net/starlark/java/eval/Starlark.java:927-939 | src/main/java/net/starlark/java/eval/Starlark.java:961-974 — 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 `src/main/java/net/starlark/java/eval/Starlark.java:927` 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.
D4 · Code Duplication · Duplicated block (10–13 lines × 2) · ×1
  • Duplicated block (10–13 lines × 2) src/main/java/com/google/devtools/build/lib/vfs/inmemoryfs/InMemoryFileSystem.java:517 — src/main/java/com/google/devtools/build/lib/vfs/inmemoryfs/InMemoryFileSystem.java:517-526 | src/main/java/com/google/devtools/build/lib/vfs/inmemoryfs/InMemoryFileSystem.java:731-743 — 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 `src/main/java/com/google/devtools/build/lib/vfs/inmemoryfs/InMemoryFileSystem.java:517` 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.
D4 · Code Duplication · Duplicated block (10–11 lines × 4) · ×1
  • Duplicated block (10–11 lines × 4) src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleClassFunctions.java:824 — src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleClassFunctions.java:824-833 | src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleClassFunctions.java:840-850 | src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleClassFunctions.java:858-868 | src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleClassFunctions.java:893-903 — 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.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×1
  • Duplicated block (10–11 lines × 2) src/main/java/com/google/devtools/build/lib/authandtls/credentialhelper/GetCredentialsRequest.java:79 — src/main/java/com/google/devtools/build/lib/authandtls/credentialhelper/GetCredentialsRequest.java:79-89 | src/main/java/com/google/devtools/build/lib/authandtls/credentialhelper/GetCredentialsResponse.java:125-134 — 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 `src/main/java/com/google/devtools/build/lib/authandtls/credentialhelper/GetCredentialsRequest.java:79` 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 (8–9 lines × 4) · ×1
  • Duplicated block (8–9 lines × 4) src/main/java/com/google/devtools/build/lib/runtime/commands/AqueryCommand.java:147 — src/main/java/com/google/devtools/build/lib/runtime/commands/AqueryCommand.java:147-154 | src/main/java/com/google/devtools/build/lib/runtime/commands/BuildCommand.java:95-103 | src/main/java/com/google/devtools/build/lib/runtime/commands/CqueryCommand.java:183-190 | src/main/java/com/google/devtools/build/lib/runtime/commands/TestCommand.java:156-163 — before extracting anything, compare `src/main/java/com/google/devtools/build/lib/runtime/commands/AqueryCommand.java` and `src/main/java/com/google/devtools/build/lib/runtime/commands/CqueryCommand.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (6–7 lines × 2) · ×1
  • Duplicated block (6–7 lines × 2) src/main/java/com/google/devtools/build/lib/runtime/CommandLineEvent.java:333 — src/main/java/com/google/devtools/build/lib/runtime/CommandLineEvent.java:333-339 | src/main/java/com/google/devtools/build/lib/runtime/CommandLineEvent.java:456-461 — 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 `src/main/java/com/google/devtools/build/lib/runtime/CommandLineEvent.java:333` 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. 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.
D4 · Code Duplication · Duplicated block (4–5 lines × 3) · ×1
  • Duplicated block (4–5 lines × 3) src/main/java/com/google/devtools/build/lib/runtime/UiStateTracker.java:570 — src/main/java/com/google/devtools/build/lib/runtime/UiStateTracker.java:570-574 | src/main/java/com/google/devtools/build/lib/runtime/UiStateTracker.java:652-656 | src/main/java/com/google/devtools/build/lib/runtime/UiStateTracker.java:822-825 — all 3 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 `src/main/java/com/google/devtools/build/lib/runtime/UiStateTracker.java:570` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (82 lines × 2) · ×1
  • Duplicated block (82 lines × 2) src/main/java/com/google/devtools/build/lib/io/FileSymlinkCycleUniquenessFunction.java:1 — src/main/java/com/google/devtools/build/lib/io/FileSymlinkCycleUniquenessFunction.java:1-82 | src/main/java/com/google/devtools/build/lib/io/FileSymlinkInfiniteExpansionUniquenessFunction.java:1-83 — 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 `src/main/java/com/google/devtools/build/lib/io/FileSymlinkCycleUniquenessFunction.java:1` 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. 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 (54 lines × 3) · ×1
  • Duplicated block (54 lines × 3) src/main/java/com/google/devtools/build/lib/starlarkbuildapi/java/JavaCommonApi.java:65 — src/main/java/com/google/devtools/build/lib/starlarkbuildapi/java/JavaCommonApi.java:65-626 | src/main/java/com/google/devtools/build/lib/starlarkbuildapi/objc/AppleCommonApi.java:43-144 | src/main/java/com/google/devtools/build/lib/starlarkbuildapi/objc/ObjcProviderApi.java:41-94 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 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 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `src/main/java/com/google/devtools/build/lib/starlarkbuildapi/java/JavaCommonApi.java:65` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (54 lines × 2) · ×1
  • Duplicated block (54 lines × 2) src/main/java/com/google/devtools/build/lib/starlarkbuildapi/java/JavaCommonApi.java:65 — src/main/java/com/google/devtools/build/lib/starlarkbuildapi/java/JavaCommonApi.java:65-626 | src/main/java/com/google/devtools/build/lib/starlarkbuildapi/objc/ObjcProviderApi.java:41-94 — 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 `src/main/java/com/google/devtools/build/lib/starlarkbuildapi/java/JavaCommonApi.java:65` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (6 lines × 5) · ×1
  • Duplicated block (6 lines × 5) src/main/java/com/google/devtools/build/lib/analysis/RequiredConfigFragmentsProvider.java:52 — src/main/java/com/google/devtools/build/lib/analysis/RequiredConfigFragmentsProvider.java:52-57 | src/main/java/com/google/devtools/build/lib/analysis/RuleDefinition.java:70-75 | src/main/java/com/google/devtools/build/lib/bazel/bzlmod/BazelModTidyValue.java:44-49 | src/main/java/com/google/devtools/build/lib/bazel/bzlmod/SingleVersionOverride.java:48-53 | src/main/java/com/google/devtools/build/lib/rules/java/JavaToolchainProvider.java:274-279 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 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 5 times.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×1
  • Duplicated block (8 lines × 4) src/main/java/com/google/devtools/build/lib/analysis/platform/DeclaredToolchainInfo.java:55 — src/main/java/com/google/devtools/build/lib/analysis/platform/DeclaredToolchainInfo.java:55-62 | src/main/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleExtension.java:48-55 | src/main/java/com/google/devtools/build/lib/packages/producers/GlobComputationProducer.java:165-172 | src/main/java/com/google/devtools/build/lib/shell/CommandResult.java:48-55 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 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 4 times.
D4 · Code Duplication · Duplicated block (6 lines × 6) · ×1
  • Duplicated block (6 lines × 6) src/main/java/com/google/devtools/build/lib/collect/compacthashset/CompactHashSetCodec.java:35 — src/main/java/com/google/devtools/build/lib/collect/compacthashset/CompactHashSetCodec.java:35-40 | src/main/java/com/google/devtools/build/lib/skyframe/serialization/ArrayListCodec.java:44-49 | src/main/java/com/google/devtools/build/lib/skyframe/serialization/HashSetCodec.java:44-49 | src/main/java/com/google/devtools/build/lib/skyframe/serialization/ImmutableListCodec.java:65-70 | src/main/java/com/google/devtools/build/lib/skyframe/serialization/ImmutableSetCodec.java:68-73 | src/main/java/com/google/devtools/build/lib/skyframe/serialization/TransformingRandomAccessListCodec.java:44-49 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 6 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 6 times. Note first that the copies are not typed on the same thing: the declarations holding them bind `obj` to `CompactHashSet` in one and `HashSet` 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.
D5 · Coupling · Unstable project //src/main/cpp · ×1
  • Unstable project //src/main/cpp:rc_file — //src/main/cpp:rc_file has instability 0.86 with 1 dependents.
P3 · Security & performance tooling · SAST runs, but gates no merge · ×1
  • SAST runs, but gates no merge — `scorecard.yml` run(s) a static-analysis scan, but no workflow that runs one is triggered by a pull request (or a merge queue, or an unfiltered push) — the scan fires on a schedule or a manual dispatch only. A vulnerable change therefore merges clean and is reported on the next scheduled run, by which time it is on the default branch and the only remedy is a follow-up fix. Add the pull-request trigger to the workflow that runs the scan so the finding arrives before the merge rather than after it.
P4 · Deployment & Rollback · No deployment automation · ×1
  • No deployment automation — No release automation was found in CI — neither a deploy stage (Helm/Kubernetes/compose manifests, an orchestrated rollout) nor a publish job that ships the built artifact. Releases appear to be run by hand, which is slower, less repeatable and harder to reverse.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×1
  • Swallowed exception (caught, then discarded) src/main/java/com/google/devtools/build/lib/collect/nestedset/NestedSet.java:500 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Minor — 326 finding(s)
D34 · Knowledge Freshness · Orphaned file · ×174
  • Orphaned file src/main/java/com/google/devtools/build/lib/skyframe/PackageFunctionWithMultipleGlobDeps.java: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 src/main/java/com/google/devtools/build/lib/bazel/bzlmod/modcommand/ModuleArg.java: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 src/main/java/com/google/devtools/build/lib/skyframe/RecursivePackageProviderBackedTargetPatternResolver.java: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 src/main/java/com/google/devtools/build/lib/query2/RBuildFilesVisitor.java: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 src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfPatternFunction.java: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 src/main/java/com/google/devtools/build/lib/packages/GlobCache.java: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 src/main/java/com/google/devtools/build/lib/packages/AspectsList.java: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 src/main/java/com/google/devtools/build/lib/packages/RequiredProviders.java: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 src/main/java/com/google/devtools/build/lib/exec/local/XcodeLocalEnvProvider.java: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 src/main/java/com/google/devtools/build/lib/analysis/PrerequisitesCollection.java: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 src/main/java/com/google/devtools/build/lib/skyframe/EnvironmentBackedRecursivePackageProvider.java: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 src/main/java/com/google/devtools/build/lib/sandbox/LinuxSandboxCommandLineBuilder.java: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 src/main/java/com/google/devtools/build/lib/rules/config/ConfigFeatureFlag.java: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 src/main/java/com/google/devtools/build/lib/actions/ActionResult.java: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 src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkLateBoundDefault.java: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 src/main/java/com/google/devtools/build/lib/skyframe/RecursiveDirectoryTraversalFunction.java: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 src/main/java/com/google/devtools/build/lib/skyframe/GlobsFunction.java: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 src/main/java/com/google/devtools/build/lib/packages/AspectPropagationEdgesSupplier.java: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 src/main/java/com/google/devtools/build/lib/shell/Consumers.java: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 src/main/java/com/google/devtools/build/lib/rules/cpp/Link.java: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 src/main/java/com/google/devtools/build/lib/analysis/actions/BuildInfoFileWriteAction.java: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 src/main/java/com/google/devtools/build/lib/packages/producers/PatternWithWildcardProducer.java: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 src/main/java/com/google/devtools/build/lib/dynamic/LocalBranch.java: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 src/main/java/com/google/devtools/build/lib/rules/java/JavaOutput.java: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 src/main/java/com/google/devtools/build/lib/util/ShellEscaper.java: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.
  • + 149 more in this group — see findings.md.
M4 · Documentation accuracy · README/code drift · ×40
  • README/code drift docs/help.mdx:45 — docs/help.mdx links to `/community/experts`, but `community/experts` does not exist. 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.
  • README/code drift docs/help.mdx:49 — docs/help.mdx links to `/release`, but `release` does not exist. 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.
  • README/code drift docs/about/faq.mdx:7 — docs/about/faq.mdx links to `/help`, but `help` does not exist. 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.
  • README/code drift docs/about/faq.mdx:17 — docs/about/faq.mdx links to `/reference/be/overview`, but `reference/be/overview` does not exist. 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.
  • README/code drift docs/about/faq.mdx:45 — docs/about/faq.mdx links to `/remote/rbe`, but `remote/rbe` does not exist. 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.
  • README/code drift docs/about/faq.mdx:45 — docs/about/faq.mdx links to `/remote/caching`, but `remote/caching` does not exist. 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.
  • README/code drift docs/about/faq.mdx:111 — docs/about/faq.mdx links to `/start/`, but `start` does not exist. 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.
  • README/code drift docs/about/faq.mdx:142 — docs/about/faq.mdx links to `/release/`, but `release` does not exist. 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.
  • README/code drift docs/about/faq.mdx:158 — docs/about/faq.mdx links to `/run/scripts#exit-codes`, but `run/scripts` does not exist. 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.
  • README/code drift docs/about/faq.mdx:164 — docs/about/faq.mdx links to `/extending/concepts`, but `extending/concepts` does not exist. 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.
  • README/code drift docs/about/faq.mdx:168 — docs/about/faq.mdx links to `/contribute/`, but `contribute` does not exist. 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.
  • README/code drift docs/about/intro.mdx:37 — docs/about/intro.mdx links to `/rules`, but `rules` does not exist. 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.
  • README/code drift docs/about/intro.mdx:45 — docs/about/intro.mdx links to `/install`, but `install` does not exist. 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.
  • README/code drift docs/about/intro.mdx:47 — docs/about/intro.mdx links to `/concepts/build-ref#workspaces`, but `concepts/build-ref` does not exist. 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.
  • README/code drift docs/about/intro.mdx:67 — docs/about/intro.mdx links to `/reference/command-line-reference`, but `reference/command-line-reference` does not exist. 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.
  • README/code drift docs/about/intro.mdx:71 — docs/about/intro.mdx links to `/reference/test-encyclopedia`, but `reference/test-encyclopedia` does not exist. 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.
  • README/code drift docs/about/intro.mdx:71 — docs/about/intro.mdx links to `/query/guide`, but `query/guide` does not exist. 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.
  • README/code drift docs/about/intro.mdx:81 — docs/about/intro.mdx links to `/concepts/dependencies`, but `concepts/dependencies` does not exist. 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.
  • README/code drift docs/about/intro.mdx:82 — docs/about/intro.mdx links to `/extending/concepts#evaluation-model`, but `extending/concepts` does not exist. 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.
  • README/code drift docs/about/intro.mdx:91 — docs/about/intro.mdx links to `/basics/hermeticity`, but `basics/hermeticity` does not exist. 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.
  • README/code drift docs/about/intro.mdx:105 — docs/about/intro.mdx links to `/start/`, but `start` does not exist. 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.
  • README/code drift docs/about/intro.mdx:108 — docs/about/intro.mdx links to `/start/cpp`, but `start/cpp` does not exist. 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.
  • README/code drift docs/about/intro.mdx:109 — docs/about/intro.mdx links to `/start/java`, but `start/java` does not exist. 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.
  • README/code drift docs/about/intro.mdx:110 — docs/about/intro.mdx links to `/start/android-app`, but `start/android-app` does not exist. 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.
  • README/code drift docs/about/intro.mdx:111 — docs/about/intro.mdx links to `/start/ios-app`, but `start/ios-app` does not exist. 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.
  • + 15 more in this group — see findings.md.
IC1 · Incompleteness & stubs · Disabled test · ×36
  • Disabled test src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/MainTest.java:33 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/internal/junit4/JUnit4TestXmlListenerTest.java:268 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4/JUnit4TestModelBuilderTest.java:172 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test src/test/java/com/google/devtools/build/lib/analysis/BuildViewTest.java:553 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test src/test/java/com/google/devtools/build/lib/analysis/producers/BuildConfigurationKeyMapProducerTest.java:246 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test src/test/java/com/google/devtools/build/lib/analysis/producers/BuildConfigurationKeyProducerTest.java:397 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test src/test/java/com/google/devtools/build/lib/bazel/bzlmod/DiscoveryTest.java:676 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test src/test/java/com/google/devtools/build/lib/bazel/bzlmod/DiscoveryTest.java:725 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test src/test/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleFileFunctionTest.java:794 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test src/test/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleFileFunctionTest.java:1003 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test src/test/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleFileFunctionTest.java:1853 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test src/test/java/com/google/devtools/build/lib/bazel/repository/downloader/HttpConnectorTest.java:303 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test src/test/java/com/google/devtools/build/lib/bazel/repository/downloader/HttpDownloaderTest.java:411 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test src/test/java/com/google/devtools/build/lib/bazel/repository/downloader/HttpDownloaderTest.java:480 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test src/test/java/com/google/devtools/build/lib/buildeventservice/BazelBuildEventServiceModuleTest.java:629 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test src/test/java/com/google/devtools/build/lib/buildeventservice/BazelBuildEventServiceModuleTest.java:655 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test src/test/java/com/google/devtools/build/lib/rules/cpp/CcCommonTest.java:362 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test src/test/java/com/google/devtools/build/lib/rules/cpp/CcCommonTest.java:378 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test src/test/java/com/google/devtools/build/lib/rules/cpp/CcCommonTest.java:622 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test src/test/java/com/google/devtools/build/lib/rules/java/proto/StarlarkJavaLiteProtoLibraryTest.java:114 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test src/test/java/com/google/devtools/build/lib/rules/java/proto/StarlarkJavaLiteProtoLibraryTest.java:325 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test src/test/java/com/google/devtools/build/lib/rules/java/proto/StarlarkJavaLiteProtoLibraryTest.java:539 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test src/test/java/com/google/devtools/build/lib/rules/java/proto/StarlarkJavaLiteProtoLibraryTest.java:589 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test src/test/java/com/google/devtools/build/lib/runtime/BuildEventStreamerTest.java:566 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test src/test/java/com/google/devtools/build/lib/runtime/SynchronizedOutputStreamTest.java:106 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • + 11 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×25
  • Duplicated predicate src/main/java/com/google/devtools/build/lib/analysis/TargetCompleteEvent.java:245 — `!artifact.isSourceArtifact() && !artifact.isRunfilesTree()` appears character-identically in 2 files — src/main/java/com/google/devtools/build/lib/analysis/TargetCompleteEvent.java, src/main/java/com/google/devtools/build/lib/analysis/TopLevelArtifactHelper.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 src/main/java/com/google/devtools/build/lib/analysis/BuildView.java:562 — `!bzlFileLoadLikeString.startsWith("//") && !bzlFileLoadLikeString.startsWith("@")` appears character-identically in 2 files — src/main/java/com/google/devtools/build/lib/analysis/BuildView.java, src/main/java/com/google/devtools/build/lib/packages/StarlarkAspectClass.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 src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnCache.java:87 — `!context.bustCaches() && remoteExecutionService.getReadCachePolicy(spawn).allowAnyCache()` appears character-identically in 2 files — src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnCache.java, src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.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 src/main/java/com/google/devtools/build/lib/runtime/GcChurningDetector.java:94 — `!event.wasFullGc() || event.wasManualGc()` appears character-identically in 2 files — src/main/java/com/google/devtools/build/lib/runtime/GcChurningDetector.java, src/main/java/com/google/devtools/build/lib/runtime/GcThrashingDetector.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 src/main/java/com/google/devtools/build/lib/shell/Command.java:199 — `!executable.isAbsolute() && executable.getParent() != null` appears character-identically in 3 files — src/main/java/com/google/devtools/build/lib/shell/Command.java, src/main/java/com/google/devtools/build/lib/worker/SingleplexWorker.java, src/main/java/com/google/devtools/build/lib/worker/WorkerMultiplexer.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 src/main/java/com/google/devtools/build/lib/skyframe/IgnoredSubdirectoriesFunction.java:208 — `!line.isEmpty() && !line.startsWith("#")` appears character-identically in 2 files — src/main/java/com/google/devtools/build/lib/skyframe/IgnoredSubdirectoriesFunction.java, src/main/java/com/google/devtools/build/lib/skyframe/config/PlatformMappingFunction.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 src/main/java/com/google/devtools/build/lib/exec/CompactSpawnLogContext.java:265 — `!output.isDirectory() && !output.isSymlink() && path.isFile()` appears character-identically in 2 files — src/main/java/com/google/devtools/build/lib/exec/CompactSpawnLogContext.java, src/main/java/com/google/devtools/build/lib/exec/ExpandedSpawnLogContext.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 src/main/java/com/google/devtools/build/lib/actions/cache/ActionCache.java:423 — `!output.isTreeArtifact() && !output.isChildOfDeclaredDirectory()` appears character-identically in 2 files — src/main/java/com/google/devtools/build/lib/actions/cache/ActionCache.java, src/main/java/com/google/devtools/build/lib/skyframe/ActionOutputMetadataStore.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 src/main/java/com/google/devtools/build/skyframe/ParallelEvaluator.java:469 — `!skyFunctionName.startsWith("FILE") && !skyFunctionName.startsWith("DIRECTORY_LISTING")` appears character-identically in 2 files — src/main/java/com/google/devtools/build/skyframe/ParallelEvaluator.java, src/main/java/com/google/devtools/build/skyframe/SkyFunctionEnvironment.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 src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttributeTransitionProvider.java:185 — `Objects.equals(attrObject, other.attrObject) && super.equals(other)` appears character-identically in 2 files — src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttributeTransitionProvider.java, src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleTransitionProvider.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 src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredExecutionPlatformsValue.java:97 — `Objects.equals(this.configurationKey, that.configurationKey) && this.debug == that.debug` appears character-identically in 2 files — src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredExecutionPlatformsValue.java, src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredToolchainsValue.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 src/main/java/com/google/devtools/build/lib/query2/query/BlazeQueryEnvironment.java:412 — `QueryEnvironment.shouldVisit(maxDepth, MAX_DEPTH_FULL_SCAN_LIMIT) && queryTransitivePackagePreloader != null` appears character-identically in 2 files — src/main/java/com/google/devtools/build/lib/query2/query/BlazeQueryEnvironment.java, src/main/java/com/google/devtools/build/lib/query2/query/GraphlessBlazeQueryEnvironment.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 src/main/java/com/google/devtools/build/lib/actions/ActionExecutedEvent.java:215 — `action.getOwner() != null && action.getOwner().getLabel() != null` appears character-identically in 2 files — src/main/java/com/google/devtools/build/lib/actions/ActionExecutedEvent.java, src/main/java/com/google/devtools/build/lib/dynamic/DynamicSpawnStrategy.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 src/main/java/com/google/devtools/build/lib/remote/RemoteExecutionService.java:595 — `actionMetadata != null && actionMetadata.getOwner().getLabel() != null` appears character-identically in 2 files — src/main/java/com/google/devtools/build/lib/remote/RemoteExecutionService.java, src/main/java/com/google/devtools/build/lib/remote/merkletree/MerkleTreeComputer.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 src/main/java/com/google/devtools/build/lib/runtime/AggregatingTestListener.java:182 — `actualTargets == null || successfulTargets == null` appears character-identically in 2 files — src/main/java/com/google/devtools/build/lib/runtime/AggregatingTestListener.java, src/main/java/com/google/devtools/build/lib/runtime/TargetSummaryPublisher.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 src/main/java/com/google/devtools/build/lib/rules/genquery/GenQueryPackageProviderFactory.java:402 — `advertisedProviderSet != null && AspectDefinition.satisfies(aspect, advertisedProviderSet)` appears character-identically in 2 files — src/main/java/com/google/devtools/build/lib/rules/genquery/GenQueryPackageProviderFactory.java, src/main/java/com/google/devtools/build/lib/skyframe/TransitiveBaseTraversalFunction.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 src/java_tools/buildjar/java/com/google/devtools/build/buildjar/BazelJavaBuilder.java:48 — `args.length == 1 && args[0].equals("--persistent_worker")` appears character-identically in 2 files — src/java_tools/buildjar/java/com/google/devtools/build/buildjar/BazelJavaBuilder.java, src/java_tools/buildjar/java/com/google/devtools/build/buildjar/VanillaJavaBuilder.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 src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttrModule.java:243 — `attribute.getType().getLabelClass() == LabelClass.DEPENDENCY && !attribute.isForDependencyResolution()` appears character-identically in 2 files — src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttrModule.java, src/main/java/com/google/devtools/build/lib/packages/RuleClass.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 src/main/java/com/google/devtools/build/lib/vfs/FileSystemUtils.java:63 — `baseName.equals(".") || baseName.equals("..")` appears character-identically in 2 files — src/main/java/com/google/devtools/build/lib/vfs/FileSystemUtils.java, src/main/java/com/google/devtools/build/lib/vfs/PathFragment.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 src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java:399 — `bepOptions != null && bepOptions.getStreamingLogFileUploads()` appears character-identically in 2 files — src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java, src/main/java/com/google/devtools/build/lib/runtime/ThreadDumpModule.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 src/main/java/net/starlark/java/syntax/TypeTable.java:133 — `binding.getScope() == Resolver.Scope.GLOBAL || binding.isToplevelLocal()` appears character-identically in 2 files — src/main/java/net/starlark/java/syntax/TypeTable.java, src/main/java/net/starlark/java/syntax/TypeTagger.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 src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java:687 — `buildRequestOptions != null && buildRequestOptions.getRewindLostInputs()` appears character-identically in 2 files — src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java, src/main/java/com/google/devtools/build/lib/skyframe/SequencedSkyframeExecutor.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 src/main/java/com/google/devtools/build/lib/dynamic/DynamicExecutionModule.java:80 — `buildRequestOptions != null && buildRequestOptions.getUseAsyncExecution()` appears character-identically in 2 files — src/main/java/com/google/devtools/build/lib/dynamic/DynamicExecutionModule.java, src/main/java/com/google/devtools/build/lib/runtime/QuiescingExecutorsImpl.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 src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileAction.java:361 — `classpathMode == JavaClasspathMode.BAZEL || classpathMode == JavaClasspathMode.BAZEL_NO_FALLBACK` appears character-identically in 2 files — src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileAction.java, src/main/java/com/google/devtools/build/lib/rules/java/JavaHeaderCompileAction.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 src/java_tools/singlejar/java/com/google/devtools/build/zip/CentralDirectoryFileHeader.java:77 — `comment.length > 0 && ZipUtil.readFully(in, comment) != comment.length` appears character-identically in 2 files — src/java_tools/singlejar/java/com/google/devtools/build/zip/CentralDirectoryFileHeader.java, src/java_tools/singlejar/java/com/google/devtools/build/zip/EndOfCentralDirectoryRecord.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.
AX6 · Interface segregation · Fat interface · ×20
  • Fat interface: VerificationTypeVisitor (27 abstract methods) third_party/java/proguard/proguard6.2.2/src/proguard/classfile/attribute/preverification/visitor/VerificationTypeVisitor.java:34 — `VerificationTypeVisitor` declares 27 abstract methods: `visitDoubleType`, `visitFloatType`, `visitIntegerType`, `visitLongType`, `visitNullType`, `visitObjectType`, `visitStackDoubleType`, `visitStackFloatType`, `visitStackIntegerType`, `visitStackLongType`, `visitStackNullType`, `visitStackObjectType`, `visitStackTopType`, `visitStackUninitializedThisType`, `visitStackUninitializedType`, `visitTopType`, `visitUninitializedThisType`, `visitUninitializedType`, `visitVariablesDoubleType`, `visitVariablesFloatType`, `visitVariablesIntegerType`, `visitVariablesLongType`, `visitVariablesNullType`, `visitVariablesObjectType`, `visitVariablesTopType`, `visitVariablesUninitializedThisType`, `visitVariablesUninitializedType`. 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.
  • Fat interface: AttributeVisitor (46 abstract methods) third_party/java/proguard/proguard6.2.2/src/proguard/classfile/attribute/visitor/AttributeVisitor.java:35 — `AttributeVisitor` declares 46 abstract methods: `visitAnnotationDefaultAttribute`, `visitBootstrapMethodsAttribute`, `visitCodeAttribute`, `visitConstantValueAttribute`, `visitDeprecatedAttribute`, `visitDeprecatedAttribute`, `visitDeprecatedAttribute`, `visitEnclosingMethodAttribute`, `visitExceptionsAttribute`, `visitInnerClassesAttribute`, `visitLineNumberTableAttribute`, `visitLocalVariableTableAttribute`, `visitLocalVariableTypeTableAttribute`, `visitMethodParametersAttribute`, `visitModuleAttribute`, `visitModuleMainClassAttribute`, `visitModulePackagesAttribute`, `visitNestHostAttribute`, `visitNestMembersAttribute`, `visitRuntimeInvisibleAnnotationsAttribute`, `visitRuntimeInvisibleAnnotationsAttribute`, `visitRuntimeInvisibleAnnotationsAttribute`, `visitRuntimeInvisibleParameterAnnotationsAttribute`, `visitRuntimeInvisibleTypeAnnotationsAttribute`, `visitRuntimeInvisibleTypeAnnotationsAttribute`, `visitRuntimeInvisibleTypeAnnotationsAttribute`, `visitRuntimeInvisibleTypeAnnotationsAttribute`, `visitRuntimeVisibleAnnotationsAttribute`, `visitRuntimeVisibleAnnotationsAttribute`, `visitRuntimeVisibleAnnotationsAttribute`, `visitRuntimeVisibleParameterAnnotationsAttribute`, `visitRuntimeVisibleTypeAnnotationsAttribute`, `visitRuntimeVisibleTypeAnnotationsAttribute`, `visitRuntimeVisibleTypeAnnotationsAttribute`, `visitRuntimeVisibleTypeAnnotationsAttribute`, `visitSignatureAttribute`, `visitSignatureAttribute`, `visitSignatureAttribute`, `visitSourceDirAttribute`, `visitSourceFileAttribute`, and 6 more. 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 46 declarations carry 30 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 30 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: ConstantVisitor (18 abstract methods) third_party/java/proguard/proguard6.2.2/src/proguard/classfile/constant/visitor/ConstantVisitor.java:33 — `ConstantVisitor` declares 18 abstract methods: `visitClassConstant`, `visitDoubleConstant`, `visitDynamicConstant`, `visitFieldrefConstant`, `visitFloatConstant`, `visitIntegerConstant`, `visitInterfaceMethodrefConstant`, `visitInvokeDynamicConstant`, `visitLongConstant`, `visitMethodHandleConstant`, `visitMethodTypeConstant`, `visitMethodrefConstant`, `visitModuleConstant`, `visitNameAndTypeConstant`, `visitPackageConstant`, `visitPrimitiveArrayConstant`, `visitStringConstant`, `visitUtf8Constant`. 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.
  • Fat interface: Clazz (38 abstract methods) third_party/java/proguard/proguard6.2.2/src/proguard/classfile/Clazz.java:33 — `Clazz` declares 38 abstract methods: `accept`, `addSubClass`, `attributeAccept`, `attributesAccept`, `constantPoolEntriesAccept`, `constantPoolEntryAccept`, `extendsOrImplements`, `extendsOrImplements`, `extends_`, `extends_`, `fieldAccept`, `fieldsAccept`, `findField`, `findMethod`, `getAccessFlags`, `getClassName`, `getInterface`, `getInterfaceCount`, `getInterfaceName`, `getName`, `getName`, `getRefClassName`, `getRefName`, `getRefType`, `getString`, `getStringString`, `getSuperClass`, `getSuperName`, `getTag`, `getType`, `hierarchyAccept`, `interfaceConstantsAccept`, `mayHaveImplementations`, `methodAccept`, `methodsAccept`, `subclassesAccept`, `superClassConstantAccept`, `thisClassConstantAccept`. 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 38 declarations carry 35 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 35 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: NodeEntry (38 abstract methods) src/main/java/com/google/devtools/build/skyframe/NodeEntry.java:34 — `NodeEntry` declares 38 abstract methods: `addExternalDep`, `addReverseDepAndCheckIfDone`, `addSingletonTemporaryDirectDep`, `addTemporaryDirectDepGroup`, `addTemporaryDirectDepsInGroups`, `checkIfDoneForDirtyReverseDep`, `forceRebuild`, `getAllDirectDepsForIncompleteNode`, `getAllRemainingDirtyDirectDeps`, `getAllReverseDepsForNodeBeingDeleted`, `getDirectDeps`, `getErrorInfo`, `getInProgressReverseDeps`, `getLifecycleState`, `getNextDirtyDirectDeps`, `getResetDirectDeps`, `getReverseDepsForDoneEntry`, `getTemporaryDirectDeps`, `getValue`, `getValueMaybeWithMetadata`, `getVersion`, `hasAtLeastOneDep`, `hasUnsignaledDeps`, `isChanged`, `isDirty`, `isDone`, `isReadyToEvaluate`, `markClean`, `markDirty`, `markRebuilding`, `noDepsLastBuild`, `removeReverseDep`, `removeReverseDepsFromDoneEntryDueToDeletion`, `removeUnfinishedDeps`, `resetEvaluationFromScratch`, `setValue`, `signalDep`, `toValue`. 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.
  • Fat interface: MemoizingEvaluator (19 abstract methods) src/main/java/com/google/devtools/build/skyframe/MemoizingEvaluator.java:37 — `MemoizingEvaluator` declares 19 abstract methods: `cleanupInterningPools`, `delete`, `deleteDirty`, `dumpCount`, `dumpDeps`, `dumpFunctionGraph`, `dumpKeys`, `dumpRdeps`, `dumpSummary`, `dumpValues`, `evaluate`, `getDoneValues`, `getExistingEntryAtCurrentlyEvaluatingVersion`, `getExistingErrorForTesting`, `getExistingValue`, `getInMemoryGraph`, `getValues`, `injectGraphTransformerForTesting`, `isRewinding`. 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.
  • Fat interface: JavaInfoApi<FileT, JavaOutputT, JavaPluginDataT> (17 abstract methods) src/main/java/com/google/devtools/build/lib/starlarkbuildapi/java/JavaInfoApi.java:34 — `JavaInfoApi<FileT, JavaOutputT, JavaPluginDataT>` declares 17 abstract methods: `getCompilationInfoProvider`, `getCompileTimeJars`, `getCompileTimeJavaDependencies`, `getFullCompileTimeJars`, `getGenJarsProvider`, `getJavaConstraintsStarlark`, `getJavaModuleFlagsInfo`, `getOutputJars`, `getRuntimeOutputJars`, `getSourceJars`, `getTransitiveCompileTimeJars`, `getTransitiveFullCompileJars`, `getTransitiveNativeLibrariesForStarlark`, `getTransitiveRuntimeJars`, `getTransitiveSourceJars`, `headerCompilationDirectDeps`, `isNeverlink`. 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.
  • Fat interface: JavaConfigurationApi (21 abstract methods) src/main/java/com/google/devtools/build/lib/starlarkbuildapi/java/JavaConfigurationApi.java:32 — `JavaConfigurationApi` declares 21 abstract methods: `autoCreateJavaTestDeployJars`, `bytecodeOptimizationPassActions`, `enforceOneVersionOnJavaTests`, `enforceProguardFileExtension`, `explicitJavaTestDepsStarlark`, `getBytecodeOptimizerMnemonic`, `getDefaultJavacFlagsForStarlarkAsList`, `getDefaultJavacFlagsStarlark`, `getDefaultJvmFlags`, `getDisallowJavaImportExportsInStarlark`, `getGenerateJavaDepsStarlark`, `getPlugins`, `getReduceJavaClasspathStarlark`, `getStrictJavaDepsName`, `getUseHeaderCompilationDirectDepsInStarlark`, `getUseIjarsInStarlark`, `multiReleaseDeployJars`, `runAndroidLint`, `splitBytecodeOptimizationPass`, `starlarkOneVersionEnforcementLevel`, `useHeaderCompilationStarlark`. 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.
  • Fat interface: CppConfigurationApi<InvalidConfigurationExceptionT> (24 abstract methods) src/main/java/com/google/devtools/build/lib/starlarkbuildapi/cpp/CppConfigurationApi.java:33 — `CppConfigurationApi<InvalidConfigurationExceptionT>` declares 24 abstract methods: `appleGenerateDsym`, `buildTestDwpIsActivatedStarlark`, `csFdoInstrumentStarlark`, `customMalloc`, `disableNocoptsStarlark`, `fdoInstrumentStarlark`, `fissionActiveForCurrentCompilationModeStarlark`, `forcePicStarlark`, `generateLlvmLcovStarlark`, `getConlyopts`, `getCopts`, `getCxxopts`, `getExperimentalLinkStaticLibrariesOnce`, `getLibcTopLabelStarlark`, `getLinkopts`, `getObjcopts`, `getSaveTempsForStarlark`, `getStripOptsStarlark`, `objcGenerateLinkmap`, `objcShouldStripBinary`, `processHeadersInDependenciesStarlark`, `saveFeatureStateStarlark`, `shareNativeDepsStarlark`, `shouldStripBinariesForStarlark`. 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.
  • Fat interface: CcCompilationContextApi<FileT> (25 abstract methods) src/main/java/com/google/devtools/build/lib/starlarkbuildapi/cpp/CcCompilationContextApi.java:35 — `CcCompilationContextApi<FileT>` declares 25 abstract methods: `getDirectModuleMapsForStarlark`, `getHeaderInfo`, `getNonCodeInputsForStarlark`, `getStarlarkDefines`, `getStarlarkDirectModularHeaders`, `getStarlarkDirectPrivateHeaders`, `getStarlarkDirectPublicHeaders`, `getStarlarkDirectTextualHeaders`, `getStarlarkExportingModuleMaps`, `getStarlarkExternalIncludeDirs`, `getStarlarkFrameworkIncludeDirs`, `getStarlarkHeaders`, `getStarlarkIncludeDirs`, `getStarlarkModuleFiles`, `getStarlarkModuleMap`, `getStarlarkModulesInfoFiles`, `getStarlarkNonTransitiveDefines`, `getStarlarkPicModuleFiles`, `getStarlarkPicModulesInfoFiles`, `getStarlarkQuoteIncludeDirs`, `getStarlarkSystemIncludeDirs`, `getStarlarkTransitiveModules`, `getStarlarkTransitivePicModules`, `getStarlarkValidationArtifacts`, `getStarlarkVirtualToOriginalHeaders`. 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.
  • Fat interface: AndroidConfigurationApi (20 abstract methods) src/main/java/com/google/devtools/build/lib/starlarkbuildapi/android/AndroidConfigurationApi.java:32 — `AndroidConfigurationApi` declares 20 abstract methods: `apkSigningMethodV1`, `apkSigningMethodV2`, `apkSigningMethodV4`, `compressJavaResources`, `desugarJava8`, `desugarJava8Libs`, `fixedResourceNeverlinking`, `getDexoptsSupportedInDexSharder`, `getExportsManifestDefault`, `getJavaResourcesFromOptimizedJar`, `getOutputDirectoryName`, `incrementalDexingShardsAfterProguard`, `persistentBusyboxTools`, `persistentDexDesugar`, `persistentMultiplexBusyboxTools`, `persistentMultiplexDexDesugar`, `useAndroidResourceCycleShrinking`, `useAndroidResourceNameObfuscation`, `useAndroidResourcePathShortening`, `useAndroidResourceShrinking`. 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.
  • Fat interface: StarlarkRuleContextApi<ConstraintValueT> (36 abstract methods) src/main/java/com/google/devtools/build/lib/starlarkbuildapi/StarlarkRuleContextApi.java:58 — `StarlarkRuleContextApi<ConstraintValueT>` declares 36 abstract methods: `actions`, `aspectIds`, `callParent`, `checkPlaceholders`, `createdActions`, `execGroups`, `expandLocation`, `expandMakeVariables`, `getAttr`, `getBinDirectory`, `getBuildFileRelativePath`, `getBuildSettingValue`, `getConfiguration`, `getDisabledFeatures`, `getExecutable`, `getFeatures`, `getFile`, `getFiles`, `getFragments`, `getGenfilesDirectory`, `getLabel`, `getSplitAttr`, `getStableWorkspaceStatus`, `getVolatileWorkspaceStatus`, `getWorkspaceName`, `instrumentCoverage`, `outputs`, `packageRelativeLabel`, `resolveCommand`, `resolveTools`, `rule`, `runfiles`, `targetPlatformHasConstraint`, `tokenize`, `toolchains`, `var`. 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.
  • Fat interface: StarlarkAttrModuleApi (17 abstract methods) src/main/java/com/google/devtools/build/lib/starlarkbuildapi/StarlarkAttrModuleApi.java:57 — `StarlarkAttrModuleApi` declares 17 abstract methods: `boolAttribute`, `dormantLabelAttribute`, `dormantLabelListAttribute`, `intAttribute`, `intListAttribute`, `labelAttribute`, `labelKeyedStringDictAttribute`, `labelListAttribute`, `labelListDictAttribute`, `licenseAttribute`, `outputAttribute`, `outputListAttribute`, `stringAttribute`, `stringDictAttribute`, `stringKeyedLabelDictAttribute`, `stringListAttribute`, `stringListDictAttribute`. 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.
  • Fat interface: QueryEnvironment<T> (30 abstract methods) src/main/java/com/google/devtools/build/lib/query2/engine/QueryEnvironment.java:47 — `QueryEnvironment<T>` declares 30 abstract methods: `buildTransitiveClosure`, `createEvaluateExpression`, `createMinDepthUniquifier`, `createThreadSafeMutableSet`, `createUniquifier`, `eval`, `execute`, `executeAsync`, `getAccessor`, `getFunctions`, `getFwdDeps`, `getLabelPrinter`, `getNodesOnPath`, `getOrCreate`, `getReverseDeps`, `getSiblingTargetsInPackage`, `getTargetsMatchingPattern`, `getTransitiveClosure`, `getTransitiveLoadFilesHelper`, `handleError`, `immediateCancelledFuture`, `immediateFailedFuture`, `immediateSuccessfulFuture`, `isSettingEnabled`, `transformAsync`, `transitiveLoadFiles`, `whenAllSucceed`, `whenAllSucceedCall`, `whenSucceedsCall`, `whenSucceedsOrIsCancelledCall`. 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.
  • Fat interface: TraceProfilerService (28 abstract methods) src/main/java/com/google/devtools/build/lib/profiler/TraceProfilerService.java:51 — `TraceProfilerService` declares 28 abstract methods: `clear`, `completeTask`, `createTimeSeries`, `getProfileElapsedTime`, `getServerProcessCpuTime`, `getSlowestTasks`, `getTasksHistograms`, `isActive`, `isProfiling`, `logCounters`, `logEvent`, `logEventAtTime`, `logSimpleTask`, `logSimpleTask`, `logSimpleTaskDuration`, `markPhase`, `nanoTimeMaybe`, `profile`, `profile`, `profile`, `profileAction`, `profileAsync`, `profileFuture`, `registerCounterSeriesCollector`, `setVfsTypeHeuristics`, `start`, `stop`, `unregisterCounterSeriesCollector`. 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 28 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: SpawnExecutionContext (16 abstract methods) src/main/java/com/google/devtools/build/lib/exec/SpawnRunner.java:141 — `SpawnExecutionContext` declares 16 abstract methods: `checkForLostInputs`, `getActionFileSystem`, `getClientEnv`, `getContext`, `getDigest`, `getFileOutErr`, `getId`, `getInputMapping`, `getInputMetadataProvider`, `getTimeout`, `isRewindingEnabled`, `lockOutputFiles`, `prefetchInputs`, `report`, `setDigest`, `speculating`. 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.
  • Fat interface: ActionConstructionContext (22 abstract methods) src/main/java/com/google/devtools/build/lib/analysis/actions/ActionConstructionContext.java:37 — `ActionConstructionContext` declares 22 abstract methods: `getActionKeyContext`, `getActionOwner`, `getActionOwner`, `getAnalysisEnvironment`, `getBinDirectory`, `getBinOrGenfilesDirectory`, `getConfiguration`, `getDerivedArtifact`, `getExecutionPlatform`, `getExecutionPlatform`, `getGenfilesDirectory`, `getImplicitOutputArtifact`, `getPackageDirectory`, `getPackageRelativeArtifact`, `getRelatedArtifact`, `getRuleErrorConsumer`, `getShareableArtifact`, `getTreeArtifact`, `getUniqueDirectory`, `getUniqueDirectoryArtifact`, `getUniqueDirectoryArtifact`, `getUniqueDirectoryArtifact`. 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 22 declarations carry 18 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 18 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: AnalysisEnvironment (20 abstract methods) src/main/java/com/google/devtools/build/lib/analysis/AnalysisEnvironment.java:40 — `AnalysisEnvironment` declares 20 abstract methods: `declareStampSettingDep`, `getActionKeyContext`, `getConstantMetadataArtifact`, `getDerivedArtifact`, `getEventHandler`, `getFilesetArtifact`, `getLocalGeneratingAction`, `getMainRepoMapping`, `getOrphanArtifacts`, `getRegisteredActions`, `getRunfilesArtifact`, `getSkyframeEnv`, `getStableWorkspaceStatusArtifact`, `getStarlarkDefinedBuiltins`, `getStarlarkSemantics`, `getSymlinkArtifact`, `getTreeArtifact`, `getTreeArtifactsConflictingWithFiles`, `getVolatileWorkspaceStatusArtifact`, `hasErrors`. 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.
  • Fat interface: SpawnResult (18 abstract methods) src/main/java/com/google/devtools/build/lib/actions/SpawnResult.java:38 — `SpawnResult` declares 18 abstract methods: `exitCode`, `failureDetail`, `getDetailMessage`, `getExecutorHostName`, `getMemoryInKb`, `getMetrics`, `getNumBlockInputOperations`, `getNumBlockOutputOperations`, `getNumInvoluntaryContextSwitches`, `getRunnerName`, `getRunnerSubtype`, `getStartTime`, `getSystemTimeInMs`, `getUserTimeInMs`, `getWallTimeInMs`, `isCacheHit`, `status`, `wasRemote`. 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.
  • Fat interface: ActionAnalysisMetadata (19 abstract methods) src/main/java/com/google/devtools/build/lib/actions/ActionAnalysisMetadata.java:27 — `ActionAnalysisMetadata` declares 19 abstract methods: `describe`, `getClientEnvironmentVariables`, `getExecProperties`, `getExecutionPlatform`, `getInputFilesForExtraAction`, `getInputs`, `getKey`, `getMandatoryInputs`, `getMandatoryOutputs`, `getMnemonic`, `getOriginalInputs`, `getOutputs`, `getOwner`, `getPrimaryInput`, `getPrimaryOutput`, `getSchedulingDependencies`, `getTools`, `isShareable`, `prettyPrint`. 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.
D16 · Bus Factor · Off-boarding risk · ×13
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 45 significant file(s) lose their only recent owner: src/main/java/com/google/devtools/build/lib/concurrent/AbstractQueueVisitor.java, src/main/java/com/google/devtools/build/lib/skyframe/WatchServiceDiffAwareness.java, src/main/java/com/google/devtools/build/lib/query2/query/LabelVisitor.java, src/main/java/com/google/devtools/build/lib/metrics/criticalpath/CriticalPathComponent.java, src/main/java/com/google/devtools/build/docgen/SourceFileReader.java, src/main/java/com/google/devtools/build/lib/query2/engine/QueryParser.java, src/main/java/com/google/devtools/build/skyframe/NodeEntryVisitor.java, src/main/java/com/google/devtools/build/lib/starlarkdebug/server/StarlarkDebugServer.java (+37 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 26 significant file(s) lose their only recent owner: src/main/java/com/google/devtools/build/lib/events/Event.java, src/main/java/com/google/devtools/build/skyframe/ReverseDepsUtility.java, src/main/java/com/google/devtools/build/lib/bazel/bzlmod/LockfileModuleExtensionMetadata.java, src/main/java/com/google/devtools/build/lib/remote/util/RxFutures.java, src/main/java/com/google/devtools/build/lib/analysis/platform/DeclaredToolchainInfo.java, src/main/java/com/google/devtools/build/lib/skyframe/DirtinessCheckerUtils.java, src/main/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleExtensionUsage.java, src/main/java/com/google/devtools/build/lib/concurrent/CancellableTask.java (+18 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 16 significant file(s) lose their only recent owner: src/main/java/com/google/devtools/build/lib/concurrent/RequestBatching.java, src/main/java/com/google/devtools/build/lib/concurrent/EagerRequestBatcher.java, src/main/java/com/google/devtools/build/lib/concurrent/safeexecutor/SafeExecutorOwner.java, src/main/java/com/google/devtools/build/lib/skyframe/serialization/testutils/Dumper.java, src/main/java/com/google/devtools/build/lib/concurrent/AbstractQuiescingFuture.java, src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/FileDependencies.java, src/main/java/com/google/devtools/build/lib/skyframe/AbstractNestedFileOpNodes.java, src/main/java/com/google/devtools/build/lib/concurrent/SettableFutureKeyedValue.java (+8 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 15 significant file(s) lose their only recent owner: src/main/java/com/google/devtools/build/lib/remote/disk/DiskCacheGarbageCollector.java, src/main/java/com/google/devtools/build/lib/util/ExitCode.java, src/main/java/com/google/devtools/build/lib/util/MapCodec.java, src/main/java/com/google/devtools/build/lib/buildeventstream/BuildEvent.java, src/main/java/com/google/devtools/build/lib/sandbox/DockerCommandLineBuilder.java, src/main/java/com/google/devtools/build/lib/skyframe/serialization/CodecScanner.java, src/main/java/com/google/devtools/build/lib/server/IdleTaskManager.java, src/main/java/com/google/devtools/build/lib/util/LogHandlerQuerier.java (+7 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #5 — If anonymized user #5 becomes unavailable, 12 significant file(s) lose their only recent owner: src/main/java/com/google/devtools/build/lib/bugreport/BugReport.java, src/main/java/net/starlark/java/eval/CompactImmutableDict.java, src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionState.java, src/main/java/com/google/devtools/build/skyframe/AbstractInMemoryNodeEntry.java, src/main/java/com/google/devtools/build/lib/collect/nestedset/NestedSetSerializationCache.java, src/main/java/com/google/devtools/build/lib/util/HashCodes.java, src/main/java/com/google/devtools/build/lib/actions/ActionExecutionMetadata.java, src/main/java/com/google/devtools/build/lib/skyframe/serialization/autocodec/SerializationConstantProcessor.java (+4 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #6 — If anonymized user #6 becomes unavailable, 11 significant file(s) lose their only recent owner: src/main/java/net/starlark/java/syntax/TypeTable.java, src/main/java/net/starlark/java/eval/RangeList.java, src/main/java/com/google/devtools/build/lib/packages/BuiltinsInternalModule.java, src/main/java/net/starlark/java/eval/Sequence.java, src/main/java/net/starlark/java/annot/StarlarkBuiltin.java, src/main/java/com/google/devtools/build/docgen/starlark/MemberDoc.java, src/main/java/com/google/devtools/build/lib/starlarkbuildapi/core/ProviderApi.java, src/main/java/net/starlark/java/syntax/StarlarkFile.java (+3 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #7 — If anonymized user #7 becomes unavailable, 5 significant file(s) lose their only recent owner: src/main/java/com/google/devtools/build/skyframe/DirtyBuildingState.java, src/main/java/net/starlark/java/eval/FormatParser.java, src/main/java/com/google/devtools/build/lib/bugreport/CrashContext.java, src/main/java/com/google/devtools/build/lib/bazel/bzlmod/SingleExtensionUsagesFunction.java, src/main/java/com/google/devtools/build/lib/analysis/RunfilesProvider.java. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #8 — If anonymized user #8 becomes unavailable, 5 significant file(s) lose their only recent owner: src/main/java/com/google/devtools/build/lib/concurrent/WorkStealingThreadPoolExecutor.java, src/main/java/com/google/devtools/build/lib/includescanning/IncludeScannerSupplier.java, src/main/java/com/google/devtools/build/lib/util/AbruptExitException.java, src/main/java/com/google/devtools/build/lib/profiler/statistics/PhaseSummaryStatistics.java, src/main/java/com/google/devtools/build/lib/includescanning/SwigIncludeScanner.java. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #9 — If anonymized user #9 becomes unavailable, 4 significant file(s) lose their only recent owner: src/main/java/com/google/devtools/build/lib/runtime/TargetSummaryPublisher.java, src/main/java/com/google/devtools/build/lib/actions/ActionExecutionStatusReporter.java, src/main/java/com/google/devtools/build/lib/skyframe/serialization/ImmutableSortedSetCodec.java, src/main/java/com/google/devtools/build/lib/skyframe/serialization/ImmutableListCodec.java. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #10 — If anonymized user #10 becomes unavailable, 4 significant file(s) lose their only recent owner: src/main/java/com/google/devtools/build/lib/buildtool/BuildResult.java, src/main/java/com/google/devtools/build/lib/starlarkbuildapi/config/ConfigGlobalLibraryApi.java, src/main/java/com/google/devtools/build/lib/starlarkbuildapi/StarlarkBuildApiGlobals.java, src/main/java/net/starlark/java/syntax/Identifier.java. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #11 — If anonymized user #11 becomes unavailable, 3 significant file(s) lose their only recent owner: src/main/java/com/google/devtools/build/skyframe/GroupedDeps.java, src/main/java/com/google/devtools/build/lib/skyframe/serialization/ChunkedValueSerialization.java, src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/SkyValueUploadedEvent.java. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #12 — If anonymized user #12 becomes unavailable, 3 significant file(s) lose their only recent owner: src/main/java/com/google/devtools/build/lib/util/ResourceUsage.java, src/main/java/com/google/devtools/build/lib/profiler/TimeSeriesImpl.java, src/main/java/com/google/devtools/build/lib/platform/PlatformNativeDepsServiceImpl.java. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #13 — If anonymized user #13 becomes unavailable, 3 significant file(s) lose their only recent owner: src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/SettablePlatformConfigurationProvider.java, src/main/java/com/google/devtools/build/lib/skyframe/serialization/SkycacheMetadataParams.java, src/main/java/com/google/devtools/build/lib/skyframe/serialization/PlatformConfigurationProvider.java. Pair on, review, or document these before any departure.
IC1 · Incompleteness & stubs · Empty method body · ×3
  • Empty method body src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/testbed/JUnit4TestbridgeExercises.java:29 — `testPass` has an empty body — confirm it's an intentional no-op and not an unfinished method.
  • Empty method body src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/testbed/JUnit4TestbridgeOomExercises.java:27 — `testPass` has an empty body — confirm it's an intentional no-op and not an unfinished method.
  • Empty method body src/main/java/com/google/devtools/build/lib/vfs/bazel/BazelHashFunctions.java:44 — `ensureRegistered` has an empty body — confirm it's an intentional no-op and not an unfinished method.
X7 · Silent fallback defaults · Silent fallback default on parse failure · ×2
  • Silent fallback default on parse failure src/main/java/com/google/devtools/build/lib/starlarkdebug/server/DebuggerSerialization.java:148 — `getChildren` returns `ImmutableList.of()` when `IllegalArgumentException` is thrown, with no log or throw — a malformed value silently becomes that default. Log the input or fail validation. 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 in the catch or in the Javadoc, and the row stops firing.
  • Silent fallback default on parse failure src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/HttpConnectorMultiplexer.java:172 — `getEffectivePort` returns `-1` when `MalformedURLException | IllegalArgumentException` is thrown, with no log or throw — a malformed value silently becomes that default. Log the input or fail validation. 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 in the catch or in the Javadoc, and the row stops firing.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 25 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (188 single-owned of 2176 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 2176 of the 3282 production source files in this repository met that bar). They are anonymized user #14 (2 file(s)), anonymized user #15 (2 file(s)), anonymized user #16 (2 file(s)), anonymized user #17 (2 file(s)), anonymized user #18 (2 file(s)), anonymized user #19 (2 file(s)) (+19 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: src/main/java/com/google/devtools/build/lib/worker/WorkRequestHandler.java, src/java_tools/buildjar/java/com/google/devtools/build/buildjar/jarhelper/JarCreator.java, src/main/java/com/google/devtools/build/skyframe/QueryableGraph.java, src/main/java/com/google/devtools/build/lib/skyframe/serialization/MultimapCodecs.java, src/main/java/com/google/devtools/build/lib/collect/ImmutableSharedKeyMap.java, src/main/java/com/google/devtools/build/skyframe/ShortCircuitingCycleDetector.java, src/main/java/com/google/devtools/build/lib/runtime/ConfigFlagDefinitions.java, src/main/java/com/google/devtools/build/lib/analysis/TransitiveVisibilityProvider.java (+23 more).
D19 · Documentation Quality · Documentation · ×1
  • Documentation: no project overview docs/command-line-reference-suffix.html — The HTML document gives no description of what Bazel command-line options do; it only lists option syntax. Add an overview section explaining the main commands and their arguments, plus a one-paragraph summary of how to interpret --[no]batch/--connect_timeout_secs.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 1 of 1 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. The most over is `(repository root)` (595527 LoC, 5055 module-visible types across 243 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D34 · Knowledge Freshness · Further orphaned files (smaller) · ×1
  • Further orphaned files (smaller) — 174 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: src/main/java/com/google/devtools/build/lib/skyframe/PackageFunctionWithMultipleGlobDeps.java, src/main/java/com/google/devtools/build/lib/bazel/bzlmod/modcommand/ModuleArg.java, src/main/java/com/google/devtools/build/lib/skyframe/RecursivePackageProviderBackedTargetPatternResolver.java, src/main/java/com/google/devtools/build/lib/query2/RBuildFilesVisitor.java, src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfPatternFunction.java, src/main/java/com/google/devtools/build/lib/packages/GlobCache.java, src/main/java/com/google/devtools/build/lib/packages/AspectsList.java, src/main/java/com/google/devtools/build/lib/packages/RequiredProviders.java (and 166 more) (175 orphaned of 2184 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 2184 of the 3282 production source files in this repository met that bar). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
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.
M2 · Architecture documentation · No architecture diagram/doc · ×1
  • No architecture diagram/doc — No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 1/2 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`.
PF1 · Benchmark discipline · Benchmarks don't track allocations · ×1
  • Benchmarks don't track allocations src/test/java/com/google/devtools/build/lib/remote/ChunkedTransferBenchmark.java — A JMH/Jetpack Benchmark suite exists but nothing turns on its allocation measurement — allocations (the main way hot code pressures a garbage collector or allocator) aren't being measured.
X5 · Nullable reference types · Java packages are not null-marked everywhere · ×1
  • Java packages are not null-marked everywhere — 0/224 of this repository's Java package directories are under a non-null default: a `REDACTED` declaring `@NullMarked` (JSpecify) or `@NonNullApi`, `@ParametersAreNonnullByDefault`, `@NonNullByDefault`, `@DefaultQualifier(NonNull.class)`; a `module-info.java` declaring `@NullMarked`; every type in it `@NullMarked`; or a build that runs NullAway with the package in `AnnotatedPackages`, or the Checker Framework's `NullnessChecker`. Elsewhere every reference admits null and no checker warns on the dereference that throws a `NullPointerException`.
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×1
  • Hand-rolled JSON/XML parsing via regex src/main/java/com/google/devtools/build/lib/bazel/bzlmod/BazelLockFileFunction.java:54 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JVM code already uses a real parser in the same package; use it here too.
Minor — 90 finding(s)
D10 · Test Quality · Skipped (documented) · ×90
  • Skipped (documented): createKey_platformFlags_accumulate src/test/java/com/google/devtools/build/lib/analysis/producers/BuildConfigurationKeyMapProducerTest.java:247 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
  • Skipped (documented): createKey_platformFlags_accumulate src/test/java/com/google/devtools/build/lib/analysis/producers/BuildConfigurationKeyProducerTest.java:398 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
  • Skipped (documented): testOutputFilterSeeWarning src/test/java/com/google/devtools/build/lib/analysis/BuildViewTest.java:554 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
  • Skipped (documented): testNewChannel_unixSocketProxy_authorityIsTargetUrl src/test/java/com/google/devtools/build/lib/authandtls/GoogleAuthUtilsTest.java:359 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
  • Skipped (documented): testNewChannel_unixSocket_authorityIsLocalhost src/test/java/com/google/devtools/build/lib/authandtls/GoogleAuthUtilsTest.java:344 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
  • Skipped (documented): testBuiltinModules_forRoot src/test/java/com/google/devtools/build/lib/bazel/bzlmod/DiscoveryTest.java:729 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
  • Skipped (documented): testLocalPathOverride src/test/java/com/google/devtools/build/lib/bazel/bzlmod/DiscoveryTest.java:680 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
  • Skipped (documented): getLocalRegistryPath_unixAbsolutePath src/test/java/com/google/devtools/build/lib/bazel/bzlmod/IndexRegistryTest.java:1156 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
  • Skipped (documented): getLocalRegistryPath_windowsDriveInPath src/test/java/com/google/devtools/build/lib/bazel/bzlmod/IndexRegistryTest.java:1163 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
  • Skipped (documented): getLocalRegistryPath_windowsRejectsDriveLetterAsHost src/test/java/com/google/devtools/build/lib/bazel/bzlmod/IndexRegistryTest.java:1170 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
  • Skipped (documented): testBuiltinModules_forBuiltinModules src/test/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleFileFunctionTest.java:1857 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
  • Skipped (documented): testCommandLineModuleOverrides src/test/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleFileFunctionTest.java:1007 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
  • Skipped (documented): testLocalPathOverride src/test/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleFileFunctionTest.java:798 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
  • Skipped (documented): getWatchedRegistryPath_absoluteFileUrl src/test/java/com/google/devtools/build/lib/bazel/bzlmod/RegistryFunctionTest.java:34 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
  • Skipped (documented): httpBzlDocumentation src/test/java/com/google/devtools/build/lib/bazel/repository/decompressor/DecompressorValueTest.java:104 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
  • Skipped (documented): setLastModifiedTime src/test/java/com/google/devtools/build/lib/bazel/repository/decompressor/GzFunctionTest.java:133 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
  • Skipped (documented): downloadFrom2UrlsBothSocketTimeoutDuringBodyRead src/test/java/com/google/devtools/build/lib/bazel/repository/downloader/HttpDownloaderTest.java:482 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
  • Skipped (documented): downloadFrom2UrlsFirstSocketTimeoutOnBodyReadSecondOk src/test/java/com/google/devtools/build/lib/bazel/repository/downloader/HttpDownloaderTest.java:413 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
  • Skipped (documented): testReplaceWithSymlinkContents src/test/java/com/google/devtools/build/lib/blackbox/framework/PathUtilsTest.java:179 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
  • Skipped (documented): testBeforeSecondCommand_fullyAsync_besTimeout_slowHalfCloseWarning src/test/java/com/google/devtools/build/lib/buildeventservice/BazelBuildEventServiceModuleTest.java:657 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
  • Skipped (documented): testBeforeSecondCommand_fullyAsync_slowHalfCloseWarning src/test/java/com/google/devtools/build/lib/buildeventservice/BazelBuildEventServiceModuleTest.java:631 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
  • Skipped (documented): hasExecutionStatistics src/test/java/com/google/devtools/build/lib/exec/local/LocalSpawnRunnerTest.java:846 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
  • Skipped (documented): interruptWaitsForProcessExit src/test/java/com/google/devtools/build/lib/exec/local/LocalSpawnRunnerTest.java:607 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
  • Skipped (documented): noProcessWrapper src/test/java/com/google/devtools/build/lib/exec/local/LocalSpawnRunnerTest.java:396 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
  • Skipped (documented): nonZeroExit src/test/java/com/google/devtools/build/lib/exec/local/LocalSpawnRunnerTest.java:440 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
  • + 65 more in this group — see findings.md.

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/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-c03f94a3f4024b7e801e7047a983192f/history.json --exit-code 0 --source .27artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-c03f94a3f4024b7e801e7047a983192f/tree.json --exit-code 0 --source .17artifacts/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/watchdog-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off .5artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .3artifacts/raw/osv-scanner.json
D31 · IaC & Container Securitytrivy—trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.0—
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 6 file(s) — `src/main/java/net/starlark/java/eval/Printer.java`, `src/main/java/net/starlark/java/eval/Starlark.java`, `src/main/java/net/starlark/java/eval/StarlarkFunction.java`, `src/main/java/net/starlark/java/syntax/Parser.java`, `src/main/java/net/starlark/java/syntax/Resolver.java`, … (+1 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.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 Dependenciesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .0artifacts/raw/osv-scanner.json

Run 01a16d74-1c86-7710-a843-bf7e9a6e55c3 · 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