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

mrdoob/three.js

Measured 13 November 2026, 16:09 UTC, at code version acf77e4

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

CAI score 41out of 100 Weak
CriticalWeakAdequateStrongExemplary
Up 2 since the last survey

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

A very large codebase: 656,120 lines of product code in 2 projects, tests not counted · Estimated rebuild effort: about 4.0 person-years · Weakest lens: Accessibility, 29

Findings by how serious they are

83 critical 1387 serious 163 minor

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

This survey was produced by

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

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

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

62of 62 dimensions measured by tools.
1617of 1633 findings point to an exact file and line, so you can open each one in the code. The other 16 concern the repository as a whole, such as missing documentation.
62dimensions across 7 lenses, read from 656,120 lines of product code in 2 projects.
Chapters

Executive summary

mrdoob/three.js falls short of our standard for production, in part because it has images with no text description. It scores 41 out of 100 and is rated Weak, and five of its 83 critical findings are security problems in its code and in its automatic dependency updates.

Accessibility, at 29, is the weakest lens and counts most in the score. The best first steps are making the controls keyboard-usable and adding text alternatives, each worth about 5 points. Raising Accessibility to 70 would lift the score to about 50.

Thirty-seven images have no description for people who can't see them. Three places in the code run text as code, which an attacker could use, and five buttons or links have no name a screen reader can say. Describing the images, replacing text run as code with direct calls and naming the buttons and links would close these risks. Setting a waiting period for automatic updates would fix the automatic dependency update that takes a new release at once, and fixing the weaknesses the scanner points to would deal with the security weakness in the code. The 21 pages or frames without a title need a descriptive title.

The product code is 656,120 lines, about €580,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.
Accessibility 29 · counts for 46%Code Health 35 · counts for 25%Production Readiness 56 · counts for 14%Security and Compliance 64 · counts for 8%Maturity 71 · counts for 4%Performance 85 · counts for 2%Architecture 87 · counts for 1%

If Accessibility rose from 29 to 70, the lowest score rated Strong, the score would rise from 41 to about 50.

Code composition: what the lines of code are
Product code 96%Tests 4%
New since the last survey: 216 findings

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

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

Fixed since the last survey: 1194 findings

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

  • Cyclomatic Complexity · WGSLNodeBuilder.getUniforms (cyclomatic 41) src/renderers/webgpu/nodes/WGSLNodeBuilder.js
  • Cyclomatic Complexity · Renderer._projectObject (cyclomatic 35) src/renderers/common/Renderer.js
  • Cyclomatic Complexity · tern.findCompletions::gather (cyclomatic 33) editor/js/libs/ternjs/tern.js
  • Cyclomatic Complexity · CodeCompiler.renameIdentifier::walk (cyclomatic 33) tsl/js/code/CodeCompiler.js
  • Cyclomatic Complexity · ProjectsManager.openProjectsModal (cyclomatic 30) tsl/js/managers/ProjectsManager.js
  • Cyclomatic Complexity · ProjectsManager.importProjectJSON (cyclomatic 28) tsl/js/managers/ProjectsManager.js
  • Cyclomatic Complexity · importProjectJSON::(anonymous)::onload (cyclomatic 28) tsl/js/managers/ProjectsManager.js
  • Cyclomatic Complexity · parsePath (cyclomatic 28) editor/js/libs/ternjs/def.js
  • Cyclomatic Complexity · GLSLNodeBuilder.getUniforms (cyclomatic 25) src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js
  • Cyclomatic Complexity · CodeCompiler.compile::parseFile::processNode (cyclomatic 24) tsl/js/code/CodeCompiler.js
  • Cyclomatic Complexity · CodeCompiler.mergeImports (cyclomatic 21) tsl/js/code/CodeCompiler.js
  • Cyclomatic Complexity · CodeCompiler.removeUnusedImports::getFullLineRange (cyclomatic 21) tsl/js/code/CodeCompiler.js
  • Cyclomatic Complexity · prettify.createSimpleLexer (cyclomatic 19) REDACTED
  • Cyclomatic Complexity · server.createHandler (cyclomatic 18) REDACTED
  • Cognitive Complexity · getUniforms (cognitive 82) src/renderers/webgpu/nodes/WGSLNodeBuilder.js
  • Cognitive Complexity · Renderer._projectObject (cognitive 77) src/renderers/common/Renderer.js
  • Cognitive Complexity · build (cognitive 67) src/nodes/core/Node.js
  • Cognitive Complexity · getUniforms (cognitive 57) src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js
  • Cognitive Complexity · CodeCompiler.compile::parseFile::processNode (cognitive 52) tsl/js/code/CodeCompiler.js
  • Cognitive Complexity · CodeCompiler.renameIdentifier::walk (cognitive 46) tsl/js/code/CodeCompiler.js
  • Cognitive Complexity · clear (cognitive 38) src/renderers/webgpu/WebGPUBackend.js
  • Cognitive Complexity · prettify.createSimpleLexer::decorate (cognitive 37) REDACTED
  • Cognitive Complexity · NodeMaterial.setup (cognitive 37) src/materials/nodes/NodeMaterial.js
  • Cognitive Complexity · importProjectJSON::(anonymous)::onload (cognitive 37) tsl/js/managers/ProjectsManager.js
  • Cognitive Complexity · findCompletions::gather (cognitive 36) editor/js/libs/ternjs/tern.js
  • Cognitive Complexity · server.createHandler (cognitive 32) REDACTED
  • Cognitive Complexity · NodeManager.getForRender (cognitive 31) src/renderers/common/nodes/NodeManager.js
  • Cognitive Complexity · Server (cognitive 31) editor/js/libs/ternjs/tern.js
  • Cognitive Complexity · openProjectsModal (cognitive 31) tsl/js/managers/ProjectsManager.js
  • Cognitive Complexity · CodeCompiler.mergeImports (cognitive 28) tsl/js/code/CodeCompiler.js
  • Cognitive Complexity · (anonymous) (cognitive 28) editor/js/libs/ternjs/infer.js
  • Cognitive Complexity · CodeCompiler.removeUnusedImports::getFullLineRange (cognitive 21) tsl/js/code/CodeCompiler.js
  • God Classes · FileTooLong: code/CodeCompiler.js tsl/js/code/CodeCompiler.js
  • God Classes · FileTooLong: managers/ProjectsManager.js tsl/js/managers/ProjectsManager.js
  • Churn × Complexity Hotspots · Hotspot: src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js
  • Churn × Complexity Hotspots · Hotspot: src/renderers/webgpu/utils/WebGPUTextureUtils.js src/renderers/webgpu/utils/WebGPUTextureUtils.js
  • Churn × Complexity Hotspots · Hotspot: src/nodes/utils/LoopNode.js src/nodes/utils/LoopNode.js
  • Churn × Complexity Hotspots · Hotspot: src/renderers/webxr/WebXRManager.js src/renderers/webxr/WebXRManager.js
  • Churn × Complexity Hotspots · Hotspot: test/e2e/puppeteer.js test/e2e/puppeteer.js
  • Churn × Complexity Hotspots · Hotspot: examples/jsm/inspector/RendererInspector.js examples/jsm/inspector/RendererInspector.js
  • Churn × Complexity Hotspots · Hotspot: examples/jsm/loaders/3DMLoader.js examples/jsm/loaders/3DMLoader.js
  • Churn × Complexity Hotspots · Hotspot: examples/jsm/tsl/display/RecurrentDenoiseNode.js examples/jsm/tsl/display/RecurrentDenoiseNode.js
  • Churn × Complexity Hotspots · Hotspot: examples/jsm/loaders/FBXLoader.js examples/jsm/loaders/FBXLoader.js
  • Churn × Complexity Hotspots · Hotspot: src/renderers/webgpu/utils/WebGPUUtils.js src/renderers/webgpu/utils/WebGPUUtils.js
  • Churn × Complexity Hotspots · Hotspot: examples/jsm/inspector/tabs/Timeline.js examples/jsm/inspector/tabs/Timeline.js
  • Churn × Complexity Hotspots · Hotspot: examples/jsm/transpiler/TSLEncoder.js examples/jsm/transpiler/TSLEncoder.js
  • Secrets (history) · Secret: square-access-token examples/js/loaders/TiltLoader.js
  • Secrets (history) · Secret: square-access-token examples/jsm/loaders/TiltLoader.js
  • Secrets (history) · Secret: generic-api-key examples/models/gltf/Soldier.glb
  • Secrets (history) · Secret: square-access-token examples/models/tilt/BRUSH_DOME.tilt
  • Secrets (history) · Secret: aws-access-token examples/textures/memorial.hdr
  • Secrets (history) · Secret: jwt examples/webgl_loader_3dtiles.html
  • Secrets (history) · Secret: generic-api-key manual/examples/resources/models/windmill_2/windmill_diffuse.tga
  • Secrets (history) · High secret: WD-SECRET-0005 REDACTED
  • Static Analysis (SAST) · Medium: REDACTED examples/jsm/inspector/extensions/color-grading/ColorGrading.js
  • Static Analysis (SAST) · Medium: REDACTED examples/jsm/inspector/extensions/color-grading/ColorWheel.js
  • Static Analysis (SAST) · Medium: REDACTED examples/jsm/inspector/extensions/color-grading/modules/Module.js
  • Static Analysis (SAST) · Medium: REDACTED examples/jsm/loaders/SVGLoader.js
  • Dependency Vulnerabilities · High CVE: [GHSA redacted] REDACTED
  • Knowledge Freshness · Orphaned knowledge editor/js/libs/ternjs/infer.js
  • Change Coupling · Change coupling: Editor.js ↔ Sidebar.Project.Renderer.js editor/js/Editor.js
  • Code Duplication · Duplicated block with local edits (120 matched lines × 2 locations) src/renderers/WebGLRenderer.js
  • Code Duplication · Duplicated block with local edits (55 matched lines × 2 locations) src/objects/Line.js
  • Code Duplication · Duplicated block with local edits (48 matched lines × 2 locations) src/renderers/WebGLRenderer.js
  • Code Duplication · Duplicated block with local edits (45 matched lines × 2 locations) src/renderers/webgl-fallback/utils/WebGLAttributeUtils.js
  • Code Duplication · Duplicated block (36 lines × 2 locations) src/objects/Line.js
  • Code Duplication · Duplicated block (36 lines × 2 locations) src/renderers/webgpu/utils/WebGPUPipelineUtils.js
  • Code Duplication · Duplicated block (35 lines × 2 locations) editor/js/commands/SetScriptValueCommand.js
  • Code Duplication · Duplicated block (35 lines × 3 locations) src/loaders/AnimationLoader.js
  • Code Duplication · Duplicated block (35 lines × 2 locations) src/loaders/BufferGeometryLoader.js
  • Code Duplication · Duplicated block (35 lines × 2 locations) src/renderers/webgl/WebGLUniforms.js
  • Code Duplication · Duplicated block (35 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (34 lines × 2 locations) editor/js/History.js
  • Code Duplication · Duplicated block (34 lines × 2 locations) src/math/Vector3.js
  • Code Duplication · Duplicated block with local edits (31 matched lines × 2 locations) editor/js/commands/AddScriptCommand.js
  • Code Duplication · Duplicated block with local edits (31 matched lines × 2 locations) src/nodes/utils/FlipNode.js
  • Code Duplication · Duplicated block (30 lines × 3 locations) editor/js/Sidebar.Geometry.BoxGeometry.js
  • Code Duplication · Duplicated block (30 lines × 2 locations) src/math/Vector3.js
  • Code Duplication · Duplicated block (30 lines × 2 locations) src/objects/InstancedMesh.js
  • Code Duplication · Duplicated block (29 lines × 2 locations) src/nodes/accessors/BufferAttributeNode.js
  • Code Duplication · Duplicated block (28 lines × 2 locations) editor/js/Sidebar.Material.js
  • Code Duplication · Duplicated block with local edits (28 matched lines × 2 locations) src/extras/curves/CatmullRomCurve3.js
  • Code Duplication · Duplicated block with local edits (28 matched lines × 2 locations) src/geometries/TorusGeometry.js
  • Code Duplication · Duplicated block (28 lines × 2 locations) src/math/Matrix3.js
  • Code Duplication · Duplicated block (28 lines × 2 locations) src/renderers/webgl-fallback/utils/WebGLState.js
  • Code Duplication · Duplicated block (28 lines × 2 locations) tsl/js/code/CodeCompiler.js
  • Code Duplication · Duplicated block (27 lines × 2 locations) editor/js/Sidebar.Material.BooleanProperty.js
  • Code Duplication · Duplicated block (27 lines × 2 locations) src/renderers/webgl/WebGLUniforms.js
  • Code Duplication · Duplicated block (27 lines × 2 locations) src/utils.js
  • Code Duplication · Duplicated block (26 lines × 3 locations) src/math/Vector2.js
  • Code Duplication · Duplicated block (26 lines × 2 locations) src/renderers/WebGL3DRenderTarget.js
  • Code Duplication · Duplicated block (26 lines × 3 locations) src/renderers/webgl/WebGLUniforms.js
  • Code Duplication · Duplicated block (26 lines × 2 locations) tsl/js/utils/MarkdownUtils.js
  • Code Duplication · Duplicated block with local edits (25 matched lines × 2 locations) src/renderers/common/Geometries.js
  • Code Duplication · Duplicated block (24 lines × 2 locations) editor/js/Sidebar.Geometry.RingGeometry.js
  • Code Duplication · Duplicated block (24 lines × 2 locations) editor/js/Sidebar.Project.Resources.js
  • Code Duplication · Duplicated block (24 lines × 2 locations) src/materials/PointsMaterial.js
  • Code Duplication · Duplicated block (24 lines × 2 locations) src/math/Vector3.js
  • Code Duplication · Duplicated block with local edits (24 matched lines × 2 locations) src/nodes/accessors/Skinning.js
  • Code Duplication · Duplicated block with local edits (24 matched lines × 2 locations) src/nodes/math/PackFloatNode.js
Rebuild cost: about €580,000 · Estimate
Cost to rebuild€190,000 to €970,000, for 3,232 to 10,253 hours of work, about 4.0 person-years for 2 to 8 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.7 at a score of 41. 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: 656,120 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. 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
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Raises the score by about 5 points · Medium effort · Keyboard semantics
2
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Raises the score by about 5 points · Medium effort · Text alternatives
3
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
Raises the score by about 3 points · Medium effort · Type Safety

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 €580,000 to build again, about 4.0 person-years of work. Its weakest lens is Accessibility, at 29 (Weak). Accessibility is about whether the interface is built so that everyone can use it, including people who can't see the screen or can't use a mouse. Because the weakest lens counts most in the score, work on Accessibility also moves the score most.
Based on: the rebuild estimate · the Accessibility grade · how much each lens counts
What to do: Start with the Accessibility actions in Top priorities.
If you do one thing first · First action
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href. Of all the actions in this report, it raises the score most for the work it takes: about 5 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 4.8 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 8% to 18% on every change. The history of the code shows how much it changes: about 419,794 lines over the last 90 days, which is about 1,702,498 lines a year. At that pace, the extra work comes to an estimated 342.6 to 2055.4 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

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.

621 modules, with 397 dependencies between them. Every module uses only modules listed above it, so there are no loops.

The table shows the 40 modules with the most connections; 581 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 REDACTED.Command2 src.animation.KeyframeTrack3 src.core.EventDispatcher4 src.extras.core.Curve5 src.lights.LightShadow6 src.loaders.Loader7 src.math.Interpolant8 src.nodes.core.LightingModel9 src.renderers.common.Buffer10 src.renderers.common.DataMap11 src.core.BufferAttribute12 src.core.BufferGeometry13 src.core.Object3D14 src.core.RenderTarget15 src.materials.Material16 src.nodes.core.Node17 src.textures.Texture18 src.cameras.Camera19 src.geometries.PolyhedronGeometry20 src.lights.Light21 src.materials.nodes.NodeMaterial22 src.nodes.accessors.ReferenceAttributeNode23 src.nodes.accessors.ReferenceNode24 src.nodes.core.ContextNode25 src.nodes.core.InputNode26 src.nodes.lighting.LightingNode27 src.nodes.utils.ArrayElementNode28 src.objects.Group29 src.objects.Line30 src.objects.Mesh31 src.renderers.WebGLRenderTarget32 src.lights.SpotLight33 src.nodes.core.UniformNode34 src.nodes.lighting.AnalyticLightNode35 src.objects.LineSegments36 src.nodes.accessors.BufferNode37 src.nodes.accessors.TextureNode38 src.nodes.lighting.SpotLightNode39 src.nodes.display.PassNode40 src.nodes.display.ViewportTextureNode
1 REDACTED.Command
2 src.animation.KeyframeTrack
3 src.core.EventDispatcher
4 src.extras.core.Curve
5 src.lights.LightShadow
6 src.loaders.Loader
7 src.math.Interpolant
8 src.nodes.core.LightingModel
9 src.renderers.common.Buffer
10 src.renderers.common.DataMap
11 src.core.BufferAttribute1
12 src.core.BufferGeometry1
13 src.core.Object3D1
14 src.core.RenderTarget1
15 src.materials.Material1
16 src.nodes.core.Node1
17 src.textures.Texture1
18 src.cameras.Camera1
19 src.geometries.PolyhedronGeometry1
20 src.lights.Light1
21 src.materials.nodes.NodeMaterial1
22 src.nodes.accessors.ReferenceAttributeNode1
23 src.nodes.accessors.ReferenceNode1
24 src.nodes.core.ContextNode1
25 src.nodes.core.InputNode1
26 src.nodes.lighting.LightingNode1
27 src.nodes.utils.ArrayElementNode1
28 src.objects.Group1
29 src.objects.Line1
30 src.objects.Mesh1
31 src.renderers.WebGLRenderTarget1
32 src.lights.SpotLight1
33 src.nodes.core.UniformNode1
34 src.nodes.lighting.AnalyticLightNode1
35 src.objects.LineSegments1
36 src.nodes.accessors.BufferNode1
37 src.nodes.accessors.TextureNode1
38 src.nodes.lighting.SpotLightNode1
39 src.nodes.display.PassNode11
40 src.nodes.display.ViewportTextureNode1
Uses a module listed above itPart of a loopThe module itself
1 REDACTED.Command2 src.animation.KeyframeTrack3 src.core.EventDispatcher4 src.extras.core.Curve5 src.lights.LightShadow6 src.loaders.Loader7 src.math.Interpolant8 src.nodes.core.LightingModel9 src.renderers.common.Buffer10 src.renderers.common.DataMap11 src.core.BufferAttribute12 src.core.BufferGeometry13 src.core.Object3D14 src.core.RenderTarget15 src.materials.Material16 src.nodes.core.Node17 src.textures.Texture18 src.cameras.Camera19 src.geometries.PolyhedronGeometry20 src.lights.Light21 src.materials.nodes.NodeMaterial22 src.nodes.accessors.ReferenceAttributeNode23 src.nodes.accessors.ReferenceNode24 src.nodes.core.ContextNode25 src.nodes.core.InputNode26 src.nodes.lighting.LightingNode27 src.nodes.utils.ArrayElementNode28 src.objects.Group29 src.objects.Line30 src.objects.Mesh31 src.renderers.WebGLRenderTarget32 src.lights.SpotLight33 src.nodes.core.UniformNode34 src.nodes.lighting.AnalyticLightNode35 src.objects.LineSegments36 src.nodes.accessors.BufferNode37 src.nodes.accessors.TextureNode38 src.nodes.lighting.SpotLightNode39 src.nodes.display.PassNode40 src.nodes.display.ViewportTextureNodeREDACTED.Command1src.animation.KeyframeTrack2src.core.EventDispatcher3src.extras.core.Curve4src.lights.LightShadow5src.loaders.Loader6src.math.Interpolant7src.nodes.core.LightingModel8src.renderers.common.Buffer9src.renderers.common.DataMap10src.core.BufferAttribute11src.core.BufferGeometry12src.core.Object3D13src.core.RenderTarget14src.materials.Material15src.nodes.core.Node16src.textures.Texture17src.cameras.Camera18src.geometries.PolyhedronGeometry19src.lights.Light20src.materials.nodes.NodeMaterial21src.nodes.accessors.ReferenceAttributeNode22src.nodes.accessors.ReferenceNode23src.nodes.core.ContextNode24src.nodes.core.InputNode25src.nodes.lighting.LightingNode26src.nodes.utils.ArrayElementNode27src.objects.Group28src.objects.Line29src.objects.Mesh30src.renderers.WebGLRenderTarget31src.lights.SpotLight32src.nodes.core.UniformNode33src.nodes.lighting.AnalyticLightNode34src.objects.LineSegments35src.nodes.accessors.BufferNode36src.nodes.accessors.TextureNode37src.nodes.lighting.SpotLightNode38src.nodes.display.PassNode39src.nodes.display.ViewportTextureNode401111111111111111111111111111111+581 more modules (most-connected shown)

At a glance — Code Health · 35% · Weak · gated by D1, D2, R1, R2 ·

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

At a glance — Maturity · 71% · Strong ·

At a glance — Readiness · 56% · Adequate · gated by P7 ·

At a glance — Security · 64% · Adequate · gated by D29 ·

At a glance — Accessibility · 29% · Weak · gated by AC1, AC3, AC4 ·

At a glance — Performance · 85% · 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
A05:2025 — Injection56High / Critical
A03:2025 — Software Supply Chain Failures2Medium

Roadmap

Top priorities: Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href; Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video; Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.

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

Do thisHelpsEffortDimension
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.+5.3 ptsMediumKeyboard semantics
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.+5.3 ptsMediumText alternatives
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.+3.5 ptsMediumType Safety
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.+3.4 ptsMediumPage structure
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.+2.5 ptsMediumVisual & motion safety
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with package.json.+0.8 ptsLowADR Quality
Resolve the 40 finding(s) in Cyclomatic Complexity.+1.5 ptsMediumCyclomatic Complexity
Bring the 69 bodies over 60 down to 60 or less in Cognitive Complexity — start with WebGLProgram (cognitive 356), WebGLTextures.WebGLTextures::uploadTexture (cognitive 315), WebGLUtils.convert (cognitive 256).+1.4 ptsHighCognitive Complexity

File quality

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

FileScoreBandWorst signal
REDACTED2.8SlopStatic Analysis (SAST): High: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): Medium: REDACTED
src/nodes/core/NodeBuilder.js4.8MixedCyclomatic Complexity: NodeBuilder.generateConst (cyclomatic 36)
REDACTED5.0MixedStatic Analysis (SAST): High: REDACTED
src/renderers/WebGLRenderer.js5.0MixedCyclomatic Complexity: WebGLRenderer.constructor::setProgram (cyclomatic 129)
src/renderers/webgl-fallback/utils/WebGLTextureUtils.js5.0MixedCyclomatic Complexity: WebGLTextureUtils.getInternalFormat (cyclomatic 93)
src/nodes/core/Node.js5.1MixedCyclomatic Complexity: Node.build (cyclomatic 40)
src/renderers/common/Bindings.js5.1MixedCyclomatic Complexity: Bindings._update (cyclomatic 26)
src/renderers/webgl-fallback/WebGLBackend.js5.5MixedCyclomatic Complexity: WebGLBackend._setFramebuffer (cyclomatic 49)
src/renderers/webgpu/WebGPUBackend.js5.5MixedCyclomatic Complexity: WebGPUBackend.beginRender (cyclomatic 35)
src/renderers/webgl-fallback/utils/WebGLState.js5.6MixedCyclomatic Complexity: WebGLState.setBlending (cyclomatic 29)
REDACTED5.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.9MixedStatic Analysis (SAST): Medium: REDACTED
editor/js/libs/acorn/acorn.js6.1MixedCyclomatic Complexity: acorn.pp$9.getTokenFromCode (cyclomatic 46)
utils/docs/template/publish.js6.2MixedCyclomatic Complexity: publish.publish (cyclomatic 37)
tsl/js/managers/PlaygroundManager.js6.3MixedCyclomatic Complexity: PlaygroundManager.renderPlaygroundTabs (cyclomatic 24)
src/nodes/lighting/LightsNode.js6.3MixedCognitive Complexity: LightsNode.setupLightsNode (cognitive 19)

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

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

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

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

Could not be resolved — 12

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

Methodology & how to trust this report

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

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

What we checked — 62 dimensions across the health lenses
D1D2D3D6D13D15D16D19D20D24D26D28D29D30D34D35D37D43AC1AC2AC3AC4AC6AX10AX3AX4GD1IC1M1M2M3P1P10P2P3P6P7PF3R1R10R2R3R4R5R6R7R8R9S1X1X12X13X16X17X18X2X21X24X28X29X3X30

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, 1617 of 1633 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

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

Tools & methods

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

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

Every finding is locatable in findings.md. Run 01a1d5ab-d327-7808-8ef2-a849663c0b37.

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

Run transparency — what happened this run

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

  • D4 Code Duplication — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. The language model for this repository listed its production source (.html) but exposed no token stream for any of it, so nothing reached the token comparison.
  • D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — the JavaScript/TypeScript suite(s) run through a browser-driven runner the coverage collector does not drive — the repository root (puppeteer) — a gap in the analyzer, not something this repository is missing. Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo.
  • D12 Dependency Hygiene — 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. This repository's 1 package.json manifest(s) and its 1 committed lockfile(s) WERE read; what went unanswered is the currency half, because it grades the production `dependencies` a lockfile resolves and these manifests declare none — only 16 devDependencies, which D12 does not grade. So registry.npmjs.org was never asked, and there was nothing here for it to grade. This is a true statement about the repository and NOT a gap on our side: the lockfile was resolved, and no reader we could write would find a production dependency in it.
  • D14 License Compliance — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This repository declares no npm dependency a consumer installs, but 32 of the 1278 code file(s) it ships carry a sign of vendored or bundled third-party code (for example `build/three.cjs` is committed build output, which a bundler can inline undeclared third-party code into; `build/three.core.js` is committed build output, which a bundler can inline undeclared third-party code into; `examples/jsm/libs/basis/basis_transcoder.js` is minified or bundled output, which can inline third-party code; `examples/jsm/libs/basis/basis_transcoder.wasm` is a compiled binary module whose source is not in this repository; `examples/jsm/libs/fflate.module.js` states a licence of its own in its header). Code copied or bundled into a repository ships under its upstream licence, and this pass has no reader for it: it grades the licences of DECLARED packages only. So there is a licence to grade here and it was not graded — a missing collector, not a statement about this repository.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
  • D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `editor/js/libs/codemirror/codemirror.js`, `src/math/Matrix2.js`, `src/math/Matrix3.js`, `src/math/Matrix4.js`, `src/math/Vector2.js`, … (+3 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.
  • D44 Platform End-of-Life — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This dimension reads a project's own statement about the platform it runs on: a TargetFramework in a .NET project file, a .nvmrc or .python-version, a capped requires-python, a Rust toolchain file or Cargo.toml rust-version, a .go-version, .java-version, .ruby-version, .tool-versions or .sdkmanrc, a go.mod go directive, a Maven or Gradle Java level or toolchain, a Gemfile's ruby directive, a mix.exs elixir requirement, a rebar.config minimum_otp_vsn, a pubspec.yaml SDK constraint, a build.sbt scalaVersion, or a framework major pinned by a dependency constraint. This repository carries none of them, so nothing about its platform was established. That is a gap in this analyzer's coverage, NOT a finding that the platform is supported — a language whose runtime is declared elsewhere (Package.swift, a Dockerfile) is simply not read here yet.
  • AC1 Text alternatives — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 88 further occurrence(s) are not listed individually; the score already reflects all 128.
  • AC3 Page structure — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 246 further occurrence(s) are not listed individually; the score already reflects all 286.
  • AX6 Interface segregation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing 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.
  • AXB2 Runtime readiness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. The dev server kept running but no port it opened served a page in the time allowed. (rule: no-answer). The renderer reported: the dev server (`npm run dev`) kept running but served no page within 2 minutes. Likely cause (not identified): the dev server kept running but no port it opened served a page in the time allowed. Last output: "> three@0.187.0 dev / > node utils/build/dev.js && node REDACTED -p 8080 / Server running at http://localhost:8080/ / http://172.31.7.10:8080/ / Press Ctrl+C to stop." No runtime evidence was gathered.
  • AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DevServer (dev). the dev server (`npm run dev`) kept running but served no page within 2 minutes. Likely cause (not identified): the dev server kept running but no port it opened served a page in the time allowed. Last output: "> three@0.187.0 dev / > node utils/build/dev.js && node REDACTED -p 8080 / Server running at http://localhost:8080/ / http://172.31.7.10:8080/ / Press Ctrl+C to stop." No runtime evidence was gathered.
  • GD1 Unfinished & placeholder code — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The filesystem refused build/three.cjs while this check was reading the repository. Those files were not read, so a defect in them cannot appear on this card; every other file was read.
  • 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 none applies: this repository publishes a library and deploys nothing (no container, IaC or deployment manifest), so it holds no runtime state of its own. Any data-access dependency it declares is the store it is a CLIENT for, not one it operates. The DR control belongs to whoever runs that data.
  • R10 Code Duplication — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 559 further occurrence(s) are not listed individually; the score already reflects all 599.
  • R2 Cyclomatic Complexity — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 924 further occurrence(s) are not listed individually; the score already reflects all 964.
  • R3 Large Files — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 67 further occurrence(s) are not listed individually; the score already reflects all 107.
  • X10 Duplicated predicate — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 18 further occurrence(s) are not listed individually; the score already reflects all 58.
  • X4 Structured logging — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala and Rust source only, and no C# was loaded, and this repository's JavaScript/TypeScript, Python and PHP log through no library that carries a message's values as fields (pino, winston, bunyan, tslog, LogTape, roarr; Python's logging, structlog; PHP's PSR-3 loggers), so its log calls cannot be judged, 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.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • 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.
  • D13 Secret Scanning: Secret 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").
  • 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.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
  • 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 requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • 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.
  • AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
  • AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
  • AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
  • AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
  • 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.
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

D1 · Cyclomatic Complexity2.7 / 10Weak✓ 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 2.7 / 10 · rule-coverage 100% · ceiling Prevented

570 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was WebGLProgram.WebGLProgram at 190. A further 13 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 TextureUtils.getByteLength at 45 — they are counted neither in the figure above nor in this dimension's score. 4 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/extras/TextureUtils.js (TextureUtils.getByteLength at 45), editor/js/Loader.js (Loader::loadFile at 36), src/renderers/webgl/WebGLUniforms.js (getSingularSetter at 36), src/renderers/webgl/WebGLUniforms.js (WebGLUniforms.getSingularSetter at 36). 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.

WebGLTextures.WebGLTextures::uploadTexture (cyclomatic 79) · ×8src/renderers/webgl/WebGLTextures.js:962
WebGLRenderer.constructor::setProgram (cyclomatic 129) · ×4src/renderers/WebGLRenderer.js:2397
constructor::render (cyclomatic 47) · ×4src/renderers/WebGLRenderer.js:1641
Sidebar.Object.SidebarObject::update (cyclomatic 49) · ×2editor/js/Sidebar.Object.js:430
index.html.updateFilter (cyclomatic 40) · ×2docs/index.html:2302

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

What to do

  1. Bring the 6 bodies over 120 down to 120 or less in Cyclomatic Complexity — start with WebGLProgram.WebGLProgram (cyclomatic 190), Material.fromJSON (cyclomatic 164), codemirror.addEditorMethods (cyclomatic 139). — 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 6 together lifts Cyclomatic Complexity from 2.7 to about 3.7/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.

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

D2 · Cognitive Complexity2.0 / 10Critical✓ 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 2.0 / 10 · rule-coverage 100% · ceiling Prevented

856 method(s) exceeded the cognitive complexity threshold of 15; the worst was WebGLProgram at 356.

constructor::setProgram (cognitive 149) · ×10src/renderers/WebGLRenderer.js:2397
WebGLTextures::uploadCubeTexture (cognitive 176) · ×6src/renderers/webgl/WebGLTextures.js:1469
WebGLTextures.WebGLTextures::uploadTexture (cognitive 315) · ×5src/renderers/webgl/WebGLTextures.js:962
addEditorMethods::getHelpers (cognitive 17) · ×4editor/js/libs/codemirror/codemirror.js:8390
Sidebar.Object.SidebarObject::update (cognitive 87) · ×3editor/js/Sidebar.Object.js:430

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

What to do

  1. Bring the 69 bodies over 60 down to 60 or less in Cognitive Complexity — start with WebGLProgram (cognitive 356), WebGLTextures.WebGLTextures::uploadTexture (cognitive 315), WebGLUtils.convert (cognitive 256). — 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 69 together lifts Cognitive Complexity from 2.0 to about 3.7/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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

D3 · God Classes9.3 / 10Stronggated by 152 serious findings✓ 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 9.3 / 10 · rule-coverage 100% · ceiling Prevented

152 god class(es) detected.

FunctionTooLong: WebGLTextures.WebGLTextures · ×40src/renderers/webgl/WebGLTextures.js:7
FileTooLong: codemirror/codemirror.js · ×35editor/js/libs/codemirror/codemirror.js
MethodTooLong: WebGLRenderer.constructor · ×34src/renderers/WebGLRenderer.js:71
TooManyMethods: NodeBuilder · ×24src/nodes/core/NodeBuilder.js:175
ClassTooLong: WebGLRenderer · ×19src/renderers/WebGLRenderer.js:64

What to do

  1. Resolve the 40 FunctionTooLong finding(s) in God Classes — start with WebGLPrograms.js (3), codemirror.js (3), WebGLLights.js (2). — One of this dimension's main actionable groups (40 warning-level).
  2. Resolve the 35 FileTooLong finding(s) in God Classes — start with WebGLState.js (2), codemirror.js, acorn.js. — One of this dimension's main actionable groups (35 warning-level).
  3. Resolve the 34 MethodTooLong finding(s) in God Classes — start with Renderer.js (3), Material.js (2), REDACTED (2). — One of this dimension's main actionable groups (34 warning-level).

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

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

18 of 556 classes have LCOM4 above 3.

Low cohesion: NodeBuilder (LCOM4 9) · ×18src/nodes/core/NodeBuilder.js:175

What to do

  1. Resolve the 18 Low cohesion finding(s) in Cohesion (LCOM4) — start with NodeBuilder.js, Loader.js, ColladaComposer.js. — One of this dimension's main actionable groups (18 warning-level).

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

D13 · Secret Scanning10.0 / 10Exemplary○ Nothing flagged

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

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

D15 · Churn × Complexity Hotspots9.2 / 10Stronggated by 69 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.2 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: src/renderers/WebGLRenderer.js (19×456=8664); src/renderers/webgl/WebGLTextures.js (9×444=3996); examples/jsm/loaders/SVGLoader.js (5×273=1365) Repeated repair below the complexity floor: examples/jsm/tsl/WebGLNodesHandler.js (4 of 7 changes were fixes)

Hotspot: src/renderers/WebGLRenderer.js · ×68src/renderers/WebGLRenderer.js:71
Repeated repair: examples/jsm/tsl/WebGLNodesHandler.jsexamples/jsm/tsl/WebGLNodesHandler.js:275

What to do

  1. Resolve the 68 Hotspot finding(s) in Churn × Complexity Hotspots — start with WebGLRenderer.js, WebGLTextures.js, SVGLoader.js. — One of this dimension's main actionable groups (68 warning-level).
  2. Resolve the 1 Repeated repair finding(s) in Churn × Complexity Hotspots — start with WebGLNodesHandler.js. — One of this dimension's main actionable groups (1 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

46 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is editor/js/libs/ternjs/infer.js. Counted over 492 of the 910 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Off-boarding risk: anonymized user #1 · ×4
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.

D19 · Documentation Quality10.0 / 10Exemplary○ Nothing flagged

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

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

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

1 of 1 documentation facets pass in full. 839 document(s) read across 1 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality0.0 / 10Critical✓ Tool-verified

What it measures: Whether architecture decisions are recorded well (context, decision, consequences).

Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.

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

No architecture decision records were found.

No ADRs foundpackage.json:45

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality — start with package.json. — One of this dimension's main actionable groups (1 recommendation-level).

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

D24 · Comment Value8.3 7.9 / 10Strong✓ Tool-verified

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

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

Maturity: Documented → Verified → Prevented · effective 7.9 / 10 · rule-coverage 96% · ceiling Documented

69 of 3960 judged comments only repeat the code they sit on (1.7 %). 250 comment(s) in another language or script were not judged.

redundant comment · ×59editor/js/History.js:204
doc comments repeat the namessrc/animation/AnimationAction.js:15

What to do

  1. Resolve the 59 redundant comment finding(s) in Comment Value — start with acorn.js (3), ViewportDepthTextureNode.tests.js (3), publish.js (3). — One of this dimension's main actionable groups (59 recommendation-level).

Detailed fixes: d24_recommendation.md · top locations in Appendix A, every location in findings.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.

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

1 of 2 build units (npm) 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)10.0 / 10Exemplary○ Nothing flagged

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

Method: Secret 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 10.0 / 10 · rule-coverage 100% · ceiling Documented

gitleaks scanned the full history AND the current working tree and found no secrets.

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)0.6 / 10Critical✓ 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 0.6 / 10 · rule-coverage 100% · ceiling Documented

59 finding(s): 0 critical, 5 high, 31 medium, 23 low. semgrep hit a parse error in 322 file(s) — `docs/pages/AONode.html` (line 23, line 45), `docs/pages/AfterImageNode.html` (line 24, line 54), `docs/pages/AnalyticLightNode.html` (line 109), `docs/pages/AnimationClip.html` (line 20, line 92, line 168, …), `docs/pages/AnimationClipCreator.html` (line 26), … (+317 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 2 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 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 Vulnerabilities9.8 / 10Stronggated by 1 serious finding✓ Tool-verified

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

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

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

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

REDACTED
REDACTED

What to do

  1. Resolve the 1 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 Low CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).

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

D34 · Knowledge Freshness9.8 / 10Exemplary✓ 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.8 / 10 · rule-coverage 100% · ceiling Documented

12 of 492 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is manual/resources/tools/geo-picking/shapefile.js. Counted over 492 of the 910 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned file · ×12manual/resources/tools/geo-picking/shapefile.js:1
Orphaned files with no living knowledge

✓ On the Gold path — maintain.

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

D35 · Change Coupling9.8 / 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.8 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: constants.js↔colorspace_pars_fragment.glsl.js 80%; lights_physical_pars_fragment.glsl.js↔meshphysical.glsl.js 79%; Bindings.js↔SampledTexture.js 64%

Boundary-crossing change coupling: PhysicalLightingModel.js ↔ lights_physical_pars_fragment.glsl.jssrc/nodes/functions/PhysicalLightingModel.js:1
Change coupling: constants.js ↔ colorspace_pars_fragment.glsl.js · ×7src/constants.js:1

What to do

  1. Resolve the 1 Boundary-crossing change coupling finding(s) in Change Coupling — start with PhysicalLightingModel.js. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 7 Change coupling finding(s) in Change Coupling — start with constants.js, lights_physical_pars_fragment.glsl.js, Bindings.js. — One of this dimension's main actionable groups (7 warning-level).

Detailed fixes: d35_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. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

Frontend & cross-cutting dimensions

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

AC1 · Text alternatives1.0 / 10Critical✓ Tool-verified

Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.

  • An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative. (×37) — REDACTED:189, REDACTED:308, REDACTED:352, …
  • A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content. (×3) — manual/pages/cameras.html:550, manual/pages/custom-buffergeometry.html:436, manual/pages/fog.html:268

What to do

  • Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
AC2 · Forms & labels7.8 / 10Strong✓ Tool-verified

Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.

Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label. (×2) — manual/index.html:34, REDACTED:305
  • A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label. (×3) — manual/pages/custom-buffergeometry.html:435, manual/pages/fundamentals.html:437, manual/pages/fundamentals.html:438
  • A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one). (×2) — tsl/index.html:65, tsl/index.html:94

What to do

  • Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
AC3 · Page structure4.0 / 10Weak✓ Tool-verified

Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.

Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). — devtools/panel/panel.html:2
  • No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. (×9) — devtools/panel/panel.html:2, editor/index.html:2, manual/index.html:2, …
  • user-scalable=no/0 or a maximum-scale below 2 stops low-vision users zooming to 200%. Remove the zoom restriction from the viewport meta. (×9) — editor/index.html:6, editor/js/libs/app/index.html:7, manual/index.html:6, …
  • An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label. (×21) — manual/index.html:43, REDACTED:181, REDACTED:254, …

What to do

  • Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
AC4 · Keyboard semantics1.0 / 10Critical✓ Tool-verified

Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".

  • An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action. — manual/pages/game.html:1920

What to do

  • Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
AC6 · Visual & motion safety5.5 / 10Adequate✓ Tool-verified

Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.

Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.

Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • `code` sets color: #CCC on background-color: #666 — 3.6:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — manual/resources/lesson.css:480
  • `.contextlost>div` sets color: white on background-color: red — 4.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — manual/examples/resources/threejs-tutorials.css:142
  • `#panel #filterInput` sets color: #444 on background-color: #444 — 1.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — files/main.css:250
  • `.cm-s-monokai span.cm-error` sets color: #f8f8f0 on background-color: #f92672 — 3.5:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — editor/js/libs/codemirror/theme/monokai.css:35
  • `li.CodeMirror-hint-active` sets color: white on background-color: #08f — 3.5:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — editor/js/libs/codemirror/addon/show-hint.css:33
  • `#tabs span.selected` sets color: #888 on background-color: #eee — 3.1:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — editor/css/main.css:572
  • `.TabbedPanel .Tab.selected` sets color: #888 on background-color: #eee — 3.1:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — editor/css/main.css:644
  • `.Button.selected` sets color: #fff on background-color: #08f — 3.5:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — editor/css/main.css:732
  • `.sidebar-search-input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — tsl/css/guide.css:1985
  • `.playground-tab-rename-input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — tsl/css/guide.css:2501
  • `.playground-tab-btn` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — tsl/css/guide.css:2518
  • `.playground-tab-btn:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — tsl/css/guide.css:2525
  • `#panel #filterInput` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — files/main.css:256
  • `#panel #language:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — files/main.css:289
  • `.CodeMirror-scroll` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — editor/js/libs/codemirror/codemirror.css:165
  • `.CodeMirror-vscrollbar` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — editor/js/libs/codemirror/codemirror.css:181
  • `.CodeMirror-code` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — editor/js/libs/codemirror/codemirror.css:279
  • `.CodeMirror-dialog input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — editor/js/libs/codemirror/addon/dialog.css:23
  • `.TextArea` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — editor/css/main.css:51
  • `.Button` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — editor/css/main.css:280
  • `.Select` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — editor/css/main.css:310
  • `.Outliner` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — editor/css/main.css:616
  • `.page-transition` moves (`animation: fadeIn 0.3s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — tsl/css/guide.css:273
  • `.sidebar` moves (`transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. (×2) — tsl/css/guide.css:547, tsl/css/guide.css:3653
  • `.toc-chevron` moves (`transition: transform 0.2s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — tsl/css/guide.css:643
  • `#editor-console` moves (`transition: height 0.2s cubic-bezier(0.4, 0, 0.2, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — tsl/css/guide.css:1809
  • `.sidebar-search-icon` moves (`transition: color 0.15s ease, left 0.25s cubic-bezier(0.4, 0, 0.2, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — tsl/css/guide.css:2006
  • `.playground-custom-scrollbar` moves (`transition: height 0.15s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — tsl/css/guide.css:2354
  • `.tsl-embed-lock-circle` moves (`transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — tsl/css/guide.css:2688
  • `.guide-ai-chevron` moves (`transition: transform 0.25s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — tsl/css/guide.css:3129
  • `.tsl-api-class-chevron` moves (`transition: transform 0.25s ease, color 0.2s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — tsl/css/guide.css:3267
  • `.x-tweet-card` moves (`transition: border-color 0.25s, transform 0.25s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — tsl/css/guide.css:3543
  • `.loading-screen::before` moves (`animation: forward-zoom 12s cubic-bezier(0.1, 0.7, 0.3, 1) infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — tsl/css/guide.css:3690
  • `.loading-spinner` moves (`animation: rotate 2s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — tsl/css/guide.css:3712
  • `#projects a img` moves (`transition: 0.15s transform`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — files/main.css:499
  • `#contentWrapper` moves (`transition: .25s transform`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — files/main.css:666

What to do

  • Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
AX10 · Code composition10.0 / 10Exemplary✓ Tool-verified

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

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.

AX4 · Dependency direction10.0 / 10Exemplary✓ Tool-verified

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

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

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

Other · Code Health — Unreviewed-generation residue in this repository's JavaScript/TypeScript: functions whose whole body still throws a "not implemented" error, and placeholder text (lorem ipsum, changeme/replace_me…) left in strings and JSX of non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.

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

IC1 · Incompleteness & stubs9.0 / 10Exemplary✓ Tool-verified

Other · Code Health — Unfinished work detected by code SHAPE, not keywords, in this repository's JavaScript/TypeScript: functions that only throw a "not implemented" error, functions that take inputs and return a constant or do nothing, async functions that never await, 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.

  • `cleanAndFormatActiveTab` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — tsl/js/managers/PlaygroundManager.js:897
  • `_onChangeCallback` has an empty body — confirm it's an intentional no-op and not an unfinished method. (×4) — build/three.core.js:4823, build/three.core.js:11822, src/math/Euler.js:427, …
  • A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead. (×2) — build/three.core.js:34744, src/extras/lib/earcut.js:1
  • `_setValue_unavailable` has an empty body — confirm it's an intentional no-op and not an unfinished method. (×2) — build/three.core.js:54038, REDACTED:328

What to do

  • Clear the softer debt: re-enable or delete skipped tests, decide whether each empty function is a deliberate no-op (and say so in a comment), and replace blanket `eslint-disable` / `@ts-nocheck` with targeted, justified suppressions.
M1 · Documentation (README)6.7 / 10Adequate✓ Tool-verified

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

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

What to do

  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
M2 · Architecture documentation5.0 / 10Adequate✓ Tool-verified

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

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

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

What to do

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

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

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

P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

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

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

P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged

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

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

P2 · Observability5.5 / 10Adequate✓ 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.
  • Add a health-check endpoint (@godaddy/terminus or a /health route) so orchestrators and load balancers can probe liveness/readiness.
P3 · Security & performance tooling7.0 / 10Strong✓ 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.

What to do

  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P6 · Release Hygiene5.0 / 10Adequate✓ 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.

  • No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)

What to do

  • Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
P7 · Outbound HTTP resilience3.0 / 10Weak✓ Tool-verified

Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.

Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.

  • `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×4) — editor/js/Script.js:312, REDACTED:213, REDACTED:648, …

What to do

  • Bound every outbound call: pass `signal: AbortSignal.timeout(ms)` to `fetch`, set `timeout` on the axios instance (`axios.create({ timeout })`), and add retries with back-off (`axios-retry`, `p-retry`) and a breaker (`opossum`, `cockatiel`) around dependencies that fail.
PF3 · Async & latency hygiene8.5 / 10Strong✓ Tool-verified

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

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

  • `unzipSync` in `handleZIP` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — editor/js/Loader.js:974

What to do

  • TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.
R1 · Type Safety0.0 / 10Critical✓ Tool-verified

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

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

  • 0 typed · 1215 plain JS — the untyped files are devtools/background.js, devtools/bridge.js, devtools/constants.js, devtools/content-script.js, devtools/devtools.js, devtools/highlight.js (+1209 more).

What to do

  • Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
R10 · Code Duplication8.9 / 10Strong✓ Tool-verified

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

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

  • docs/ and utils/docs/template/static/ are near-verbatim copies of each other: 9 files are byte-identical under the same relative paths (~4155 lines; the trees hold 1688 and 10 files). That is one structural fact, not 9 local ones: every edit made to one tree and not the other drifts silently, which is the failure whole-tree forks guarantee. Pick one tree as the single source and produce the other from it (generated, copied at build or release time, or re-exported) — or, if the copy is a stale snapshot nothing produces any more, delete it. Check first whether the copy is a deliberately published deliverable (a template consumers copy verbatim, a released sample frozen at a version); where it is, keep it produced from the source tree rather than edited in place. — docs/scripts/highlight.min.js:1
  • 61 duplicated blocks under src/ have copies in at least two of the sibling directories audio, cameras, core, extras, geometries, helpers (+8 more sibling(s) not listed) — 25 of them are reported below, and 36 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 61 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 61 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 61 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — src/extras/PMREMGenerator.js:22
  • 44 duplicated blocks under src/renderers/ have copies in at least two of the sibling directories common, webgl, webgl-fallback, webgpu, webxr — 36 of them are reported below, and 8 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 44 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 44 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 44 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — src/renderers/webgl-fallback/utils/WebGLUtils.js:55
  • 22 duplicated blocks under src/nodes/ have copies in at least two of the sibling directories accessors, code, core, display, functions, gpgpu (+4 more sibling(s) not listed) — 4 of them are reported below, and 18 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 22 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 22 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 22 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — src/nodes/core/StackNode.js:32
  • 19 duplicated blocks under the repository root have copies in at least two of the sibling directories devtools, editor, manual, src, tsl, utils — 8 of them are reported below, and 11 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 19 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 19 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 19 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — devtools/panel/panel.js:197
  • src/extras/PMREMGenerator.js:22 · src/renderers/common/extras/PMREMGenerator.js:33 — the two spans are one implementation copied and then locally edited — 1488 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/extras/PMREMGenerator.js:22
  • src/renderers/WebGLRenderer.js:3373 · src/renderers/webgl-fallback/utils/WebGLTextureUtils.js:867 — the two spans are one implementation copied and then locally edited — 1159 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/renderers/WebGLRenderer.js:3373
  • src/renderers/webgl-fallback/utils/WebGLUtils.js:55 · src/renderers/webgl/WebGLUtils.js:8 — the two spans are one implementation copied and then locally edited — 1199 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/renderers/webgl-fallback/utils/WebGLUtils.js:55
  • src/core/BufferAttribute.js:312 · src/core/InterleavedBufferAttribute.js:125 — the two spans are one implementation copied and then locally edited — 732 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/core/BufferAttribute.js:312
  • editor/js/libs/ui.js:533 · editor/js/libs/ui.js:754 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — editor/js/libs/ui.js:533
  • src/renderers/common/XRManager.js:1676 · src/renderers/webxr/WebXRManager.js:570 — the two spans are one implementation copied and then locally edited — 564 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/renderers/common/XRManager.js:1676
  • tsl/js/imports/scripts/scenes/empty.js:1 · tsl/js/imports/scripts/scenes/plane.js:1 — these 2 files are line-for-line copies of one another — 76 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — tsl/js/imports/scripts/scenes/empty.js:1
  • src/nodes/accessors/ReferenceBaseNode.js:17 · src/nodes/accessors/ReferenceNode.js:22 — the two spans are one implementation copied and then locally edited — 424 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/nodes/accessors/ReferenceBaseNode.js:17
  • src/materials/nodes/MeshPhongNodeMaterial.js:30 · src/materials/nodes/MeshStandardNodeMaterial.js:32 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — src/materials/nodes/MeshPhongNodeMaterial.js:30
  • src/materials/MeshLambertMaterial.js:1 · src/materials/MeshPhongMaterial.js:1 · src/materials/MeshStandardMaterial.js:2 — these 3 files are line-for-line copies of one another — 64 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — src/materials/MeshLambertMaterial.js:1
  • src/renderers/common/XRManager.js:909 · src/renderers/common/XRManager.js:1004 — 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. — src/renderers/common/XRManager.js:909
  • src/math/Plane.js:21 · src/math/Sphere.js:20 — the two spans are one implementation copied and then locally edited — 281 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/math/Plane.js:21
  • src/nodes/accessors/Morph.js:105 · src/renderers/webgl/WebGLMorphtargets.js:28 — the two spans are one implementation copied and then locally edited — 470 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/nodes/accessors/Morph.js:105
  • src/objects/Line.js:170 · src/objects/Points.js:108 — the two spans are one implementation copied and then locally edited — 442 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/objects/Line.js:170
  • src/renderers/common/XRManager.js:1239 · src/renderers/webxr/WebXRManager.js:477 — the two spans are one implementation copied and then locally edited — 403 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/renderers/common/XRManager.js:1239
  • editor/js/Loader.js:238 · editor/js/Loader.js:560 — the two spans are one implementation copied and then locally edited — 297 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — editor/js/Loader.js:238
  • src/cameras/OrthographicCamera.js:112 · src/cameras/PerspectiveCamera.js:129 — the two spans are one implementation copied and then locally edited — 348 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/cameras/OrthographicCamera.js:112
  • src/math/Vector3.js:230 · src/math/Vector4.js:291 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/math/Vector3.js:230
  • src/math/Euler.js:49 · src/math/Quaternion.js:161 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/math/Euler.js:49
  • src/extras/curves/LineCurve.js:9 · src/extras/curves/LineCurve3.js:9 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — src/extras/curves/LineCurve.js:9
  • editor/js/Sidebar.Scene.js:175 · editor/js/Sidebar.Scene.js:278 — the two spans are one implementation copied and then locally edited — 372 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — editor/js/Sidebar.Scene.js:175
  • editor/js/commands/SetPositionCommand.js:4 · editor/js/commands/SetRotationCommand.js:4 · editor/js/commands/SetScaleCommand.js:4 — the 3 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete. — editor/js/commands/SetPositionCommand.js:4
  • REDACTED:757 · REDACTED:1068 — 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. — REDACTED:757
  • tsl/js/utils/MarkdownUtils.js:648 · tsl/js/utils/MarkdownUtils.js:691 — 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. — tsl/js/utils/MarkdownUtils.js:648
  • editor/js/commands/SetMaterialColorCommand.js:3 · editor/js/commands/SetMaterialVectorCommand.js:3 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — editor/js/commands/SetMaterialColorCommand.js:3
  • src/renderers/webgl-fallback/utils/WebGLAttributeUtils.js:91 · src/renderers/webgl/WebGLAttributes.js:16 — the two spans are one implementation copied and then locally edited — 285 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/renderers/webgl-fallback/utils/WebGLAttributeUtils.js:91
  • src/extras/curves/CubicBezierCurve.js:27 · src/extras/curves/CubicBezierCurve3.js:10 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/extras/curves/CubicBezierCurve.js:27
  • src/extras/curves/QuadraticBezierCurve.js:26 · src/extras/curves/QuadraticBezierCurve3.js:10 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — src/extras/curves/QuadraticBezierCurve.js:26
  • src/nodes/core/NodeFrame.js:212 · src/nodes/core/NodeFrame.js:261 — 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. — src/nodes/core/NodeFrame.js:212
  • src/renderers/WebGLCubeRenderTarget.js:15 · src/renderers/common/CubeRenderTarget.js:20 — the two spans are one implementation copied and then locally edited — 322 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/renderers/WebGLCubeRenderTarget.js:15
  • src/nodes/accessors/Camera.js:85 · src/nodes/accessors/Camera.js:131 · src/nodes/accessors/Camera.js:177 · src/nodes/accessors/Camera.js:223 · +1 more site(s) not listed — all 5 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. — src/nodes/accessors/Camera.js:85
  • src/renderers/webgl-fallback/utils/WebGLState.js:501 · src/renderers/webgl/WebGLState.js:637 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/renderers/webgl-fallback/utils/WebGLState.js:501
  • src/renderers/webgl-fallback/utils/WebGLState.js:1416 · src/renderers/webgl/WebGLState.js:1214 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — src/renderers/webgl-fallback/utils/WebGLState.js:1416
  • src/renderers/webgpu/nodes/WGSLNodeBuilder.js:426 · src/renderers/webgpu/nodes/WGSLNodeBuilder.js:1114 — 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. — src/renderers/webgpu/nodes/WGSLNodeBuilder.js:426
  • editor/js/commands/MultiCmdsCommand.js:19 · editor/js/commands/SetSceneCommand.js:38 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — editor/js/commands/MultiCmdsCommand.js:19

What to do

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

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

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

  • WebGLProgram has cyclomatic complexity 177 and cognitive complexity 338; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/renderers/webgl/WebGLProgram.js:372
  • fromJSON has cyclomatic complexity 164 and cognitive complexity 166; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/materials/Material.js:920
  • parseBlock has cyclomatic complexity 161 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — examples/jsm/loaders/lwo/LWO2Parser.js:9
  • parseBlock has cyclomatic complexity 145 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — examples/jsm/loaders/lwo/LWO3Parser.js:9
  • setProgram has cyclomatic complexity 129 and cognitive complexity 149; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/renderers/WebGLRenderer.js:2397
  • convert has cyclomatic complexity 126 and cognitive complexity 256; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. (×2) — src/renderers/webgl-fallback/utils/WebGLUtils.js:51, src/renderers/webgl/WebGLUtils.js:6
  • toJSON has cyclomatic complexity 116 and cognitive complexity 118; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/materials/Material.js:610
  • getFormat has cyclomatic complexity 115 and cognitive complexity 138; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/renderers/webgpu/utils/WebGPUTextureUtils.js:1481
  • getParameters has cyclomatic complexity 100 and cognitive complexity 94; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/renderers/webgl/WebGLPrograms.js:54
  • _drawBatches has cyclomatic complexity 97 and cognitive complexity 171; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — examples/jsm/pipelines/MeshletDrawingPipeline.js:4310
  • parseObject has cyclomatic complexity 94 and cognitive complexity 127; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/loaders/ObjectLoader.js:784
  • getInternalFormat has cyclomatic complexity 93 and cognitive complexity 156; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/renderers/webgl-fallback/utils/WebGLTextureUtils.js:165
  • toRGBA8 has cyclomatic complexity 82 and cognitive complexity 196; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — examples/jsm/libs/utif.module.js:1300
  • _buildGeometryWithSubsets has cyclomatic complexity 80 and cognitive complexity 107; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — examples/jsm/loaders/usd/USDComposer.js:1922
  • getCallDetail has cyclomatic complexity 80 and cognitive complexity 80; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — examples/jsm/inspector/tabs/Timeline.js:918
  • uploadTexture has cyclomatic complexity 79 and cognitive complexity 315; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/renderers/webgl/WebGLTextures.js:962
  • equals has cyclomatic complexity 76 and cognitive complexity 123; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/materials/nodes/manager/NodeMaterialObserver.js:587
  • getInternalFormat has cyclomatic complexity 74 and cognitive complexity 119; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/renderers/webgl/WebGLTextures.js:132
  • load has cyclomatic complexity 73 and cognitive complexity 85; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — examples/jsm/inspector/extensions/color-grading/ColorGrading.js:1898
  • parse has cyclomatic complexity 67 and cognitive complexity 95; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — examples/jsm/libs/utif.module.js:12
  • parseStatement has cyclomatic complexity 67 and cognitive complexity 94; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — editor/js/libs/acorn/acorn-loose.js:304
  • _readScalarValue has cyclomatic complexity 67 and cognitive complexity 54; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — examples/jsm/loaders/usd/USDCParser.js:1301
  • updateMatrixWorld has cyclomatic complexity 65 and cognitive complexity 146; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — examples/jsm/controls/TransformControls.js:1587
  • _readIFD has cyclomatic complexity 65 and cognitive complexity 145; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — examples/jsm/libs/utif.module.js:1175
  • setup has cyclomatic complexity 65 and cognitive complexity 110; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/nodes/accessors/MaterialNode.js:120
  • processMeshAsync has cyclomatic complexity 64 and cognitive complexity 140; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — examples/jsm/exporters/GLTFExporter.js:1848
  • (anonymous) has cyclomatic complexity 63 and cognitive complexity 113; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — editor/js/libs/codemirror/codemirror.js:393
  • run has cyclomatic complexity 60 and cognitive complexity 130; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:897
  • parse has cyclomatic complexity 58 and cognitive complexity 139; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — examples/jsm/loaders/OBJLoader.js:543
  • generateTangentSpaces has cyclomatic complexity 58 and cognitive complexity 116; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — examples/jsm/libs/mikktspace.module.js:432
  • av has cyclomatic complexity 57 and cognitive complexity 206; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — examples/jsm/libs/utif.module.js:460
  • setupDecoder has cyclomatic complexity 57 and cognitive complexity 58; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — examples/jsm/loaders/EXRLoader.js:2891
  • insertLineContent has cyclomatic complexity 56 and cognitive complexity 147; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — editor/js/libs/codemirror/codemirror.js:1921
  • pointerMove has cyclomatic complexity 56 and cognitive complexity 110; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — examples/jsm/controls/TransformControls.js:516
  • parsePathNode has cyclomatic complexity 56 and cognitive complexity 96; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — examples/jsm/loaders/SVGLoader.js:300
  • _decodeOldJPEGInit has cyclomatic complexity 54 and cognitive complexity 117; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — examples/jsm/libs/utif.module.js:764
  • update has cyclomatic complexity 54 and cognitive complexity 103; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — examples/jsm/inspector/tabs/Viewer.js:956
  • applyColorTransform has cyclomatic complexity 54 and cognitive complexity 102; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — examples/jsm/inspector/extensions/color-grading/LUTMath.js:180
  • emitExpression has cyclomatic complexity 54 and cognitive complexity 79; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — examples/jsm/transpiler/TSLEncoder.js:130
R3 · Large Files5.3 / 10Adequate✓ Tool-verified

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

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

  • editor/js/libs/codemirror/codemirror.js has 8884 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — editor/js/libs/codemirror/codemirror.js:1
  • editor/js/libs/acorn/acorn.js has 4396 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — editor/js/libs/acorn/acorn.js:1
  • src/renderers/common/Renderer.js has 2978 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/renderers/common/Renderer.js:1
  • src/nodes/core/NodeBuilder.js has 2698 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/nodes/core/NodeBuilder.js:1
  • src/renderers/WebGLRenderer.js has 2472 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/renderers/WebGLRenderer.js:1
  • editor/js/Strings.js has 2423 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — editor/js/Strings.js:1
  • src/renderers/webgpu/WebGPUBackend.js has 2369 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/renderers/webgpu/WebGPUBackend.js:1
  • editor/js/libs/ternjs/infer.js has 2069 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — editor/js/libs/ternjs/infer.js:1
  • src/renderers/webgpu/nodes/WGSLNodeBuilder.js has 1939 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/renderers/webgpu/nodes/WGSLNodeBuilder.js:1
  • src/renderers/webgl-fallback/WebGLBackend.js has 1914 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/renderers/webgl-fallback/WebGLBackend.js:1
  • REDACTED has 1670 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • REDACTED has 1598 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • src/renderers/webgl/WebGLTextures.js has 1442 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/renderers/webgl/WebGLTextures.js:1
  • src/renderers/common/XRManager.js has 1408 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/renderers/common/XRManager.js:1
  • src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js has 1338 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js:1
  • src/renderers/webgpu/utils/WebGPUTextureUtils.js has 1320 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/renderers/webgpu/utils/WebGPUTextureUtils.js:1
  • src/objects/BatchedMesh.js has 1267 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/objects/BatchedMesh.js:1
  • src/core/Object3D.js has 1252 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/Object3D.js:1
  • editor/js/libs/acorn/acorn-loose.js has 1242 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — editor/js/libs/acorn/acorn-loose.js:1
  • editor/js/libs/ternjs/tern.js has 1060 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — editor/js/libs/ternjs/tern.js:1
  • src/renderers/webgl-fallback/utils/WebGLState.js has 1045 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/renderers/webgl-fallback/utils/WebGLState.js:1
  • src/nodes/materialx/MaterialXNoise.js has 1042 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/nodes/materialx/MaterialXNoise.js:1
  • src/nodes/core/Node.js has 1038 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/nodes/core/Node.js:1
  • src/nodes/math/MathNode.js has 1038 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/nodes/math/MathNode.js:1
  • src/core/BufferGeometry.js has 988 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/BufferGeometry.js:1
  • src/math/Matrix4.js has 987 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/math/Matrix4.js:1
  • src/materials/nodes/NodeMaterial.js has 977 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/materials/nodes/NodeMaterial.js:1
  • src/materials/Material.js has 972 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/materials/Material.js:1
  • src/math/Vector3.js has 955 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/math/Vector3.js:1
  • tsl/js/utils/MarkdownUtils.js has 938 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — tsl/js/utils/MarkdownUtils.js:1
  • manual/resources/threejs-primitives.js has 930 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — manual/resources/threejs-primitives.js:1
  • src/renderers/webgl-fallback/utils/WebGLTextureUtils.js has 929 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/renderers/webgl-fallback/utils/WebGLTextureUtils.js:1
  • src/nodes/display/PassNode.js has 859 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/nodes/display/PassNode.js:1
  • src/renderers/webgl/WebGLState.js has 810 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/renderers/webgl/WebGLState.js:1
  • tsl/js/managers/PlaygroundManager.js has 804 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — tsl/js/managers/PlaygroundManager.js:1
  • src/loaders/ObjectLoader.js has 799 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/loaders/ObjectLoader.js:1
  • src/nodes/accessors/TextureNode.js has 799 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/nodes/accessors/TextureNode.js:1
  • src/math/Vector4.js has 797 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/math/Vector4.js:1
  • src/nodes/tsl/TSLCore.js has 774 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/nodes/tsl/TSLCore.js:1
  • src/renderers/common/Backend.js has 752 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/renderers/common/Backend.js:1

What to do

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

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

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

  • No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×16) — utils/changelog.js:1, utils/llms/build.js:1, devtools/bridge.js:1, …

What to do

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

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

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

R6 · Tooling6.7 / 10Adequate✓ Tool-verified

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

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

  • test ✓ · lint ✓ · typecheck ✗ — read from this repository's package.json scripts and corroborated against its CI workflows. A script counts when its name or command matches the step: `test` for the suite, `lint` or `prettier` for linting, `typecheck`/`type-check`/`tsc` for type checking. ✗ therefore means no script or CI step under those names was found, NOT that the step is absent from your pipeline — a task invoked by a runner this check does not read, or named something else entirely, is not seen and is worth confirming before acting on a cross. A ✓ means the wiring is DECLARED — a script or CI step under those names exists. It is not a statement that the step passes, or that it runs at all: nothing here installs a dependency or executes a suite.

What to do

  • Add type checking (adopt TypeScript, or type-check the existing JavaScript with `checkJs`) as package.json scripts and run them in CI.
R7 · Dead Code9.9 / 10Exemplary✓ Tool-verified

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

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

  • Unreachable from the 1582 application, 4 tooling and 295 test entry point(s) detected in this repo. Gate removals on `npm run build` — an undetected custom entry would make these reachable.
  • no import path from any entry point (1582 application, 4 tooling, 295 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×7) — utils/generateDFGLUT.js, utils/packLDrawModel.mjs, tsl/js/imports/scripts/scenes/shaderball.js, …

What to do

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

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

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

  • Imported but not declared in any reachable package.json — installs work only by hoisting accident. (×2) — editor/js/libs/acorn/acorn-loose.js:2, tsl/js/utils/MarkdownUtils.js:1
  • Declared in the root package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.

What to do

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

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

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

S1 · Web-Security Posture6.0 / 10Adequate✓ Tool-verified

Other · Security — Read from this repository's JavaScript/TypeScript source: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS (certificate validation, protocol version) — facts about code that hold whether or not it serves anything itself. Markup this repository SHIPS is scored for third-party script integrity whether or not the repository serves it itself, since a page handed to a consumer runs in that consumer’s origin. Of the server controls, two are read where the source shows them: every session or sign-in cookie the code sets is read for HttpOnly, Secure and SameSite at the line that sets it (a raw `Set-Cookie` header, Express, Fastify, Hono, Koa, Next.js, `cookie.serialize`, express-session and cookie-session), and every Node listener for HTTPS enforcement. HSTS, security response headers and input validation are NOT assessed for JavaScript/TypeScript: each is scored as an absence, an absence is only reportable over the production HTTP server, and in this ecosystem the file that opens the port is build output or a framework launcher rather than a file in the source tree. Their absence here is not a finding about this repository. Its Node HTTP listeners were read for HTTPS enforcement alone — TLS served, a redirect to https:// or HSTS, or a TLS-terminating proxy configuration committed beside the server — each judged per server package.

Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.

  • `https://cdn.jsdelivr.net/gh/google/draco@1.5.7/javascript/draco_encoder.js` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session. — editor/index.html:29
  • `server.listen(…)` serves plain HTTP on a network address, and nothing in its package enforces HTTPS: no TLS served (`https.createServer`, Fastify `https`, Nest `httpsOptions`), no redirect of plain requests to `https://`, no `Strict-Transport-Security` (helmet sends it by default), and no TLS-terminating proxy configuration committed beside it — so a browser may talk to it in clear text. (−2.0 on this card.) (×2) — REDACTED:197, REDACTED:216

What to do

  • Pin third-party scripts and verify them: name an exact version in the URL and add an `integrity="sha384-…"` hash alongside `crossorigin="anonymous"` (both are required — an integrity hash on a cross-origin script without `crossorigin` is not evaluated, it blocks the script). Where the vendor ships a continuously-updated loader and publishes no stable hash (tag managers, analytics, chat widgets), Subresource Integrity is not available: constrain it instead with a `Content-Security-Policy` that names the exact origins allowed to execute, and drop the script from the pages that do not need it. Where the page is shipped inside a package that others host, prefer vendoring the asset and serving it from the app’s own origin, so no consumer inherits a third-party dependency they did not choose.
  • Enforce HTTPS on each listed server: serve TLS itself, or redirect plain requests to `https://` and send `Strict-Transport-Security` (`helmet()` does by default) behind the TLS-terminating proxy — and commit that proxy's configuration beside the service. A server only this machine reaches should bind `127.0.0.1`.
X1 · Async correctness7.1 / 10Strong✓ Tool-verified

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.

  • The function passed to `new Promise(…)` is `async`. The constructor ignores what its executor returns, so anything this executor throws — every throw inside an `async` function, including after an `await` — rejects a Promise nobody holds instead of the one being constructed: the outer Promise never settles, whoever awaits it hangs, and the error is reported nowhere. If the body needs `await`, it does not need `new Promise` at all: make the enclosing function `async` and `return` the value (or `throw`) directly. If it wraps a callback API, keep the executor synchronous — call the API and `resolve`/`reject` from its callback — and do the awaiting outside it. (×10) — REDACTED:2563, src/renderers/webgpu/utils/WebGPUPipelineUtils.js:282, src/renderers/webgpu/utils/WebGPUPipelineUtils.js:443, …

What to do

  • `async` Promise executor
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.

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 document3.5 / 10Weak✓ Tool-verified

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.

  • `struct` is exported and takes `membersLayout: object` from its caller, and it calls itself at line 137 (`struct`) with a piece of `membersLayout` — and nowhere in `struct` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `struct` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/nodes/core/StructNode.js:137

What to do

  • Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
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.

X2 · Cancellation propagation4.0 / 10Weak✓ Tool-verified

Other · Code Health — Whether async functions that make a cancellable request accept or pass on an AbortSignal (adoption curve).

Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. 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 question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.

  • Only 0/4 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
  • `load` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. (×2) — REDACTED:209, REDACTED:584
  • `showImportedFiles` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — tsl/js/managers/PlaygroundManager.js:1158
  • `loadThreeDefs` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — editor/js/Script.js:304

What to do

  • Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
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.

X24 · Document value interpolated into markup unescaped5.3 / 10Adequate✓ Tool-verified

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.

  • `'&nbsp;'+object.name` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. (×2) — editor/js/Sidebar.Settings.History.js:97, editor/js/Sidebar.Settings.History.js:113
  • `template` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — editor/js/libs/codemirror/addon/dialog.js:24
  • `options[key]` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — editor/js/libs/ui.js:412
  • `text` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. (×2) — manual/resources/lesson.js:30, manual/resources/threejs-primitives.js:893
  • `sourceCodeHtml` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — REDACTED:1475
  • `num` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — REDACTED:351
  • `node.searchSnippet` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. (×2) — REDACTED:2148, REDACTED:2242
  • `iconName` is text this program did not author, and it is written into a quoted attribute value through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. (×3) — REDACTED:2358, REDACTED:2370, REDACTED:2381
  • `safeHref` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path. — REDACTED:90

What to do

  • Each finding names the expression, the attribute it lands in and the line. Confirm the value's origin from the read this analyzer traced, then escape it at the sink or validate it against the shape the attribute accepts before interpolating.
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 element7.4 / 10Strong✓ Tool-verified

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.

  • This loop runs once per element of `texture.image`, and the statement it guards acts on the element it is on — `texture.image[i]`. The test deciding whether that statement runs does not: `!isCompressed && !isDataTexture` reads `texture.image[0]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts — the fixed one at line 1493, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out. — src/renderers/webgl/WebGLTextures.js:1500
  • This loop runs once per element of `texture.image`, and the statement it guards acts on the element it is on — `texture.image[i]`. The test deciding whether that statement runs does not: `isDataTexture` reads `texture.image[0]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts — the fixed one at line 1494, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out. — src/renderers/webgl/WebGLTextures.js:1506
  • This loop runs once per element of `texture.image`, and the statement it guards acts on the element it is on — `texture.image[i]`. The test deciding whether that statement runs does not: `!isCompressed && !isDataTexture` reads `texture.image[0]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts — the fixed one at line 12308, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out. — build/three.module.js:12315
  • This loop runs once per element of `texture.image`, and the statement it guards acts on the element it is on — `texture.image[i]`. The test deciding whether that statement runs does not: `isDataTexture` reads `texture.image[0]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts — the fixed one at line 12309, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out. — build/three.module.js:12321

What to do

  • Each finding names the test and the statement it guards, which index the same collection at two different subscripts — one fixed, one the loop variable. Confirm from the two, then decide which subscript the test meant. If it was meant to be per-element, give it the loop variable so each element is judged on itself. If it really is one answer for the whole collection, hoist the test OUT of the loop, where a reader can see it is asked once and where it is not re-evaluated on every pass — leaving it inside, reading a fixed element, is the one arrangement that cannot be right under either reading.
X3 · Exception handling5.0 / 10Weak✓ 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.

  • 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. (×23) — tsl/js/utils/CodeEditorUtils.js:63, tsl/js/managers/PlaygroundManager.js:201, tsl/js/managers/PlaygroundManager.js:365, …
  • `.catch(function(){})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it. — manual/resources/tools/geo-picking/shapefile.js:441
  • `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it. (×7) — devtools/background.js:21, devtools/background.js:22, devtools/background.js:23, …

What to do

  • Swallowed exception (empty catch)
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.

WCAG coverage — what static analysis assessed

Statically assessed 15 of 55 WCAG 2.2 Level A/AA success criteria (27%; ≈30% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 40 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).

DimensionWCAG 2.2 A/AA criteriaCoverage
AC1 · Text alternatives1.1.1, 1.2.2, 1.2.5Partial signal
AC2 · Forms & labels1.3.1, 3.3.2, 4.1.2Partial signal
AC3 · Page structure1.4.4, 2.2.1, 2.4.1, 2.4.2, 3.1.1, 4.1.2Partial signal
AC4 · Keyboard semantics2.1.1, 2.4.3Partial signal
AC6 · Visual & motion safety1.4.3, 2.4.7Partial — literal CSS only

Not statically assessed — these 40 Level A/AA criteria need runtime or manual evaluation (WCAG-EM): 1.2.1, 1.2.3, 1.2.4, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.4.1, 1.4.2, 1.4.5, 1.4.10, 1.4.11, 1.4.12, 1.4.13, 2.1.2, 2.1.4, 2.2.2, 2.3.1, 2.4.4, 2.4.5, 2.4.6, 2.4.11, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.7, 2.5.8, 3.1.2, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.6, 3.3.1, 3.3.3, 3.3.4, 3.3.7, 3.3.8, 4.1.3.

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 Health35%Weak — gated by D1, D2, R1, R2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture87%Adequate — gated by D26Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity71%StrongSolid.
Readiness56%Adequate — gated by P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security64%Adequate — gated by D29Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility29%Weak — gated by AC1, AC3, AC4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance85%StrongStrongest area.
Unscored — 3 check(s) recorded observations but carry no score

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

  • X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X6 Hand-rolled structured-format parsing — 4 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 — 2 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.

  • P4 Deployment & Rollback — not evidenced — no deploy/rollback/approval signal in the repo; absence of evidence is not evidence of a manual release
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 62 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.

  • AC5 ARIA correctness — No ARIA usage found in the parsed markup — AC5 not applicable here.
  • AX1 Captive dependencies — Not applicable: this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX2 Stateful singletons — Not applicable: TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) 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
  • AX6 Interface segregation — not assessed — interface segregation is computed over a type surface 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
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — the dev server (`npm run dev`) kept running but served no page within 2 minutes. Likely cause (not identified): the dev server kept running but no port it opened served a page in the time allowed. Last output: "> three@0.187.0 dev / > node utils/build/dev.js && node REDACTED -p 8080 / Server running at http://localhost:8080/ / http://172.31.7.10:8080/ / Press Ctrl+C to stop." No runtime evidence was gathered. This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entity, a Mongoose schema, a Sequelize or Drizzle table, a Knex migration or a Prisma model — and no database or data-store client in the source either, so this repository keeps no data at rest for these controls to protect. If it does persist personal data (through a hosted backend configured outside this repository, for instance), the controls belong to wherever that data is stored.
  • C2 Access Controls — No access-control surface detected in the analyzed source — this repository stands up no server (no Express, Fastify, Koa, Hono, NestJS or similar app, no Next.js/SvelteKit/Nuxt server route, no edge function), creates no Supabase tables and talks to no hosted backend. Access control is therefore N/A here — a browser application or library is authorized by the server it calls, not by itself; a client-side route guard hides a page and authorizes nothing. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
  • C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entity, a Mongoose schema, a Sequelize or Drizzle table, a Knex migration or a Prisma model — and no database or data-store client in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a hosted backend configured outside this repository, for instance), the trail belongs to wherever that data is stored.
  • C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entity, a Mongoose schema, a Sequelize or Drizzle table, a Knex migration or a Prisma model — and no database or data-store client in the source either, so this repository keeps no personal data whose lifetime a retention limit would bound. If it does (through a hosted backend configured outside this repository, for instance), the limit belongs wherever that data is stored.
  • C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entity, a Mongoose schema, a Sequelize or Drizzle table, a Knex migration or a Prisma model — and no database or data-store client in the source either, so this repository keeps no personal data for a data subject to erase, export or consent over. If it does (through a hosted backend configured outside this repository, for instance), the rights are served wherever that data is stored.
  • D10 Test Quality — No tests were found in the analyzed repository to assess for quality.
  • D11 Test Reliability — No test suite was found to re-run, so reliability couldn't be assessed. Two searches produced that zero and both came back empty: the classifier that reads the loaded workspace recognised no suite it could run, and a walk of the source on disk — which covers the JS/TS `*.test.*` and `*.spec.*` conventions and probes for a Pester suite — found no test source in any other ecosystem either. Neither search reaches a suite that is missing from the loaded workspace and carries no name either walk recognises, so this is 'no suite found by those two searches', not a verdict that the repository has none.
  • D12 Dependency Hygiene — Dependency currency not established — this repository declares no production dependency to grade
  • D14 License Compliance — Vendored third-party code's licences not graded — D14 grades declared npm dependencies only
  • D17 Explicit Debt — explicit-debt markers are read through a C# workspace today, so they were not read for this repository's language — this asserts nothing about how many markers the code carries. Not scored — this is a gap in the analyzer, not a finding about this repository
  • 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.
  • D21 Naming Consistency — Naming consistency is measured on C# and TypeScript only; JavaScript, html not measured.
  • D22 Internal API Consistency — API consistency is measured on C# only; the exposed JavaScript surface was not measured.
  • 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+ sibling projects each declaring an entity of their own or taking another project's integration events. 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"]`.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — symbol resolution incomplete — navigability not assessed
  • 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) — 8 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D36 Supply-chain Provenance & Signing — The CI pipeline publishes no artifact — no package publish, container push or release with files to download. Supply-chain provenance, signing and an SBOM describe a PUBLISHED artifact for the people who obtain it, so there is nothing to attest here; a deployment of the service itself publishes nothing for anyone else to verify. Add them to the release pipeline when this repo starts publishing artifacts (a package, a container image, or a release with downloadable files). Build integrity and workflow-token hygiene are reported below: they describe what the CI runs and the token it runs with, neither of which is affected by whether the pipeline ships an artifact.
  • D4 Code Duplication — Duplication not measured — .html not exposed to the token comparison
  • 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.
  • D44 Platform End-of-Life — Platform end-of-life not assessed — this repository declares no platform this pass reads
  • D5 Coupling — Not applicable — this npm build ships 1 production module(s), so there is no coupling BETWEEN modules to measure. (Its test and non-production modules are not part of the shipped graph.)
  • 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 measured — JavaScript/TypeScript suite
  • DM1 Domain Modelling — not scored — this repository shows none of the 3 signals this lens looks for
  • ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • M4 Documentation accuracy — Not applicable: the 200 current-state document(s) make no claim of a kind M4 checks. 5 claim(s) of kinds M4 does not check were not checked (path 2, environment variable 3); M4 checks only links and versions and artefact counts.
  • 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'.
  • 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 — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for tinybench, mitata, benchmark.js, benny or vitest `bench(...)` calls in files that import them (or `*.bench.*` files), or one of those in a package.json, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X26 Unsynchronised callback handoff — Not applicable: this check looks for a collection written by a callback on one thread while the body waiting on it touches it on another, and in this repository's languages no collection is reachable from two threads at once. TypeScript/JavaScript runs every callback on the one thread that owns its objects: a callback runs only when the body waiting on it has yielded, never alongside it, and a worker thread receives a COPY of what it is sent. A SharedArrayBuffer carries raw bytes, never an Array, Map or Set, so no collection is reachable from two threads at once. Not a gap in the analyzer and not a finding about your code.
  • X27 Collection changed while being enumerated — Not applicable: this check looks for a loop whose body adds to or removes from the very collection the loop is walking, invalidating the enumerator it holds, and in this repository's languages that cannot happen. JavaScript and TypeScript have no iterator that a change can invalidate: an `Array` is walked by index against its live length, and a `Map` or `Set` by the ECMAScript specification's live entry list, so a body that adds to, removes from or empties what it walks raises nothing — every loop form (`for…of`, `for…in`, `forEach`, `map`, `filter`, `reduce`, `entries()`) on every built-in collection (`Array`, `Map`, `Set`, plain objects, `URLSearchParams`, `Headers`, `FormData`) runs to completion. Such a loop can still skip an element or never end, which is a different defect and not the one this check asks about. Not a gap in the analyzer and not a finding about your code.
  • 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 — 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
  • X5 Nullable reference types — Not applicable: this check asks whether the null-typed discipline a language offers is switched on, and how much of that the assertion operator takes back, and in this repository's languages there is no such switch and no such operator. Plain JavaScript carries no type annotations and commits no tsconfig, so it states no null-typed discipline for this check to grade: there is nothing here that switches null checking on or off, and TypeScript (or `// @ts-check`) is how a repository acquires one — advice, not a defect this card measures. Not a gap in the analyzer and not a finding about your code.
  • 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 — 83 finding(s)
AC1 · Text alternatives · <img> without a text alternative · ×37
  • <img> without a text alternative REDACTED:189 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative REDACTED:308 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative REDACTED:352 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative manual/pages/backgrounds.html:139 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative manual/pages/backgrounds.html:140 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative manual/pages/backgrounds.html:141 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative manual/pages/backgrounds.html:144 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative manual/pages/backgrounds.html:145 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative manual/pages/backgrounds.html:146 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative manual/pages/backgrounds.html:217 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative manual/pages/billboards.html:77 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative manual/pages/cameras.html:57 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative manual/pages/cameras.html:333 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative manual/pages/cameras.html:544 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative manual/pages/custom-buffergeometry.html:34 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative manual/pages/custom-buffergeometry.html:41 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative manual/pages/debugging-glsl.html:59 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative manual/pages/debugging-glsl.html:68 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative manual/pages/debugging-glsl.html:87 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative manual/pages/debugging-javascript.html:47 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative manual/pages/debugging-javascript.html:51 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative manual/pages/debugging-javascript.html:55 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative manual/pages/debugging-javascript.html:58 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative manual/pages/debugging-javascript.html:76 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative manual/pages/debugging-javascript.html:79 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • + 12 more in this group — see findings.md.
AC3 · Page structure · <iframe> without a title · ×21
  • <iframe> without a title manual/index.html:43 — An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
  • <iframe> without a title REDACTED:181 — An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
  • <iframe> without a title REDACTED:254 — An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
  • <iframe> without a title REDACTED:339 — An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
  • <iframe> without a title REDACTED:502 — An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
  • <iframe> without a title REDACTED:695 — An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
  • <iframe> without a title manual/pages/backgrounds.html:60 — An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
  • <iframe> without a title manual/pages/backgrounds.html:77 — An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
  • <iframe> without a title manual/pages/backgrounds.html:113 — An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
  • <iframe> without a title manual/pages/backgrounds.html:208 — An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
  • <iframe> without a title manual/pages/backgrounds.html:242 — An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
  • <iframe> without a title manual/pages/billboards.html:70 — An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
  • <iframe> without a title manual/pages/billboards.html:96 — An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
  • <iframe> without a title manual/pages/billboards.html:166 — An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
  • <iframe> without a title manual/pages/billboards.html:293 — An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
  • <iframe> without a title manual/pages/cameras.html:101 — An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
  • <iframe> without a title manual/pages/cameras.html:273 — An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
  • <iframe> without a title manual/pages/cameras.html:325 — An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
  • <iframe> without a title manual/pages/cameras.html:347 — An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
  • <iframe> without a title manual/pages/cameras.html:417 — An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
  • <iframe> without a title manual/pages/cameras.html:536 — An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
AC3 · Page structure · Viewport restricts zoom · ×9
  • Viewport restricts zoom editor/index.html:6 — user-scalable=no/0 or a maximum-scale below 2 stops low-vision users zooming to 200%. Remove the zoom restriction from the viewport meta.
  • Viewport restricts zoom editor/js/libs/app/index.html:7 — user-scalable=no/0 or a maximum-scale below 2 stops low-vision users zooming to 200%. Remove the zoom restriction from the viewport meta.
  • Viewport restricts zoom manual/index.html:6 — user-scalable=no/0 or a maximum-scale below 2 stops low-vision users zooming to 200%. Remove the zoom restriction from the viewport meta.
  • Viewport restricts zoom REDACTED:4 — user-scalable=no/0 or a maximum-scale below 2 stops low-vision users zooming to 200%. Remove the zoom restriction from the viewport meta.
  • Viewport restricts zoom manual/pages/animation-system.html:4 — user-scalable=no/0 or a maximum-scale below 2 stops low-vision users zooming to 200%. Remove the zoom restriction from the viewport meta.
  • Viewport restricts zoom manual/pages/backgrounds.html:4 — user-scalable=no/0 or a maximum-scale below 2 stops low-vision users zooming to 200%. Remove the zoom restriction from the viewport meta.
  • Viewport restricts zoom manual/pages/billboards.html:4 — user-scalable=no/0 or a maximum-scale below 2 stops low-vision users zooming to 200%. Remove the zoom restriction from the viewport meta.
  • Viewport restricts zoom manual/pages/cameras.html:4 — user-scalable=no/0 or a maximum-scale below 2 stops low-vision users zooming to 200%. Remove the zoom restriction from the viewport meta.
  • Viewport restricts zoom manual/pages/canvas-textures.html:4 — user-scalable=no/0 or a maximum-scale below 2 stops low-vision users zooming to 200%. Remove the zoom restriction from the viewport meta.
AC2 · Forms & labels · Link with no accessible name · ×3
  • Link with no accessible name manual/pages/custom-buffergeometry.html:435 — A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
  • Link with no accessible name manual/pages/fundamentals.html:437 — A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
  • Link with no accessible name manual/pages/fundamentals.html:438 — A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC2 · Forms & labels · <input> without a programmatic label · ×2
  • <input> without a programmatic label manual/index.html:34 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label REDACTED:305 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
AC2 · Forms & labels · <button> with no accessible text · ×2
  • <button> with no accessible text tsl/index.html:65 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text tsl/index.html:94 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
AC3 · Page structure · <html> without a lang · ×1
  • <html> without a lang devtools/panel/panel.html:2 — The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D35 · Change Coupling · Boundary-crossing change coupling · ×1
  • Boundary-crossing change coupling: PhysicalLightingModel.js ↔ lights_physical_pars_fragment.glsl.js src/nodes/functions/PhysicalLightingModel.js:1 — `src/nodes/functions/PhysicalLightingModel.js` (context nodes) and `src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js` (context renderers) sit in DIFFERENT parts of the tree yet change together 50% of the time (15 of the 30 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 15 shared commits counted here, the most recent 3 are `3fd3e4ec` Docs: Fix dead links in JSDoc comments and manual. (#35301); `18e109a6` MeshPhysicalMaterial: Add EON rough diffuse BRDF (#34379); `3fce9681` Src: Improve retroreflection nomenclature (#34079) — run `git show` on any of them.
R8 · Dependency Hygiene · Unlisted import 'acorn' · ×1
  • Unlisted import 'acorn' editor/js/libs/acorn/acorn-loose.js:2 — Imported but not declared in any reachable package.json — installs work only by hoisting accident.
R8 · Dependency Hygiene · Unlisted import 'marked' · ×1
  • Unlisted import 'marked' tsl/js/utils/MarkdownUtils.js:1 — Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Serious — 1387 finding(s)
D15 · Churn × Complexity Hotspots · Hotspot · ×68
  • Hotspot: src/renderers/WebGLRenderer.js src/renderers/WebGLRenderer.js:71 — src/renderers/WebGLRenderer.js changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 456 in WebGLRenderer.constructor at line 71. 3 of those changes were fix/bug commits, and the other 16 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:38:01 +01:00' --until='2026-11-13 11:38:01 +01:00' --full-history --no-merges -- src/renderers/WebGLRenderer.js`: 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/renderers/webgl/WebGLTextures.js src/renderers/webgl/WebGLTextures.js:7 — src/renderers/webgl/WebGLTextures.js changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 444 in WebGLTextures.WebGLTextures at line 7. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:38:01 +01:00' --until='2026-11-13 11:38:01 +01:00' --full-history --no-merges -- src/renderers/webgl/WebGLTextures.js`: 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: examples/jsm/loaders/SVGLoader.js examples/jsm/loaders/SVGLoader.js:147 — examples/jsm/loaders/SVGLoader.js changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 273 in SVGLoader.parse at line 147. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:38:01 +01:00' --until='2026-11-13 11:38:01 +01:00' --full-history --no-merges -- examples/jsm/loaders/SVGLoader.js`: 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/materials/nodes/manager/NodeMaterialObserver.js src/materials/nodes/manager/NodeMaterialObserver.js:587 — src/materials/nodes/manager/NodeMaterialObserver.js changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 76 in NodeMaterialObserver.equals at line 587. 3 of those changes were fix/bug commits, and the other 14 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:38:01 +01:00' --until='2026-11-13 11:38:01 +01:00' --full-history --no-merges -- src/materials/nodes/manager/NodeMaterialObserver.js`: 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/renderers/webgl-fallback/WebGLBackend.js src/renderers/webgl-fallback/WebGLBackend.js:2384 — src/renderers/webgl-fallback/WebGLBackend.js changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in WebGLBackend._setFramebuffer at line 2384. 5 of those changes were fix/bug commits, and the other 21 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:38:01 +01:00' --until='2026-11-13 11:38:01 +01:00' --full-history --no-merges -- src/renderers/webgl-fallback/WebGLBackend.js`: 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: examples/jsm/loaders/VRMLLoader.js examples/jsm/loaders/VRMLLoader.js:121 — examples/jsm/loaders/VRMLLoader.js changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 404 in VRMLLoader.parse at line 121. 2 of those changes were fix/bug commits, so the churn is repair rather than feature work. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:38:01 +01:00' --until='2026-11-13 11:38:01 +01:00' --full-history --no-merges -- examples/jsm/loaders/VRMLLoader.js`: 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/loaders/ObjectLoader.js src/loaders/ObjectLoader.js:784 — src/loaders/ObjectLoader.js changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 103 in ObjectLoader.parseObject at line 784. 1 of those changes was a fix/bug commit, and the other 10 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:38:01 +01:00' --until='2026-11-13 11:38:01 +01:00' --full-history --no-merges -- src/loaders/ObjectLoader.js`: 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/renderers/common/Renderer.js src/renderers/common/Renderer.js:1989 — src/renderers/common/Renderer.js changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in Renderer._renderScene at line 1989. 7 of those changes were fix/bug commits, and the other 25 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:38:01 +01:00' --until='2026-11-13 11:38:01 +01:00' --full-history --no-merges -- src/renderers/common/Renderer.js`: 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/renderers/webgl/WebGLProgram.js src/renderers/webgl/WebGLProgram.js:372 — src/renderers/webgl/WebGLProgram.js changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 190 in WebGLProgram.WebGLProgram at line 372. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:38:01 +01:00' --until='2026-11-13 11:38:01 +01:00' --full-history --no-merges -- src/renderers/webgl/WebGLProgram.js`: 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/nodes/core/NodeBuilder.js src/nodes/core/NodeBuilder.js:1557 — src/nodes/core/NodeBuilder.js changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in NodeBuilder.generateConst at line 1557. 4 of those changes were fix/bug commits, and the other 21 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:38:01 +01:00' --until='2026-11-13 11:38:01 +01:00' --full-history --no-merges -- src/nodes/core/NodeBuilder.js`: 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/renderers/webgpu/WebGPUBackend.js src/renderers/webgpu/WebGPUBackend.js:893 — src/renderers/webgpu/WebGPUBackend.js changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in WebGPUBackend.beginRender at line 893. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:38:01 +01:00' --until='2026-11-13 11:38:01 +01:00' --full-history --no-merges -- src/renderers/webgpu/WebGPUBackend.js`: 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/renderers/common/Textures.js src/renderers/common/Textures.js:280 — src/renderers/common/Textures.js changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in Textures.updateTexture at line 280. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:38:01 +01:00' --until='2026-11-13 11:38:01 +01:00' --full-history --no-merges -- src/renderers/common/Textures.js`: 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: examples/jsm/loaders/EXRLoader.js examples/jsm/loaders/EXRLoader.js:140 — examples/jsm/loaders/EXRLoader.js changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 340 in EXRLoader.parse at line 140. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:38:01 +01:00' --until='2026-11-13 11:38:01 +01:00' --full-history --no-merges -- examples/jsm/loaders/EXRLoader.js`: 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: examples/jsm/loaders/PLYLoader.js examples/jsm/loaders/PLYLoader.js:146 — examples/jsm/loaders/PLYLoader.js changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 160 in PLYLoader.parse at line 146. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:38:01 +01:00' --until='2026-11-13 11:38:01 +01:00' --full-history --no-merges -- examples/jsm/loaders/PLYLoader.js`: 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: examples/jsm/tsl/display/SSRNode.js examples/jsm/tsl/display/SSRNode.js:829 — examples/jsm/tsl/display/SSRNode.js changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in SSRNode.setup at line 829. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:38:01 +01:00' --until='2026-11-13 11:38:01 +01:00' --full-history --no-merges -- examples/jsm/tsl/display/SSRNode.js`: 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/renderers/webgl-fallback/utils/WebGLTextureUtils.js src/renderers/webgl-fallback/utils/WebGLTextureUtils.js:857 — src/renderers/webgl-fallback/utils/WebGLTextureUtils.js changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in WebGLTextureUtils.copyTextureToTexture at line 857. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:38:01 +01:00' --until='2026-11-13 11:38:01 +01:00' --full-history --no-merges -- src/renderers/webgl-fallback/utils/WebGLTextureUtils.js`: 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/renderers/webgl/WebGLPrograms.js src/renderers/webgl/WebGLPrograms.js:54 — src/renderers/webgl/WebGLPrograms.js changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 100 in WebGLPrograms.WebGLPrograms.getParameters at line 54. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:38:01 +01:00' --until='2026-11-13 11:38:01 +01:00' --full-history --no-merges -- src/renderers/webgl/WebGLPrograms.js`: 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: examples/jsm/loaders/materialx/MaterialXDocument.js examples/jsm/loaders/materialx/MaterialXDocument.js:575 — examples/jsm/loaders/materialx/MaterialXDocument.js changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in MaterialXNode.getNode at line 575. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:38:01 +01:00' --until='2026-11-13 11:38:01 +01:00' --full-history --no-merges -- examples/jsm/loaders/materialx/MaterialXDocument.js`: 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: examples/jsm/loaders/3MFLoader.js examples/jsm/loaders/3MFLoader.js:133 — examples/jsm/loaders/3MFLoader.js changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 153 in ThreeMFLoader.parse at line 133. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:38:01 +01:00' --until='2026-11-13 11:38:01 +01:00' --full-history --no-merges -- examples/jsm/loaders/3MFLoader.js`: 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/nodes/core/Node.js src/nodes/core/Node.js:1129 — src/nodes/core/Node.js changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in Node.build at line 1129. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:38:01 +01:00' --until='2026-11-13 11:38:01 +01:00' --full-history --no-merges -- src/nodes/core/Node.js`: 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: REDACTED REDACTED:229 — REDACTED changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 99 in Guide.init at line 229. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:38:01 +01:00' --until='2026-11-13 11:38:01 +01:00' --full-history --no-merges -- REDACTED`: 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/objects/BatchedMesh.js src/objects/BatchedMesh.js:1578 — src/objects/BatchedMesh.js changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in BatchedMesh._updateDrawParameters at line 1578. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:38:01 +01:00' --until='2026-11-13 11:38:01 +01:00' --full-history --no-merges -- src/objects/BatchedMesh.js`: 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/renderers/webgpu/nodes/WGSLNodeBuilder.js src/renderers/webgpu/nodes/WGSLNodeBuilder.js:1387 — src/renderers/webgpu/nodes/WGSLNodeBuilder.js changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in WGSLNodeBuilder.getUniformFromNode at line 1387. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:38:01 +01:00' --until='2026-11-13 11:38:01 +01:00' --full-history --no-merges -- src/renderers/webgpu/nodes/WGSLNodeBuilder.js`: 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/materials/Material.js src/materials/Material.js:920 — src/materials/Material.js changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 164 in Material.fromJSON at line 920. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:38:01 +01:00' --until='2026-11-13 11:38:01 +01:00' --full-history --no-merges -- src/materials/Material.js`: 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: examples/jsm/utils/BufferGeometryUtils.js examples/jsm/utils/BufferGeometryUtils.js:157 — examples/jsm/utils/BufferGeometryUtils.js changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in BufferGeometryUtils.mergeGeometries at line 157. 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:38:01 +01:00' --until='2026-11-13 11:38:01 +01:00' --full-history --no-merges -- examples/jsm/utils/BufferGeometryUtils.js`: 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.
  • + 43 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×40
  • FunctionTooLong: WebGLTextures.WebGLTextures src/renderers/webgl/WebGLTextures.js:7 — FunctionTooLong — WebGLTextures runs 1068 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 968 over it, 10.68× 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.
  • FunctionTooLong: acorn.pp$8.regexp_disjunction editor/js/libs/acorn/acorn.js:3329 — FunctionTooLong — pp$8.regexp_disjunction runs 1056 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 956 over it, 10.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.
  • FunctionTooLong: WebGLState.WebGLState src/renderers/webgl/WebGLState.js:6 — FunctionTooLong — WebGLState runs 653 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 553 over it, 6.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.
  • FunctionTooLong: Loader.Loader editor/js/Loader.js:14 — FunctionTooLong — Loader runs 506 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 406 over it, 5.06× 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.
  • FunctionTooLong: WebGLPrograms.WebGLPrograms src/renderers/webgl/WebGLPrograms.js:16 — FunctionTooLong — WebGLPrograms runs 469 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 369 over it, 4.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.
  • FunctionTooLong: Viewport.Viewport editor/js/Viewport.js:25 — FunctionTooLong — Viewport runs 417 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 317 over it, 4.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.
  • FunctionTooLong: Sidebar.Object.SidebarObject editor/js/Sidebar.Object.js:14 — FunctionTooLong — SidebarObject runs 371 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 271 over it, 3.71× 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.
  • FunctionTooLong: WebGLProgram.WebGLProgram src/renderers/webgl/WebGLProgram.js:372 — FunctionTooLong — WebGLProgram runs 360 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 260 over it, 3.60× 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.
  • FunctionTooLong: Animation.Animation editor/js/Animation.js:5 — FunctionTooLong — Animation runs 332 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 232 over it, 3.32× 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.
  • FunctionTooLong: codemirror.addEditorMethods editor/js/libs/codemirror/codemirror.js:8270 — FunctionTooLong — addEditorMethods runs 322 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 222 over it, 3.22× 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.
  • FunctionTooLong: Sidebar.Scene.SidebarScene editor/js/Sidebar.Scene.js:6 — FunctionTooLong — SidebarScene runs 318 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 218 over it, 3.18× 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.
  • FunctionTooLong: Menubar.Add.MenubarAdd editor/js/Menubar.Add.js:11 — FunctionTooLong — MenubarAdd runs 313 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 213 over it, 3.13× 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.
  • FunctionTooLong: WebGLLights.WebGLLights src/renderers/webgl/WebGLLights.js:159 — FunctionTooLong — WebGLLights runs 300 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 200 over it, 3.00× 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.
  • FunctionTooLong: WebGLBindingStates.WebGLBindingStates src/renderers/webgl/WebGLBindingStates.js:3 — FunctionTooLong — WebGLBindingStates runs 285 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 185 over it, 2.85× 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.
  • FunctionTooLong: Sidebar.Material.SidebarMaterial editor/js/Sidebar.Material.js:15 — FunctionTooLong — SidebarMaterial runs 284 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 184 over it, 2.84× 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.
  • FunctionTooLong: WebGPUTextureUtils.getFormat src/renderers/webgpu/utils/WebGPUTextureUtils.js:1481 — FunctionTooLong — getFormat runs 277 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 177 over it, 2.77× 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.
  • FunctionTooLong: WebGLShadowMap.WebGLShadowMap src/renderers/webgl/WebGLShadowMap.js:35 — FunctionTooLong — WebGLShadowMap runs 274 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 174 over it, 2.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.
  • FunctionTooLong: Menubar.File.MenubarFile editor/js/Menubar.File.js:4 — FunctionTooLong — MenubarFile runs 272 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 172 over it, 2.72× 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.
  • FunctionTooLong: WebGLMaterials.WebGLMaterials src/renderers/webgl/WebGLMaterials.js:11 — FunctionTooLong — WebGLMaterials runs 248 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 148 over it, 2.48× 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.
  • FunctionTooLong: Script.Script editor/js/Script.js:8 — FunctionTooLong — Script runs 246 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 146 over it, 2.46× 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.
  • FunctionTooLong: WebGLPrograms.WebGLPrograms.getParameters src/renderers/webgl/WebGLPrograms.js:54 — FunctionTooLong — WebGLPrograms.getParameters runs 228 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 128 over it, 2.28× 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.
  • FunctionTooLong: WebGLLights.WebGLLights.setup src/renderers/webgl/WebGLLights.js:221 — FunctionTooLong — WebGLLights.setup runs 194 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 94 over it, 1.94× 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.
  • FunctionTooLong: WebGLUniformsGroups.WebGLUniformsGroups src/renderers/webgl/WebGLUniformsGroups.js:3 — FunctionTooLong — WebGLUniformsGroups runs 185 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 85 over it, 1.85× 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.
  • FunctionTooLong: Sidebar.Geometry.SidebarGeometry editor/js/Sidebar.Geometry.js:12 — FunctionTooLong — SidebarGeometry runs 160 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 60 over it, 1.60× 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.
  • FunctionTooLong: publish.publish utils/docs/template/publish.js:655 — FunctionTooLong — publish runs 160 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 60 over it, 1.60× 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.
  • + 15 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×35
  • FileTooLong: codemirror/codemirror.js editor/js/libs/codemirror/codemirror.js — FileTooLong — 6580 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 1500 significant lines; this is 5080 over it, 4.39× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: acorn/acorn.js editor/js/libs/acorn/acorn.js — FileTooLong — 3179 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 1500 significant lines; this is 1679 over it, 2.12× 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: ternjs/infer.js editor/js/libs/ternjs/infer.js — FileTooLong — 1614 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 1500 significant lines; this is 114 over it, 1.08× 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: renderers/WebGLRenderer.js src/renderers/WebGLRenderer.js — FileTooLong — 1452 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: WebGLRenderer (64-3714). The bar is 500 significant lines; this is 952 over it, 2.90× 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: webgpu/WebGPUBackend.js src/renderers/webgpu/WebGPUBackend.js — FileTooLong — 1386 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: WebGPUBackend (58-3582). The bar is 500 significant lines; this is 886 over it, 2.77× 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: REDACTED REDACTED — FileTooLong — 1347 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 847 over it, 2.69× 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: common/Renderer.js src/renderers/common/Renderer.js — FileTooLong — 1261 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: Renderer (129-4212). The bar is 500 significant lines; this is 761 over it, 2.52× 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: webgl/WebGLTextures.js src/renderers/webgl/WebGLTextures.js — FileTooLong — 1074 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: WebGLTextures (7-2569). 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: core/NodeBuilder.js src/nodes/core/NodeBuilder.js — FileTooLong — 1073 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units), about 91% of them inside a single declaration: NodeBuilder (175-3874). The bar is 500 significant lines; this is 573 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: acorn/acorn-loose.js editor/js/libs/acorn/acorn-loose.js — FileTooLong — 1052 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 552 over it, 2.10× 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: webgl-fallback/WebGLBackend.js src/renderers/webgl-fallback/WebGLBackend.js — FileTooLong — 1009 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: WebGLBackend (28-2961). The bar is 500 significant lines; this is 509 over it, 2.02× 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: nodes/WGSLNodeBuilder.js src/renderers/webgpu/nodes/WGSLNodeBuilder.js — FileTooLong — 991 significant lines (blank, comment-only and punctuation-only lines excluded), about 79% of them inside a single declaration: WGSLNodeBuilder (300-2890). The bar is 500 significant lines; this is 491 over it, 1.98× 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: materialx/MaterialXNoise.js src/nodes/materialx/MaterialXNoise.js — FileTooLong — 942 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 442 over it, 1.88× 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: utils/WebGPUTextureUtils.js src/renderers/webgpu/utils/WebGPUTextureUtils.js — FileTooLong — 916 significant lines (blank, comment-only and punctuation-only lines excluded), about 62% of them inside a single declaration: WebGPUTextureUtils (91-1472). The bar is 500 significant lines; this is 416 over it, 1.83× 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: REDACTED REDACTED — FileTooLong — 875 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 375 over it, 1.75× 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: ternjs/tern.js editor/js/libs/ternjs/tern.js — FileTooLong — 856 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 356 over it, 1.71× 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: utils/MarkdownUtils.js tsl/js/utils/MarkdownUtils.js — FileTooLong — 774 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 274 over it, 1.55× 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: objects/BatchedMesh.js src/objects/BatchedMesh.js — FileTooLong — 730 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units), about 90% of them inside a single declaration: BatchedMesh (188-1822). The bar is 500 significant lines; this is 230 over it, 1.46× 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: common/XRManager.js src/renderers/common/XRManager.js — FileTooLong — 723 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units), about 67% of them inside a single declaration: XRManager (30-1468). The bar is 500 significant lines; this is 223 over it, 1.45× 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: resources/threejs-primitives.js manual/resources/threejs-primitives.js — FileTooLong — 723 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 223 over it, 1.45× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: nodes/GLSLNodeBuilder.js src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js — FileTooLong — 683 significant lines (blank, comment-only and punctuation-only lines excluded), about 81% of them inside a single declaration: GLSLNodeBuilder (176-1982). The bar is 500 significant lines; this is 183 over it, 1.37× 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: webgl/WebGLState.js src/renderers/webgl/WebGLState.js — FileTooLong — 658 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: WebGLState (6-1369). The bar is 500 significant lines; this is 158 over it, 1.32× 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: managers/PlaygroundManager.js tsl/js/managers/PlaygroundManager.js — FileTooLong — 643 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: PlaygroundManager (6-1294). The bar is 500 significant lines; this is 143 over it, 1.29× 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: utils/WebGLTextureUtils.js src/renderers/webgl-fallback/utils/WebGLTextureUtils.js — FileTooLong — 620 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: WebGLTextureUtils (13-1440). The bar is 500 significant lines; this is 120 over it, 1.24× 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: loaders/ObjectLoader.js src/loaders/ObjectLoader.js — FileTooLong — 617 significant lines (blank, comment-only and punctuation-only lines excluded), about 87% of them inside a single declaration: ObjectLoader (85-1308). The bar is 500 significant lines; this is 117 over it, 1.23× 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.
  • + 10 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×34
  • MethodTooLong: WebGLRenderer.constructor src/renderers/WebGLRenderer.js:71 — MethodTooLong — constructor runs 1384 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1284 over it, 13.84× 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: WebXRManager.constructor src/renderers/webxr/WebXRManager.js:33 — MethodTooLong — constructor runs 372 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 272 over it, 3.72× 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: ObjectLoader.parseObject src/loaders/ObjectLoader.js:784 — MethodTooLong — parseObject 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: EditorControls.constructor editor/js/EditorControls.js:5 — MethodTooLong — constructor runs 210 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 110 over it, 2.10× 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: PlaygroundManager.renderPlaygroundTabs tsl/js/managers/PlaygroundManager.js:265 — MethodTooLong — renderPlaygroundTabs runs 210 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 110 over it, 2.10× 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: Material.toJSON src/materials/Material.js:610 — MethodTooLong — toJSON 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: CodeRunner.run REDACTED:897 — MethodTooLong — run runs 159 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 59 over it, 1.59× 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: NodeMaterialObserver.equals src/materials/nodes/manager/NodeMaterialObserver.js:587 — MethodTooLong — equals 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: RenderVideoDialog.constructor editor/js/Menubar.Render.js:342 — MethodTooLong — constructor runs 148 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 48 over it, 1.48× 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: LayoutManager.setupResizer tsl/js/managers/LayoutManager.js:116 — MethodTooLong — setupResizer runs 148 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 48 over it, 1.48× 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: WebGLBackend._setFramebuffer src/renderers/webgl-fallback/WebGLBackend.js:2384 — MethodTooLong — _setFramebuffer runs 146 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 46 over it, 1.46× 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: MaterialNode.setup src/nodes/accessors/MaterialNode.js:120 — MethodTooLong — setup runs 142 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 42 over it, 1.42× 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: Object3D.toJSON src/core/Object3D.js:1302 — MethodTooLong — toJSON runs 140 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 40 over it, 1.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: Material.fromJSON src/materials/Material.js:920 — MethodTooLong — fromJSON runs 140 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 40 over it, 1.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: RenderImageDialog.constructor editor/js/Menubar.Render.js:76 — MethodTooLong — constructor runs 137 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 37 over it, 1.37× 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: Renderer._renderScene src/renderers/common/Renderer.js:1989 — MethodTooLong — _renderScene runs 134 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 34 over it, 1.34× 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: CodeRunner.load REDACTED:584 — MethodTooLong — load runs 129 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 29 over it, 1.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: WebGPUPipelineUtils.createRenderPipeline src/renderers/webgpu/utils/WebGPUPipelineUtils.js:71 — MethodTooLong — createRenderPipeline runs 126 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 26 over it, 1.26× 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: WebGLTextureUtils.copyTextureToTexture src/renderers/webgl-fallback/utils/WebGLTextureUtils.js:857 — MethodTooLong — copyTextureToTexture runs 124 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 24 over it, 1.24× 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: PolyhedronGeometry.constructor src/geometries/PolyhedronGeometry.js:23 — MethodTooLong — constructor runs 121 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 21 over it, 1.21× 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: WebGPUBackend.beginRender src/renderers/webgpu/WebGPUBackend.js:893 — MethodTooLong — beginRender runs 119 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 19 over it, 1.19× 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: XR.constructor editor/js/Viewport.XR.js:10 — MethodTooLong — constructor runs 112 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 12 over it, 1.12× 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: TextureParametersDialog.constructor editor/js/TextureParametersDialog.js:8 — MethodTooLong — constructor runs 109 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 9 over it, 1.09× 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: WebGLBackend.draw src/renderers/webgl-fallback/WebGLBackend.js:1214 — MethodTooLong — draw runs 109 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 9 over it, 1.09× 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: WebGLUtils.convert src/renderers/webgl-fallback/utils/WebGLUtils.js:51 — MethodTooLong — convert runs 109 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 9 over it, 1.09× 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.
  • + 9 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (empty catch) · ×31
  • Swallowed exception (empty catch) tsl/js/utils/CodeEditorUtils.js:63 — 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) tsl/js/managers/PlaygroundManager.js:201 — 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) tsl/js/managers/PlaygroundManager.js:365 — 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/renderers/webgpu/utils/WebGPUTextureUtils.js:1032 — 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/renderers/webgl/WebGLTextures.js:34 — 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) manual/resources/tools/geo-picking/shapefile.js:441 — `.catch(function(){})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) editor/js/Loader.js:52 — 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) editor/js/Loader.js:397 — 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) editor/js/Loader.js:447 — 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) editor/js/Loader.js:1078 — 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) editor/js/Loader.js:1120 — 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) editor/js/Script.js:217 — 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) editor/js/Sidebar.Material.MapProperty.js:130 — 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) editor/js/libs/ui.js:507 — 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) editor/js/libs/codemirror/codemirror.js:144 — 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) editor/js/libs/codemirror/codemirror.js:689 — 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) editor/js/libs/codemirror/codemirror.js:6601 — 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) editor/js/libs/codemirror/codemirror.js:8952 — 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) editor/js/libs/codemirror/codemirror.js:9506 — 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) editor/js/libs/codemirror/codemirror.js:9732 — 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) editor/js/libs/acorn/acorn-loose.js:223 — 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) editor/js/libs/acorn/acorn.js:4599 — 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) devtools/background.js:21 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) devtools/background.js:22 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) devtools/background.js:23 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • + 6 more in this group — see findings.md.
D3 · God Classes · TooManyMethods · ×24
  • TooManyMethods: NodeBuilder src/nodes/core/NodeBuilder.js:175 — TooManyMethods — 146 methods. The bar is 30 methods; this is 116 over it, 4.87× 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: Renderer src/renderers/common/Renderer.js:129 — 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: WGSLNodeBuilder src/renderers/webgpu/nodes/WGSLNodeBuilder.js:300 — TooManyMethods — 81 methods. The bar is 30 methods; this is 51 over it, 2.70× 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: Vector3 src/math/Vector3.js:29 — TooManyMethods — 75 methods. The bar is 30 methods; this is 45 over it, 2.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: WebGPUBackend src/renderers/webgpu/WebGPUBackend.js:58 — TooManyMethods — 72 methods. The bar is 30 methods; this is 42 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.
  • TooManyMethods: Backend src/renderers/common/Backend.js:20 — 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: WebGLBackend src/renderers/webgl-fallback/WebGLBackend.js:28 — TooManyMethods — 70 methods. The bar is 30 methods; this is 40 over it, 2.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: GLSLNodeBuilder src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js:176 — TooManyMethods — 62 methods. The bar is 30 methods; this is 32 over it, 2.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Vector2 src/math/Vector2.js:28 — TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Vector4 src/math/Vector4.js:27 — TooManyMethods — 50 methods. The bar is 30 methods; this is 20 over it, 1.67× 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: Node src/nodes/core/Node.js:22 — TooManyMethods — 49 methods. The bar is 30 methods; this is 19 over it, 1.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.
  • TooManyMethods: Object3D src/core/Object3D.js:72 — TooManyMethods — 48 methods. The bar is 30 methods; this is 18 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Matrix4 src/math/Matrix4.js:42 — TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Color src/math/Color.js:88 — TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: BatchedMesh src/objects/BatchedMesh.js:188 — TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.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: WebGLState src/renderers/webgl-fallback/utils/WebGLState.js:27 — TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.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: TextureNode src/nodes/accessors/TextureNode.js:25 — TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.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.
  • TooManyMethods: Box3 src/math/Box3.js:6 — TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.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: Quaternion src/math/Quaternion.js:19 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.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: BufferAttribute src/core/BufferAttribute.js:21 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.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: BufferGeometry src/core/BufferGeometry.js:50 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.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: XRManager src/renderers/common/XRManager.js:30 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.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: AnimationAction src/animation/AnimationAction.js:7 — TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.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: NodeManager src/renderers/common/nodes/NodeManager.js:28 — TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.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.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D3 · God Classes · ClassTooLong · ×19
  • ClassTooLong: WebGLRenderer src/renderers/WebGLRenderer.js:64 — ClassTooLong — 1394 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 994 over it, 3.49× 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: WebGPUBackend src/renderers/webgpu/WebGPUBackend.js:58 — ClassTooLong — 1345 significant lines (blank, comment-only and punctuation-only lines excluded), 72 methods. The bar is 400 significant lines; this is 945 over it, 3.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: Renderer src/renderers/common/Renderer.js:129 — ClassTooLong — 1200 significant lines (blank, comment-only and punctuation-only lines excluded), 97 methods. The bar is 400 significant lines; this is 800 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.
  • ClassTooLong: WebGLTextures src/renderers/webgl/WebGLTextures.js:1 — ClassTooLong — 1068 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 668 over it, 2.67× 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: WebGLBackend src/renderers/webgl-fallback/WebGLBackend.js:28 — ClassTooLong — 991 significant lines (blank, comment-only and punctuation-only lines excluded), 70 methods. The bar is 400 significant lines; this is 591 over it, 2.48× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: WGSLNodeBuilder src/renderers/webgpu/nodes/WGSLNodeBuilder.js:300 — ClassTooLong — 780 significant lines (blank, comment-only and punctuation-only lines excluded), 81 methods. The bar is 400 significant lines; this is 380 over it, 1.95× 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: WebGLState src/renderers/webgl/WebGLState.js:1 — ClassTooLong — 653 significant lines (blank, comment-only and punctuation-only lines excluded), 56 methods. The bar is 400 significant lines; this is 253 over it, 1.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: PlaygroundManager tsl/js/managers/PlaygroundManager.js:6 — ClassTooLong — 638 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 238 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: WebGLState src/renderers/webgl-fallback/utils/WebGLState.js:27 — ClassTooLong — 601 significant lines (blank, comment-only and punctuation-only lines excluded), 36 methods. The bar is 400 significant lines; this is 201 over it, 1.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: GLSLNodeBuilder src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js:176 — ClassTooLong — 551 significant lines (blank, comment-only and punctuation-only lines excluded), 62 methods. The bar is 400 significant lines; this is 151 over it, 1.38× 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: ObjectLoader src/loaders/ObjectLoader.js:85 — ClassTooLong — 535 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods. The bar is 400 significant lines; this is 135 over it, 1.34× 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: Matrix4 src/math/Matrix4.js:42 — ClassTooLong — 528 significant lines (blank, comment-only and punctuation-only lines excluded), 38 methods. The bar is 400 significant lines; this is 128 over it, 1.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: Loader editor/js/Loader.js:1 — ClassTooLong — 506 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 106 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: WebGLPrograms src/renderers/webgl/WebGLPrograms.js:1 — ClassTooLong — 469 significant lines (blank, comment-only and punctuation-only lines excluded), 12 methods. The bar is 400 significant lines; this is 69 over it, 1.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: BufferGeometry src/core/BufferGeometry.js:50 — ClassTooLong — 464 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods. The bar is 400 significant lines; this is 64 over it, 1.16× 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: Material src/materials/Material.js:19 — ClassTooLong — 450 significant lines (blank, comment-only and punctuation-only lines excluded), 10 methods. The bar is 400 significant lines; this is 50 over it, 1.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.
  • ClassTooLong: Object3D src/core/Object3D.js:72 — ClassTooLong — 448 significant lines (blank, comment-only and punctuation-only lines excluded), 48 methods. The bar is 400 significant lines; this is 48 over it, 1.12× 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: WebGPUPipelineUtils src/renderers/webgpu/utils/WebGPUPipelineUtils.js:34 — ClassTooLong — 448 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. The bar is 400 significant lines; this is 48 over it, 1.12× 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: Viewport editor/js/Viewport.js:1 — ClassTooLong — 417 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 17 over it, 1.04× 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×18
  • Low cohesion: NodeBuilder (LCOM4 9) src/nodes/core/NodeBuilder.js:175 — NodeBuilder'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: Loader (LCOM4 8) src/loaders/Loader.js:8 — Loader'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: ColladaComposer (LCOM4 7) examples/jsm/loaders/collada/ColladaComposer.js:48 — ColladaComposer'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: WebGPUBackend (LCOM4 7) src/renderers/webgpu/WebGPUBackend.js:58 — WebGPUBackend'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: OctreeCell (LCOM4 5) examples/jsm/misc/SculptorMesh.js:319 — OctreeCell'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: Value (LCOM4 5) examples/jsm/inspector/ui/Values.js:3 — Value'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: WebGLNodesHandler (LCOM4 5) examples/jsm/tsl/WebGLNodesHandler.js:270 — WebGLNodesHandler'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: PropertyMixer (LCOM4 5) src/animation/PropertyMixer.js:6 — PropertyMixer'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: LightsNode (LCOM4 5) src/nodes/lighting/LightsNode.js:87 — LightsNode'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: WebGLState (LCOM4 5) src/renderers/webgl-fallback/utils/WebGLState.js:27 — WebGLState'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: WebGLTextureUtils (LCOM4 5) src/renderers/webgl-fallback/utils/WebGLTextureUtils.js:13 — WebGLTextureUtils'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: UIInteger (LCOM4 4) editor/js/libs/ui.js:762 — UIInteger'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: BitonicSort (LCOM4 4) examples/jsm/gpgpu/BitonicSort.js:63 — BitonicSort'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: LOD (LCOM4 4) src/objects/LOD.js:33 — LOD'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: GLBufferAttribute (LCOM4 4) src/core/GLBufferAttribute.js:12 — GLBufferAttribute'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: Node (LCOM4 4) src/nodes/core/Node.js:22 — Node'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: StorageBufferNode (LCOM4 4) src/nodes/accessors/StorageBufferNode.js:39 — StorageBufferNode'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: WebGLBackend (LCOM4 4) src/renderers/webgl-fallback/WebGLBackend.js:28 — WebGLBackend'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.
R4 · Test Coverage · No test reaches this file · ×16
  • No test reaches this file utils/changelog.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file utils/llms/build.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file devtools/bridge.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file devtools/highlight.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file utils/generateDFGLUT.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file devtools/preview.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file utils/packLDrawModel.mjs:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file utils/generatePMREM.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file tsl/js/imports/scripts/scenes/shaderball.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file utils/generateMaterialXNodeInterfaceRegistry.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file tsl/js/imports/scripts/scenes/plane.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file manual/resources/threejs-post-processing-3dlut.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file tsl/js/imports/scripts/scenes/empty.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file devtools/background.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file devtools/content-script.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file manual/resources/tools/geo-picking/make-geo-picking-texture-ogc.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
AC6 · Visual & motion safety · Animation without a prefers-reduced-motion guard · ×15
  • Animation without a prefers-reduced-motion guard tsl/css/guide.css:273 — `.page-transition` moves (`animation: fadeIn 0.3s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard tsl/css/guide.css:547 — `.sidebar` moves (`transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard tsl/css/guide.css:643 — `.toc-chevron` moves (`transition: transform 0.2s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard tsl/css/guide.css:1809 — `#editor-console` moves (`transition: height 0.2s cubic-bezier(0.4, 0, 0.2, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard tsl/css/guide.css:2006 — `.sidebar-search-icon` moves (`transition: color 0.15s ease, left 0.25s cubic-bezier(0.4, 0, 0.2, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard tsl/css/guide.css:2354 — `.playground-custom-scrollbar` moves (`transition: height 0.15s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard tsl/css/guide.css:2688 — `.tsl-embed-lock-circle` moves (`transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard tsl/css/guide.css:3129 — `.guide-ai-chevron` moves (`transition: transform 0.25s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard tsl/css/guide.css:3267 — `.tsl-api-class-chevron` moves (`transition: transform 0.25s ease, color 0.2s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard tsl/css/guide.css:3543 — `.x-tweet-card` moves (`transition: border-color 0.25s, transform 0.25s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard tsl/css/guide.css:3653 — `.sidebar` moves (`transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard tsl/css/guide.css:3690 — `.loading-screen::before` moves (`animation: forward-zoom 12s cubic-bezier(0.1, 0.7, 0.3, 1) infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard tsl/css/guide.css:3712 — `.loading-spinner` moves (`animation: rotate 2s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard files/main.css:499 — `#projects a img` moves (`transition: 0.15s transform`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard files/main.css:666 — `#contentWrapper` moves (`transition: .25s transform`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
AC6 · Visual & motion safety · Focus outline removed in CSS without a · ×14
  • Focus outline removed in CSS without a :focus replacement tsl/css/guide.css:1985 — `.sidebar-search-input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement tsl/css/guide.css:2501 — `.playground-tab-rename-input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement tsl/css/guide.css:2518 — `.playground-tab-btn` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement tsl/css/guide.css:2525 — `.playground-tab-btn:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement files/main.css:256 — `#panel #filterInput` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement files/main.css:289 — `#panel #language:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement editor/js/libs/codemirror/codemirror.css:165 — `.CodeMirror-scroll` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement editor/js/libs/codemirror/codemirror.css:181 — `.CodeMirror-vscrollbar` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement editor/js/libs/codemirror/codemirror.css:279 — `.CodeMirror-code` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement editor/js/libs/codemirror/addon/dialog.css:23 — `.CodeMirror-dialog input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement editor/css/main.css:51 — `.TextArea` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement editor/css/main.css:280 — `.Button` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement editor/css/main.css:310 — `.Select` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement editor/css/main.css:616 — `.Outliner` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
X24 · Document value interpolated into markup unescaped · Untrusted text written into markup unescaped · ×14
  • Untrusted text written into markup unescaped editor/js/Sidebar.Settings.History.js:97 — `'&nbsp;'+object.name` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped editor/js/Sidebar.Settings.History.js:113 — `'&nbsp;'+object.name` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped editor/js/libs/codemirror/addon/dialog.js:24 — `template` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped editor/js/libs/ui.js:412 — `options[key]` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped manual/resources/lesson.js:30 — `text` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped REDACTED:1475 — `sourceCodeHtml` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped manual/resources/threejs-primitives.js:893 — `text` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped REDACTED:351 — `num` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped REDACTED:2148 — `node.searchSnippet` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped REDACTED:2242 — `node.searchSnippet` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped REDACTED:2358 — `iconName` is text this program did not author, and it is written into a quoted attribute value through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped REDACTED:2370 — `iconName` is text this program did not author, and it is written into a quoted attribute value through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped REDACTED:2381 — `iconName` is text this program did not author, and it is written into a quoted attribute value through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped REDACTED:90 — `safeHref` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path.
D2 · Cognitive Complexity · constructor · ×10
  • constructor::setProgram (cognitive 149) src/renderers/WebGLRenderer.js:2397 — constructor::setProgram has cognitive complexity 149 (threshold 15). Drivers by points: if/else 63 (86 pts), boolean chains 49, loops 3 (8 pts), ternaries 5 (6 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • constructor::render (cognitive 67) src/renderers/WebGLRenderer.js:1641 — constructor::render has cognitive complexity 67 (threshold 15). Drivers by points: if/else 34 (46 pts), boolean chains 14, loops 2 (7 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.
  • constructor::copyTextureToTexture (cognitive 60) src/renderers/WebGLRenderer.js:3370 — constructor::copyTextureToTexture has cognitive complexity 60 (threshold 15). Drivers by points: if/else 30 (44 pts), boolean chains 7, ternaries 3 (5 pts), loops 2 (4 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.
  • constructor::renderBufferDirect (cognitive 40) src/renderers/WebGLRenderer.js:1200 — constructor::renderBufferDirect has cognitive complexity 40 (threshold 15). Drivers by points: if/else 24 (29 pts), ternaries 2 (5 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 10). 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.
  • constructor::setRenderTarget (cognitive 40) src/renderers/WebGLRenderer.js:2960 — constructor::setRenderTarget has cognitive complexity 40 (threshold 15). Drivers by points: if/else 21 (33 pts), boolean chains 5, 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.
  • constructor::setSession (cognitive 25) src/renderers/webxr/WebXRManager.js:409 — constructor::setSession has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 4 (15 pts), if/else 5 (9 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.
  • constructor::getProgram (cognitive 23) src/renderers/WebGLRenderer.js:2210 — constructor::getProgram has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 11, if/else 8 (10 pts), ternaries 2 (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.
  • constructor::readRenderTargetPixelsAsync (cognitive 23) src/renderers/WebGLRenderer.js:3245 — constructor::readRenderTargetPixelsAsync has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 3, ternaries 1 (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.
  • constructor::renderTransmissionPass (cognitive 21) src/renderers/WebGLRenderer.js:2015 — constructor::renderTransmissionPass has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3, ternaries 2 (3 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.
  • constructor::readRenderTargetPixels (cognitive 18) src/renderers/WebGLRenderer.js:3158 — constructor::readRenderTargetPixels has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, 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.
X1 · Async correctness · `async` Promise executor · ×10
  • `async` Promise executor REDACTED:2563 — The function passed to `new Promise(…)` is `async`. The constructor ignores what its executor returns, so anything this executor throws — every throw inside an `async` function, including after an `await` — rejects a Promise nobody holds instead of the one being constructed: the outer Promise never settles, whoever awaits it hangs, and the error is reported nowhere. If the body needs `await`, it does not need `new Promise` at all: make the enclosing function `async` and `return` the value (or `throw`) directly. If it wraps a callback API, keep the executor synchronous — call the API and `resolve`/`reject` from its callback — and do the awaiting outside it.
  • `async` Promise executor src/renderers/webgpu/utils/WebGPUPipelineUtils.js:282 — The function passed to `new Promise(…)` is `async`. The constructor ignores what its executor returns, so anything this executor throws — every throw inside an `async` function, including after an `await` — rejects a Promise nobody holds instead of the one being constructed: the outer Promise never settles, whoever awaits it hangs, and the error is reported nowhere. If the body needs `await`, it does not need `new Promise` at all: make the enclosing function `async` and `return` the value (or `throw`) directly. If it wraps a callback API, keep the executor synchronous — call the API and `resolve`/`reject` from its callback — and do the awaiting outside it.
  • `async` Promise executor src/renderers/webgpu/utils/WebGPUPipelineUtils.js:443 — The function passed to `new Promise(…)` is `async`. The constructor ignores what its executor returns, so anything this executor throws — every throw inside an `async` function, including after an `await` — rejects a Promise nobody holds instead of the one being constructed: the outer Promise never settles, whoever awaits it hangs, and the error is reported nowhere. If the body needs `await`, it does not need `new Promise` at all: make the enclosing function `async` and `return` the value (or `throw`) directly. If it wraps a callback API, keep the executor synchronous — call the API and `resolve`/`reject` from its callback — and do the awaiting outside it.
  • `async` Promise executor src/renderers/common/Renderer.js:907 — The function passed to `new Promise(…)` is `async`. The constructor ignores what its executor returns, so anything this executor throws — every throw inside an `async` function, including after an `await` — rejects a Promise nobody holds instead of the one being constructed: the outer Promise never settles, whoever awaits it hangs, and the error is reported nowhere. If the body needs `await`, it does not need `new Promise` at all: make the enclosing function `async` and `return` the value (or `throw`) directly. If it wraps a callback API, keep the executor synchronous — call the API and `resolve`/`reject` from its callback — and do the awaiting outside it.
  • `async` Promise executor build/three.webgpu.js:22886 — The function passed to `new Promise(…)` is `async`. The constructor ignores what its executor returns, so anything this executor throws — every throw inside an `async` function, including after an `await` — rejects a Promise nobody holds instead of the one being constructed: the outer Promise never settles, whoever awaits it hangs, and the error is reported nowhere. If the body needs `await`, it does not need `new Promise` at all: make the enclosing function `async` and `return` the value (or `throw`) directly. If it wraps a callback API, keep the executor synchronous — call the API and `resolve`/`reject` from its callback — and do the awaiting outside it.
  • `async` Promise executor build/three.webgpu.js:47313 — The function passed to `new Promise(…)` is `async`. The constructor ignores what its executor returns, so anything this executor throws — every throw inside an `async` function, including after an `await` — rejects a Promise nobody holds instead of the one being constructed: the outer Promise never settles, whoever awaits it hangs, and the error is reported nowhere. If the body needs `await`, it does not need `new Promise` at all: make the enclosing function `async` and `return` the value (or `throw`) directly. If it wraps a callback API, keep the executor synchronous — call the API and `resolve`/`reject` from its callback — and do the awaiting outside it.
  • `async` Promise executor build/three.webgpu.js:47474 — The function passed to `new Promise(…)` is `async`. The constructor ignores what its executor returns, so anything this executor throws — every throw inside an `async` function, including after an `await` — rejects a Promise nobody holds instead of the one being constructed: the outer Promise never settles, whoever awaits it hangs, and the error is reported nowhere. If the body needs `await`, it does not need `new Promise` at all: make the enclosing function `async` and `return` the value (or `throw`) directly. If it wraps a callback API, keep the executor synchronous — call the API and `resolve`/`reject` from its callback — and do the awaiting outside it.
  • `async` Promise executor build/three.webgpu.nodes.js:64005 — The function passed to `new Promise(…)` is `async`. The constructor ignores what its executor returns, so anything this executor throws — every throw inside an `async` function, including after an `await` — rejects a Promise nobody holds instead of the one being constructed: the outer Promise never settles, whoever awaits it hangs, and the error is reported nowhere. If the body needs `await`, it does not need `new Promise` at all: make the enclosing function `async` and `return` the value (or `throw`) directly. If it wraps a callback API, keep the executor synchronous — call the API and `resolve`/`reject` from its callback — and do the awaiting outside it.
  • `async` Promise executor build/three.webgpu.nodes.js:88432 — The function passed to `new Promise(…)` is `async`. The constructor ignores what its executor returns, so anything this executor throws — every throw inside an `async` function, including after an `await` — rejects a Promise nobody holds instead of the one being constructed: the outer Promise never settles, whoever awaits it hangs, and the error is reported nowhere. If the body needs `await`, it does not need `new Promise` at all: make the enclosing function `async` and `return` the value (or `throw`) directly. If it wraps a callback API, keep the executor synchronous — call the API and `resolve`/`reject` from its callback — and do the awaiting outside it.
  • `async` Promise executor build/three.webgpu.nodes.js:88593 — The function passed to `new Promise(…)` is `async`. The constructor ignores what its executor returns, so anything this executor throws — every throw inside an `async` function, including after an `await` — rejects a Promise nobody holds instead of the one being constructed: the outer Promise never settles, whoever awaits it hangs, and the error is reported nowhere. If the body needs `await`, it does not need `new Promise` at all: make the enclosing function `async` and `return` the value (or `throw`) directly. If it wraps a callback API, keep the executor synchronous — call the API and `resolve`/`reject` from its callback — and do the awaiting outside it.
AC3 · Page structure · Page without a main landmark · ×9
  • Page without a main landmark devtools/panel/panel.html:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark editor/index.html:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark manual/index.html:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark REDACTED:1 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark manual/pages/animation-system.html:1 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark manual/pages/backgrounds.html:1 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark manual/pages/billboards.html:1 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark manual/pages/cameras.html:1 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark manual/pages/canvas-textures.html:1 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
D1 · Cyclomatic Complexity · WebGLTextures.WebGLTextures · ×8
  • WebGLTextures.WebGLTextures::uploadTexture (cyclomatic 79) src/renderers/webgl/WebGLTextures.js:962 — WebGLTextures.WebGLTextures::uploadTexture has cyclomatic complexity 79 (threshold 15). To reduce it, separate the cases: extract each independent 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 shape REPEATS in the file: 7 other methods here (WebGLTextures.WebGLTextures::getInternalFormat, WebGLTextures.WebGLTextures::deallocateRenderTarget, WebGLTextures.WebGLTextures::setTextureParameters, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • WebGLTextures.WebGLTextures::getInternalFormat (cyclomatic 74) src/renderers/webgl/WebGLTextures.js:132 — WebGLTextures.WebGLTextures::getInternalFormat has cyclomatic complexity 74 (threshold 15). To reduce it, separate the cases: extract each independent 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 shape REPEATS in the file: 7 other methods here (WebGLTextures.WebGLTextures::deallocateRenderTarget, WebGLTextures.WebGLTextures::setTextureParameters, WebGLTextures.WebGLTextures::uploadTexture, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • WebGLTextures.WebGLTextures::uploadCubeTexture (cyclomatic 47) src/renderers/webgl/WebGLTextures.js:1469 — WebGLTextures.WebGLTextures::uploadCubeTexture has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent 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 shape REPEATS in the file: 7 other methods here (WebGLTextures.WebGLTextures::getInternalFormat, WebGLTextures.WebGLTextures::deallocateRenderTarget, WebGLTextures.WebGLTextures::setTextureParameters, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • WebGLTextures.WebGLTextures::setupRenderTarget (cyclomatic 36) src/renderers/webgl/WebGLTextures.js:2066 — WebGLTextures.WebGLTextures::setupRenderTarget 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. This shape REPEATS in the file: 7 other methods here (WebGLTextures.WebGLTextures::getInternalFormat, WebGLTextures.WebGLTextures::deallocateRenderTarget, WebGLTextures.WebGLTextures::setTextureParameters, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • WebGLTextures.WebGLTextures::setTextureParameters (cyclomatic 22) src/renderers/webgl/WebGLTextures.js:725 — WebGLTextures.WebGLTextures::setTextureParameters has cyclomatic complexity 22 (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. This shape REPEATS in the file: 7 other methods here (WebGLTextures.WebGLTextures::getInternalFormat, WebGLTextures.WebGLTextures::deallocateRenderTarget, WebGLTextures.WebGLTextures::uploadTexture, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • WebGLTextures.WebGLTextures::updateMultisampleRenderTarget (cyclomatic 22) src/renderers/webgl/WebGLTextures.js:2339 — WebGLTextures.WebGLTextures::updateMultisampleRenderTarget 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. This shape REPEATS in the file: 7 other methods here (WebGLTextures.WebGLTextures::getInternalFormat, WebGLTextures.WebGLTextures::deallocateRenderTarget, WebGLTextures.WebGLTextures::setTextureParameters, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • WebGLTextures.WebGLTextures::deallocateRenderTarget (cyclomatic 19) src/renderers/webgl/WebGLTextures.js:469 — WebGLTextures.WebGLTextures::deallocateRenderTarget 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. This shape REPEATS in the file: 7 other methods here (WebGLTextures.WebGLTextures::getInternalFormat, WebGLTextures.WebGLTextures::setTextureParameters, WebGLTextures.WebGLTextures::uploadTexture, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • WebGLTextures.WebGLTextures::setupDepthRenderbuffer (cyclomatic 16) src/renderers/webgl/WebGLTextures.js:1919 — WebGLTextures.WebGLTextures::setupDepthRenderbuffer 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 shape REPEATS in the file: 7 other methods here (WebGLTextures.WebGLTextures::getInternalFormat, WebGLTextures.WebGLTextures::deallocateRenderTarget, WebGLTextures.WebGLTextures::setTextureParameters, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D35 · Change Coupling · Change coupling · ×7
  • Change coupling: constants.js ↔ colorspace_pars_fragment.glsl.js src/constants.js:1 — `src/constants.js` and `src/renderers/shaders/ShaderChunk/colorspace_pars_fragment.glsl.js` change together 80% of the time (8 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 8 shared commits counted here, the most recent 3 are `076ff076` ColorManagement: Add ColorManagement.define( { ... } ) (#29450); `24ccd56f` WebGLRenderer: Support "Linear Display P3" working color space and "D…; `05fc79cd` WebGLRenderer: Remove inline sRGB decode. (#23129) (at that commit the file was still `src/renderers/shaders/ShaderChunk/encodings_pars_fragment.glsl.js`) — run `git show` on any of them.
  • Change coupling: lights_physical_pars_fragment.glsl.js ↔ meshphysical.glsl.js src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js:1 — `src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js` and `src/renderers/shaders/ShaderLib/meshphysical.glsl.js` change together 79% of the time (11 of the 14 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 11 shared commits counted here, the most recent 3 are `18e109a6` MeshPhysicalMaterial: Add EON rough diffuse BRDF (#34379); `3fce9681` Src: Improve retroreflection nomenclature (#34079); `ef1dc35f` MeshPhysicalMaterial: Add support for retroreflectivity. (#33949) — run `git show` on any of them.
  • Change coupling: Bindings.js ↔ SampledTexture.js src/renderers/common/Bindings.js:1 — `src/renderers/common/Bindings.js` and `src/renderers/common/SampledTexture.js` change together 64% of the time (9 of the 14 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 between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `e1809743` WebGPURenderer: Allow manual mipmap creation with StorageTexture (#31…; `3752bd27` WebGPURenderer: Improve and fix texture bindings manager (#31497); `84a951eb` WebGPURenderer: `SampledTexture` extends of `Sampler` for bindings (#… — run `git show` on any of them.
  • Change coupling: PostProcessing.js ↔ QuadMesh.js src/renderers/common/PostProcessing.js:1 — `src/renderers/common/PostProcessing.js` and `src/renderers/common/QuadMesh.js` change together 64% of the time (7 of the 11 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 between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise 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 `9aad521b` Renderer: Fix breakage in deprecated methods. (#32029); `69317a85` Renderer: Deprecate `renderAsync()`. (#32022); `5f265a25` Docs: More JSDoc. (#30636) — run `git show` on any of them.
  • Change coupling: lights_physical_fragment.glsl.js ↔ meshphysical.glsl.js src/renderers/shaders/ShaderChunk/lights_physical_fragment.glsl.js:1 — `src/renderers/shaders/ShaderChunk/lights_physical_fragment.glsl.js` and `src/renderers/shaders/ShaderLib/meshphysical.glsl.js` change together 58% of the time (7 of the 12 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 7 shared commits counted here, the most recent 3 are `18e109a6` MeshPhysicalMaterial: Add EON rough diffuse BRDF (#34379); `3fce9681` Src: Improve retroreflection nomenclature (#34079); `ef1dc35f` MeshPhysicalMaterial: Add support for retroreflectivity. (#33949) — run `git show` on any of them.
  • Change coupling: WebGLRenderer.js ↔ UniformsLib.js src/renderers/WebGLRenderer.js:1 — `src/renderers/WebGLRenderer.js` and `src/renderers/shaders/UniformsLib.js` change together 57% of the time (8 of the 14 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 `542fe76f` LightProbeGrid: Only sample the last grid that contains the fragment.…; `c6a56a8e` WebGLRenderer: Add SunLight with cascaded shadow maps. (#34221); `1da9cef7` LightProbeGrid: Add position-dependent diffuse Global Illumination (#… — run `git show` on any of them.
  • Change coupling: IsolateNode.js ↔ NodeBuilder.js src/nodes/core/IsolateNode.js:1 — `src/nodes/core/IsolateNode.js` and `src/nodes/core/NodeBuilder.js` change together 55% of the time (6 of the 11 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 between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise 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 `4437d863` TSL: Introduce `subBuild()` (#31260) (at that commit the file was still `src/nodes/core/CacheNode.js`); `ba6091f4` TSL: Introduce `namespace` (#31168) (at that commit the file was still `src/nodes/core/CacheNode.js`); `ddfa74b9` Docs: fix types (#30677) (at that commit the file was still `src/nodes/core/CacheNode.js`) — run `git show` on any of them.
D2 · Cognitive Complexity · WebGLTextures · ×6
  • WebGLTextures::uploadCubeTexture (cognitive 176) src/renderers/webgl/WebGLTextures.js:1469 — WebGLTextures::uploadCubeTexture has cognitive complexity 176 (threshold 15). Drivers by points: if/else 39 (132 pts), loops 7 (27 pts), boolean chains 9, ternaries 3 (8 pts) (nesting depth added 118). 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.
  • WebGLTextures::getInternalFormat (cognitive 119) src/renderers/webgl/WebGLTextures.js:132 — WebGLTextures::getInternalFormat has cognitive complexity 119 (threshold 15). Drivers by points: if/else 58 (105 pts), boolean chains 9, ternaries 2 (5 pts) (nesting depth added 50). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • WebGLTextures::setupRenderTarget (cognitive 84) src/renderers/webgl/WebGLTextures.js:2066 — WebGLTextures::setupRenderTarget has cognitive complexity 84 (threshold 15). Drivers by points: if/else 27 (48 pts), loops 9 (26 pts), ternaries 2 (7 pts), boolean chains 3 (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • WebGLTextures::updateMultisampleRenderTarget (cognitive 66) src/renderers/webgl/WebGLTextures.js:2339 — WebGLTextures::updateMultisampleRenderTarget has cognitive complexity 66 (threshold 15). Drivers by points: if/else 14 (44 pts), loops 3 (11 pts), ternaries 2 (7 pts), boolean chains 4 (nesting depth added 43). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • WebGLTextures::resizeImage (cognitive 22) src/renderers/webgl/WebGLTextures.js:49 — WebGLTextures::resizeImage has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 8, ternaries 1 (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.
  • WebGLTextures::setTextureParameters (cognitive 19) src/renderers/webgl/WebGLTextures.js:725 — WebGLTextures::setTextureParameters has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 7 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WebGLTextures.WebGLTextures · ×5
  • WebGLTextures.WebGLTextures::uploadTexture (cognitive 315) src/renderers/webgl/WebGLTextures.js:962 — WebGLTextures.WebGLTextures::uploadTexture has cognitive complexity 315 (threshold 15). Drivers by points: if/else 82 (262 pts), loops 7 (37 pts), boolean chains 10, ternaries 2 (6 pts) (nesting depth added 214). 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. This shape REPEATS in the file: 4 other methods here (WebGLTextures.WebGLTextures::deallocateRenderTarget, WebGLTextures.WebGLTextures::setupRenderBufferStorage, WebGLTextures.WebGLTextures::setupDepthTexture, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • WebGLTextures.WebGLTextures::setupDepthRenderbuffer (cognitive 46) src/renderers/webgl/WebGLTextures.js:1919 — WebGLTextures.WebGLTextures::setupDepthRenderbuffer has cognitive complexity 46 (threshold 15). Drivers by points: if/else 17 (30 pts), ternaries 2 (9 pts), loops 2 (6 pts), boolean chains 1 (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. This shape REPEATS in the file: 4 other methods here (WebGLTextures.WebGLTextures::deallocateRenderTarget, WebGLTextures.WebGLTextures::uploadTexture, WebGLTextures.WebGLTextures::setupRenderBufferStorage, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • WebGLTextures.WebGLTextures::deallocateRenderTarget (cognitive 42) src/renderers/webgl/WebGLTextures.js:469 — WebGLTextures.WebGLTextures::deallocateRenderTarget has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (28 pts), loops 5 (13 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. This shape REPEATS in the file: 4 other methods here (WebGLTextures.WebGLTextures::uploadTexture, WebGLTextures.WebGLTextures::setupRenderBufferStorage, WebGLTextures.WebGLTextures::setupDepthTexture, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • WebGLTextures.WebGLTextures::setupRenderBufferStorage (cognitive 18) src/renderers/webgl/WebGLTextures.js:1778 — WebGLTextures.WebGLTextures::setupRenderBufferStorage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 2 (4 pts), loops 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. This shape REPEATS in the file: 4 other methods here (WebGLTextures.WebGLTextures::deallocateRenderTarget, WebGLTextures.WebGLTextures::uploadTexture, WebGLTextures.WebGLTextures::setupDepthTexture, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • WebGLTextures.WebGLTextures::setupDepthTexture (cognitive 18) src/renderers/webgl/WebGLTextures.js:1842 — WebGLTextures.WebGLTextures::setupDepthTexture has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 3, boolean chains 2 (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. This shape REPEATS in the file: 4 other methods here (WebGLTextures.WebGLTextures::deallocateRenderTarget, WebGLTextures.WebGLTextures::uploadTexture, WebGLTextures.WebGLTextures::setupRenderBufferStorage, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · WebGLRenderer.constructor · ×4
  • WebGLRenderer.constructor::setProgram (cyclomatic 129) src/renderers/WebGLRenderer.js:2397 — WebGLRenderer.constructor::setProgram has cyclomatic complexity 129 (threshold 15). To reduce it, separate the cases: extract each independent 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 shape REPEATS in the file: 4 other methods here (WebGLRenderer.constructor, WebGLRenderer.constructor::projectObject, WebGLRenderer.constructor::renderTransmissionPass, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • WebGLRenderer.constructor::projectObject (cyclomatic 30) src/renderers/WebGLRenderer.js:1873 — WebGLRenderer.constructor::projectObject 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. This shape REPEATS in the file: 4 other methods here (WebGLRenderer.constructor, WebGLRenderer.constructor::renderTransmissionPass, WebGLRenderer.constructor::getProgram, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • WebGLRenderer.constructor::getProgram (cyclomatic 22) src/renderers/WebGLRenderer.js:2210 — WebGLRenderer.constructor::getProgram has cyclomatic complexity 22 (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. This shape REPEATS in the file: 4 other methods here (WebGLRenderer.constructor, WebGLRenderer.constructor::projectObject, WebGLRenderer.constructor::renderTransmissionPass, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • WebGLRenderer.constructor::renderTransmissionPass (cyclomatic 17) src/renderers/WebGLRenderer.js:2015 — WebGLRenderer.constructor::renderTransmissionPass 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 shape REPEATS in the file: 4 other methods here (WebGLRenderer.constructor, WebGLRenderer.constructor::projectObject, WebGLRenderer.constructor::getProgram, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · constructor · ×4
  • constructor::render (cyclomatic 47) src/renderers/WebGLRenderer.js:1641 — constructor::render has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • constructor::copyTextureToTexture (cyclomatic 33) src/renderers/WebGLRenderer.js:3370 — constructor::copyTextureToTexture 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.
  • constructor::renderBufferDirect (cyclomatic 27) src/renderers/WebGLRenderer.js:1200 — constructor::renderBufferDirect has cyclomatic complexity 27 (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.
  • constructor::setRenderTarget (cyclomatic 26) src/renderers/WebGLRenderer.js:2960 — constructor::setRenderTarget 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.
D2 · Cognitive Complexity · addEditorMethods · ×4
  • addEditorMethods::getHelpers (cognitive 17) editor/js/libs/codemirror/codemirror.js:8390 — addEditorMethods::getHelpers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (3 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.
  • addEditorMethods::getTokenTypeAt (cognitive 16) editor/js/libs/codemirror/codemirror.js:8364 — addEditorMethods::getTokenTypeAt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 4 (7 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.
  • addEditorMethods::addWidget (cognitive 16) editor/js/libs/codemirror/codemirror.js:8460 — addEditorMethods::addWidget has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 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.
  • addEditorMethods::findWordAt (cognitive 16) editor/js/libs/codemirror/codemirror.js:8575 — addEditorMethods::findWordAt has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 4, if/else 3 (4 pts), loops 2 (4 pts), ternaries 2 (4 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.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×4
  • Outbound HTTP without resilience editor/js/Script.js:312 — `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience REDACTED:213 — `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience REDACTED:648 — `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience tsl/js/managers/PlaygroundManager.js:1180 — `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
X2 · Cancellation propagation · Async function without AbortSignal · ×4
  • Async function without AbortSignal: load REDACTED:209 — `load` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: showImportedFiles tsl/js/managers/PlaygroundManager.js:1158 — `showImportedFiles` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: load REDACTED:584 — `load` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: loadThreeDefs editor/js/Script.js:304 — `loadThreeDefs` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
X29 · Per-element action decided by a fixed element · Per-element action decided by a fixed element · ×4
  • Per-element action decided by a fixed element src/renderers/webgl/WebGLTextures.js:1500 — This loop runs once per element of `texture.image`, and the statement it guards acts on the element it is on — `texture.image[i]`. The test deciding whether that statement runs does not: `!isCompressed && !isDataTexture` reads `texture.image[0]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts — the fixed one at line 1493, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out.
  • Per-element action decided by a fixed element src/renderers/webgl/WebGLTextures.js:1506 — This loop runs once per element of `texture.image`, and the statement it guards acts on the element it is on — `texture.image[i]`. The test deciding whether that statement runs does not: `isDataTexture` reads `texture.image[0]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts — the fixed one at line 1494, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out.
  • Per-element action decided by a fixed element build/three.module.js:12315 — This loop runs once per element of `texture.image`, and the statement it guards acts on the element it is on — `texture.image[i]`. The test deciding whether that statement runs does not: `!isCompressed && !isDataTexture` reads `texture.image[0]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts — the fixed one at line 12308, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out.
  • Per-element action decided by a fixed element build/three.module.js:12321 — This loop runs once per element of `texture.image`, and the statement it guards acts on the element it is on — `texture.image[i]`. The test deciding whether that statement runs does not: `isDataTexture` reads `texture.image[0]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts — the fixed one at line 12309, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out.
AC1 · Text alternatives · <canvas> without a text alternative · ×3
  • <canvas> without a text alternative manual/pages/cameras.html:550 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
  • <canvas> without a text alternative manual/pages/custom-buffergeometry.html:436 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
  • <canvas> without a text alternative manual/pages/fog.html:268 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (3.5 · ×3
  • Low contrast colour pair in CSS (3.5:1) editor/js/libs/codemirror/theme/monokai.css:35 — `.cm-s-monokai span.cm-error` sets color: #f8f8f0 on background-color: #f92672 — 3.5:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
  • Low contrast colour pair in CSS (3.5:1) editor/js/libs/codemirror/addon/show-hint.css:33 — `li.CodeMirror-hint-active` sets color: white on background-color: #08f — 3.5:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
  • Low contrast colour pair in CSS (3.5:1) editor/css/main.css:732 — `.Button.selected` sets color: #fff on background-color: #08f — 3.5:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
D2 · Cognitive Complexity · Sidebar.Object.SidebarObject · ×3
  • Sidebar.Object.SidebarObject::update (cognitive 87) editor/js/Sidebar.Object.js:430 — Sidebar.Object.SidebarObject::update has cognitive complexity 87 (threshold 15). Drivers by points: if/else 32 (70 pts), boolean chains 15, error handling 1 (2 pts) (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. This shape REPEATS in the file: 2 other methods here (Sidebar.Object.SidebarObject::updateRows, Sidebar.Object.SidebarObject::updateUI) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Sidebar.Object.SidebarObject::updateUI (cognitive 18) editor/js/Sidebar.Object.js:743 — Sidebar.Object.SidebarObject::updateUI has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, error handling 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. This shape REPEATS in the file: 2 other methods here (Sidebar.Object.SidebarObject::update, Sidebar.Object.SidebarObject::updateRows) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Sidebar.Object.SidebarObject::updateRows (cognitive 17) editor/js/Sidebar.Object.js:634 — Sidebar.Object.SidebarObject::updateRows has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 2 (7 pts), if/else 4 (5 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. This shape REPEATS in the file: 2 other methods here (Sidebar.Object.SidebarObject::update, Sidebar.Object.SidebarObject::updateUI) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
R10 · Code Duplication · Duplicated block with local edits (55 matched lines × 2 locations) · ×3
  • Duplicated block with local edits (55 matched lines × 2 locations) src/nodes/accessors/Morph.js:105 — src/nodes/accessors/Morph.js:105 · src/renderers/webgl/WebGLMorphtargets.js:28 — the two spans are one implementation copied and then locally edited — 470 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (55 matched lines × 2 locations) src/objects/Line.js:170 — src/objects/Line.js:170 · src/objects/Points.js:108 — the two spans are one implementation copied and then locally edited — 442 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (55 matched lines × 2 locations) src/renderers/common/XRManager.js:1239 — src/renderers/common/XRManager.js:1239 · src/renderers/webxr/WebXRManager.js:477 — the two spans are one implementation copied and then locally edited — 403 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (40 lines × 2 locations) · ×3
  • Duplicated block (40 lines × 2 locations) src/extras/curves/CubicBezierCurve.js:27 — src/extras/curves/CubicBezierCurve.js:27 · src/extras/curves/CubicBezierCurve3.js:10 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (40 lines × 2 locations) src/extras/curves/QuadraticBezierCurve.js:26 — src/extras/curves/QuadraticBezierCurve.js:26 · src/extras/curves/QuadraticBezierCurve3.js:10 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
  • Duplicated block (40 lines × 2 locations) src/nodes/core/NodeFrame.js:212 — src/nodes/core/NodeFrame.js:212 · src/nodes/core/NodeFrame.js:261 — 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.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (3.1 · ×2
  • Low contrast colour pair in CSS (3.1:1) editor/css/main.css:572 — `#tabs span.selected` sets color: #888 on background-color: #eee — 3.1:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
  • Low contrast colour pair in CSS (3.1:1) editor/css/main.css:644 — `.TabbedPanel .Tab.selected` sets color: #888 on background-color: #eee — 3.1:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
D1 · Cyclomatic Complexity · Sidebar.Object.SidebarObject · ×2
  • Sidebar.Object.SidebarObject::update (cyclomatic 49) editor/js/Sidebar.Object.js:430 — Sidebar.Object.SidebarObject::update has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent 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 shape REPEATS in the file: one other method here (Sidebar.Object.SidebarObject::updateUI) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Sidebar.Object.SidebarObject::updateUI (cyclomatic 19) editor/js/Sidebar.Object.js:743 — Sidebar.Object.SidebarObject::updateUI 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. This shape REPEATS in the file: one other method here (Sidebar.Object.SidebarObject::update) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · index.html.updateFilter (cyclomatic 40) · ×2
  • index.html.updateFilter (cyclomatic 40) docs/index.html:2302 — index.html.updateFilter has cyclomatic complexity 40 (threshold 15). Of this number, 21 points are the body's own statements and 19 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • index.html.updateFilter (cyclomatic 40) utils/docs/template/static/index.html:300 — index.html.updateFilter has cyclomatic complexity 40 (threshold 15). Of this number, 21 points are the body's own statements and 19 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · (anonymous) · ×2
  • (anonymous)::parse (cyclomatic 37) editor/js/libs/jsonlint.js:81 — (anonymous)::parse has cyclomatic complexity 37 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
  • (anonymous)::(anonymous)::next (cyclomatic 16) editor/js/libs/jsonlint.js:321 — (anonymous)::(anonymous)::next has cyclomatic complexity 16 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D1 · Cyclomatic Complexity · WebGLState.setBlending (cyclomatic 29) · ×2
  • WebGLState.setBlending (cyclomatic 29) src/renderers/webgl-fallback/utils/WebGLState.js:468 — WebGLState.setBlending 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.
  • WebGLState.setBlending (cyclomatic 29) src/renderers/webgl/WebGLState.js:606 — WebGLState.setBlending 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 · prettify.combinePrefixPatterns · ×2
  • prettify.combinePrefixPatterns::allowAnywhereFoldCaseAndRenumberGroups (cyclomatic 23) REDACTED:375 — prettify.combinePrefixPatterns::allowAnywhereFoldCaseAndRenumberGroups has cyclomatic complexity 23 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages. This shape REPEATS in the file: one other method here (prettify.combinePrefixPatterns::caseFoldCharset) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • prettify.combinePrefixPatterns::caseFoldCharset (cyclomatic 18) REDACTED:303 — prettify.combinePrefixPatterns::caseFoldCharset has cyclomatic complexity 18 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages. This shape REPEATS in the file: one other method here (prettify.combinePrefixPatterns::allowAnywhereFoldCaseAndRenumberGroups) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · WebGLShadowMap.WebGLShadowMap · ×2
  • WebGLShadowMap.WebGLShadowMap::getDepthMaterial (cyclomatic 23) src/renderers/webgl/WebGLShadowMap.js:431 — WebGLShadowMap.WebGLShadowMap::getDepthMaterial 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. This shape REPEATS in the file: one other method here (WebGLShadowMap.WebGLShadowMap::renderObject) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • WebGLShadowMap.WebGLShadowMap::renderObject (cyclomatic 17) src/renderers/webgl/WebGLShadowMap.js:520 — WebGLShadowMap.WebGLShadowMap::renderObject 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 shape REPEATS in the file: one other method here (WebGLShadowMap.WebGLShadowMap::getDepthMaterial) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · index.html.updateFilter (cognitive 117) · ×2
  • index.html.updateFilter (cognitive 117) docs/index.html:2302 — index.html.updateFilter has cognitive complexity 117 (threshold 15). Drivers by points: if/else 22 (64 pts), ternaries 7 (30 pts), loops 5 (15 pts), boolean chains 8 (nesting depth added 75). Of this number, 68 points are the body's own statements and 49 belong to 3 function literals inside it that branch. 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.
  • index.html.updateFilter (cognitive 117) utils/docs/template/static/index.html:300 — index.html.updateFilter has cognitive complexity 117 (threshold 15). Drivers by points: if/else 22 (64 pts), ternaries 7 (30 pts), loops 5 (15 pts), boolean chains 8 (nesting depth added 75). Of this number, 68 points are the body's own statements and 49 belong to 3 function literals inside it that branch. 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 · ExtrudeGeometry.constructor · ×2
  • ExtrudeGeometry.constructor::addShape (cognitive 90) src/geometries/ExtrudeGeometry.js:81 — ExtrudeGeometry.constructor::addShape has cognitive complexity 90 (threshold 15). Drivers by points: if/else 19 (43 pts), loops 16 (31 pts), ternaries 12 (16 pts) (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (ExtrudeGeometry.constructor::addShape::getBevelVec) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • ExtrudeGeometry.constructor::addShape::getBevelVec (cognitive 26) src/geometries/ExtrudeGeometry.js:236 — ExtrudeGeometry.constructor::addShape::getBevelVec has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (26 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. This shape REPEATS in the file: one other method here (ExtrudeGeometry.constructor::addShape) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · WebGLShadowMap · ×2
  • WebGLShadowMap::render (cognitive 87) src/renderers/webgl/WebGLShadowMap.js:92 — WebGLShadowMap::render has cognitive complexity 87 (threshold 15). Drivers by points: if/else 30 (67 pts), ternaries 3 (9 pts), boolean chains 8, loops 2 (3 pts) (nesting depth added 44). 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.
  • WebGLShadowMap::getDepthMaterial (cognitive 31) src/renderers/webgl/WebGLShadowMap.js:431 — WebGLShadowMap::getDepthMaterial has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 10, ternaries 5 (8 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 · (anonymous) · ×2
  • (anonymous)::parse (cognitive 80) editor/js/libs/jsonlint.js:81 — (anonymous)::parse has cognitive complexity 80 (threshold 15). Drivers by points: if/else 20 (54 pts), boolean chains 11, loops 3 (8 pts), ternaries 1 (5 pts), match/switch 1 (2 pts) (nesting depth added 44). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
  • (anonymous)::(anonymous)::next (cognitive 24) editor/js/libs/jsonlint.js:321 — (anonymous)::(anonymous)::next has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (nesting depth added 7). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · WebXRManager.constructor · ×2
  • WebXRManager.constructor::onAnimationFrame (cognitive 56) src/renderers/webxr/WebXRManager.js:854 — WebXRManager.constructor::onAnimationFrame has cognitive complexity 56 (threshold 15). Drivers by points: if/else 17 (42 pts), boolean chains 8, loops 3 (6 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. This shape REPEATS in the file: one other method here (WebXRManager.constructor::onInputSourcesChange) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • WebXRManager.constructor::onInputSourcesChange (cognitive 19) src/renderers/webxr/WebXRManager.js:566 — WebXRManager.constructor::onInputSourcesChange has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 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. This shape REPEATS in the file: one other method here (WebXRManager.constructor::onAnimationFrame) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · prettify.combinePrefixPatterns · ×2
  • prettify.combinePrefixPatterns::allowAnywhereFoldCaseAndRenumberGroups (cognitive 39) REDACTED:375 — prettify.combinePrefixPatterns::allowAnywhereFoldCaseAndRenumberGroups has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (29 pts), loops 5 (6 pts), boolean chains 4 (nesting depth added 16). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages. This shape REPEATS in the file: one other method here (prettify.combinePrefixPatterns::caseFoldCharset) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • prettify.combinePrefixPatterns::caseFoldCharset (cognitive 36) REDACTED:303 — prettify.combinePrefixPatterns::caseFoldCharset has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (27 pts), boolean chains 4, loops 3, ternaries 1 (2 pts) (nesting depth added 16). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages. This shape REPEATS in the file: one other method here (prettify.combinePrefixPatterns::allowAnywhereFoldCaseAndRenumberGroups) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · clear (cognitive 39) · ×2
  • clear (cognitive 39) editor/js/libs/codemirror/codemirror.js:5860 — clear has cognitive complexity 39 (threshold 15). Drivers by points: if/else 17 (27 pts), boolean chains 9, 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.
  • clear (cognitive 39) src/renderers/webgpu/WebGPUBackend.js:1762 — clear has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (20 pts), ternaries 6 (16 pts), boolean chains 3 (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 · prettify.numberLines · ×2
  • prettify.numberLines::walk (cognitive 22) REDACTED:1015 — prettify.numberLines::walk has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 10). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages. This shape REPEATS in the file: one other method here (prettify.numberLines::findTextWithPrefix) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • prettify.numberLines::findTextWithPrefix (cognitive 19) REDACTED:1130 — prettify.numberLines::findTextWithPrefix has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 9). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages. This shape REPEATS in the file: one other method here (prettify.numberLines::walk) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · index.html.createNewIframe (cognitive 20) · ×2
  • index.html.createNewIframe (cognitive 20) docs/index.html:2575 — index.html.createNewIframe has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • index.html.createNewIframe (cognitive 20) utils/docs/template/static/index.html:573 — index.html.createNewIframe has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · init · ×2
  • init::onWindowResize (cognitive 20) REDACTED:463 — init::onWindowResize has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 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.
  • init::onkeydown (cognitive 19) REDACTED:611 — init::onkeydown has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (19 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
R10 · Code Duplication · Duplicated block (42 lines × 2 locations) · ×2
  • Duplicated block (42 lines × 2 locations) REDACTED:757 — REDACTED:757 · REDACTED:1068 — 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 (42 lines × 2 locations) tsl/js/utils/MarkdownUtils.js:648 — tsl/js/utils/MarkdownUtils.js:648 · tsl/js/utils/MarkdownUtils.js:691 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (39 lines × 2 locations) · ×2
  • Duplicated block (39 lines × 2 locations) src/renderers/webgl-fallback/utils/WebGLState.js:501 — src/renderers/webgl-fallback/utils/WebGLState.js:501 · src/renderers/webgl/WebGLState.js:637 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (39 lines × 2 locations) src/renderers/webgl-fallback/utils/WebGLState.js:1416 — src/renderers/webgl-fallback/utils/WebGLState.js:1416 · src/renderers/webgl/WebGLState.js:1214 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R2 · Cyclomatic Complexity · Complex function convert (cyclomatic 126, cognitive 256) · ×2
  • Complex function convert (cyclomatic 126, cognitive 256) src/renderers/webgl-fallback/utils/WebGLUtils.js:51 — convert has cyclomatic complexity 126 and cognitive complexity 256; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
  • Complex function convert (cyclomatic 126, cognitive 256) src/renderers/webgl/WebGLUtils.js:6 — convert has cyclomatic complexity 126 and cognitive complexity 256; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
AC4 · Keyboard semantics · Anchor without href · ×1
  • Anchor without href manual/pages/game.html:1920 — An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (3.6 · ×1
  • Low contrast colour pair in CSS (3.6:1) manual/resources/lesson.css:480 — `code` sets color: #CCC on background-color: #666 — 3.6:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (4.0 · ×1
  • Low contrast colour pair in CSS (4.0:1) manual/examples/resources/threejs-tutorials.css:142 — `.contextlost>div` sets color: white on background-color: red — 4.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (1.0 · ×1
  • Low contrast colour pair in CSS (1.0:1) files/main.css:250 — `#panel #filterInput` sets color: #444 on background-color: #444 — 1.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
D1 · Cyclomatic Complexity · WebGLProgram.WebGLProgram (cyclomatic 190) · ×1
  • WebGLProgram.WebGLProgram (cyclomatic 190) src/renderers/webgl/WebGLProgram.js:372 — WebGLProgram.WebGLProgram has cyclomatic complexity 190 (threshold 15). Of this number, 177 points are the body's own statements and 13 belong to 4 function items inside it that branch. 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 · Material.fromJSON (cyclomatic 164) · ×1
  • Material.fromJSON (cyclomatic 164) src/materials/Material.js:920 — Material.fromJSON has cyclomatic complexity 164 (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 · codemirror.addEditorMethods (cyclomatic 139) · ×1
  • codemirror.addEditorMethods (cyclomatic 139) editor/js/libs/codemirror/codemirror.js:8270 — codemirror.addEditorMethods has cyclomatic complexity 139 (threshold 15). Of this number, 35 points are the body's own statements and 104 belong to 32 function literals inside it that branch. 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 · WebGLUtils.convert (cyclomatic 126) · ×1
  • WebGLUtils.convert (cyclomatic 126) src/renderers/webgl-fallback/utils/WebGLUtils.js:51 — WebGLUtils.convert has cyclomatic complexity 126 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WebGLUtils.WebGLUtils.convert (cyclomatic 126) · ×1
  • WebGLUtils.WebGLUtils.convert (cyclomatic 126) src/renderers/webgl/WebGLUtils.js:6 — WebGLUtils.WebGLUtils.convert has cyclomatic complexity 126 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Material.toJSON (cyclomatic 117) · ×1
  • Material.toJSON (cyclomatic 117) src/materials/Material.js:610 — Material.toJSON has cyclomatic complexity 117 (threshold 15). Of this number, 116 points are the body's own statements and 1 belongs to one function item inside it that branches. 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 · WebGPUTextureUtils.getFormat (cyclomatic 115) · ×1
  • WebGPUTextureUtils.getFormat (cyclomatic 115) src/renderers/webgpu/utils/WebGPUTextureUtils.js:1481 — WebGPUTextureUtils.getFormat has cyclomatic complexity 115 (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 · ObjectLoader.parseObject (cyclomatic 103) · ×1
  • ObjectLoader.parseObject (cyclomatic 103) src/loaders/ObjectLoader.js:784 — ObjectLoader.parseObject has cyclomatic complexity 103 (threshold 15). Of this number, 94 points are the body's own statements and 9 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WebGLPrograms.WebGLPrograms.getParameters (cyclomatic 100) · ×1
  • WebGLPrograms.WebGLPrograms.getParameters (cyclomatic 100) src/renderers/webgl/WebGLPrograms.js:54 — WebGLPrograms.WebGLPrograms.getParameters has cyclomatic complexity 100 (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 · WebGLPrograms.getParameters (cyclomatic 100) · ×1
  • WebGLPrograms.getParameters (cyclomatic 100) src/renderers/webgl/WebGLPrograms.js:54 — WebGLPrograms.getParameters has cyclomatic complexity 100 (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 · Guide.init (cyclomatic 99) · ×1
  • Guide.init (cyclomatic 99) REDACTED:229 — Guide.init has cyclomatic complexity 99 (threshold 15). Of this number, 21 points are the body's own statements and 78 belong to 22 function items inside it that branch. 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 · Viewport.Viewport (cyclomatic 98) · ×1
  • Viewport.Viewport (cyclomatic 98) editor/js/Viewport.js:25 — Viewport.Viewport has cyclomatic complexity 98 (threshold 15). Most of this is not in the body itself: 1 of the 98 points is its own statement and the rest belongs to 32 function items inside it that branch (a function literal at line 493, a function literal at line 105, a function literal at line 348, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · Loader.Loader (cyclomatic 96) · ×1
  • Loader.Loader (cyclomatic 96) editor/js/Loader.js:14 — Loader.Loader has cyclomatic complexity 96 (threshold 15). Most of this is not in the body itself: 5 of the 96 points are its own statements and the rest belongs to 21 function items inside it that branch (a function literal at line 161, handleZIP, handleJSON, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · WebGLTextureUtils.getInternalFormat (cyclomatic 93) · ×1
  • WebGLTextureUtils.getInternalFormat (cyclomatic 93) src/renderers/webgl-fallback/utils/WebGLTextureUtils.js:165 — WebGLTextureUtils.getInternalFormat has cyclomatic complexity 93 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · renderPage (cyclomatic 87) · ×1
  • renderPage (cyclomatic 87) REDACTED:1153 — renderPage has cyclomatic complexity 87 (threshold 15). Of this number, 48 points are the body's own statements and 39 belong to 34 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NodeMaterialObserver.equals (cyclomatic 76) · ×1
  • NodeMaterialObserver.equals (cyclomatic 76) src/materials/nodes/manager/NodeMaterialObserver.js:587 — NodeMaterialObserver.equals has cyclomatic complexity 76 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 73) · ×1
  • (anonymous) (cyclomatic 73) editor/js/libs/codemirror/codemirror.js:370 — (anonymous) has cyclomatic complexity 73 (threshold 15). Most of this is not in the body itself: 1 of the 73 points is its own statement and the rest belongs to 3 function items inside it that branch (a function literal at line 393, charType, BidiSpan). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · acorn-loose.lp$1.parseStatement (cyclomatic 67) · ×1
  • acorn-loose.lp$1.parseStatement (cyclomatic 67) editor/js/libs/acorn/acorn-loose.js:304 — acorn-loose.lp$1.parseStatement has cyclomatic complexity 67 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CodeRunner.run (cyclomatic 66) · ×1
  • CodeRunner.run (cyclomatic 66) REDACTED:897 — CodeRunner.run has cyclomatic complexity 66 (threshold 15). Of this number, 60 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MaterialNode.setup (cyclomatic 65) · ×1
  • MaterialNode.setup (cyclomatic 65) src/nodes/accessors/MaterialNode.js:120 — MaterialNode.setup has cyclomatic complexity 65 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Sidebar.Scene.SidebarScene (cyclomatic 63) · ×1
  • Sidebar.Scene.SidebarScene (cyclomatic 63) editor/js/Sidebar.Scene.js:6 — Sidebar.Scene.SidebarScene has cyclomatic complexity 63 (threshold 15). Most of this is not in the body itself: 1 of the 63 points is its own statement and the rest belongs to 17 function items inside it that branch (refreshUI, a function literal at line 596, a function literal at line 134, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · tern.findCompletions (cyclomatic 62) · ×1
  • tern.findCompletions (cyclomatic 62) editor/js/libs/ternjs/tern.js:714 — tern.findCompletions has cyclomatic complexity 62 (threshold 15). Of this number, 45 points are the body's own statements and 17 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · codemirror.insertLineContent (cyclomatic 56) · ×1
  • codemirror.insertLineContent (cyclomatic 56) editor/js/libs/codemirror/codemirror.js:1921 — codemirror.insertLineContent has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CodeEditor._initMonaco (cyclomatic 54) · ×1
  • CodeEditor._initMonaco (cyclomatic 54) tsl/js/editor/CodeEditor.js:253 — CodeEditor._initMonaco has cyclomatic complexity 54 (threshold 15). Most of this is not in the body itself: 1 of the 54 points is its own statement and the rest belongs to 16 function literals inside it that branch (lines 255, 302, 527, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · WebGPUTextureUtils._getBlockData (cyclomatic 53) · ×1
  • WebGPUTextureUtils._getBlockData (cyclomatic 53) src/renderers/webgpu/utils/WebGPUTextureUtils.js:1212 — WebGPUTextureUtils._getBlockData has cyclomatic complexity 53 (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 · WebGLRenderer.constructor (cyclomatic 53) · ×1
  • WebGLRenderer.constructor (cyclomatic 53) src/renderers/WebGLRenderer.js:71 — WebGLRenderer.constructor has cyclomatic complexity 53 (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. This shape REPEATS in the file: 4 other methods here (WebGLRenderer.constructor::projectObject, WebGLRenderer.constructor::renderTransmissionPass, WebGLRenderer.constructor::getProgram, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 5 times rather than 5 independent problems. Splitting this body alone leaves the other 4 exactly as they are. Where these are variations on one operation, the change that clears all 5 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · codemirror.drawSelectionRange (cyclomatic 52) · ×1
  • codemirror.drawSelectionRange (cyclomatic 52) editor/js/libs/codemirror/codemirror.js:3204 — codemirror.drawSelectionRange has cyclomatic complexity 52 (threshold 15). Most of this is not in the body itself: 7 of the 52 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 3234, drawForLine::wrapX, add, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · WebGLPrograms.WebGLPrograms.getProgramCacheKeyBooleans (cyclomatic 51) · ×1
  • WebGLPrograms.WebGLPrograms.getProgramCacheKeyBooleans (cyclomatic 51) src/renderers/webgl/WebGLPrograms.js:509 — WebGLPrograms.WebGLPrograms.getProgramCacheKeyBooleans has cyclomatic complexity 51 (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 · ConsoleManager._initConsoleOverrides (cyclomatic 51) · ×1
  • ConsoleManager._initConsoleOverrides (cyclomatic 51) tsl/js/managers/ConsoleManager.js:16 — ConsoleManager._initConsoleOverrides has cyclomatic complexity 51 (threshold 15). Most of this is not in the body itself: 11 of the 51 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 21, 113, 56, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · WebGLPrograms.getProgramCacheKeyBooleans (cyclomatic 51) · ×1
  • WebGLPrograms.getProgramCacheKeyBooleans (cyclomatic 51) src/renderers/webgl/WebGLPrograms.js:509 — WebGLPrograms.getProgramCacheKeyBooleans has cyclomatic complexity 51 (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 · CodeRunner.load (cyclomatic 50) · ×1
  • CodeRunner.load (cyclomatic 50) REDACTED:584 — CodeRunner.load has cyclomatic complexity 50 (threshold 15). Of this number, 20 points are the body's own statements and 30 belong to 3 function literals inside it that branch. 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 · Object3D.toJSON (cyclomatic 49) · ×1
  • Object3D.toJSON (cyclomatic 49) src/core/Object3D.js:1302 — Object3D.toJSON has cyclomatic complexity 49 (threshold 15). Of this number, 45 points are the body's own statements and 4 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WebGLBackend._setFramebuffer (cyclomatic 49) · ×1
  • WebGLBackend._setFramebuffer (cyclomatic 49) src/renderers/webgl-fallback/WebGLBackend.js:2384 — WebGLBackend._setFramebuffer has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Textures.updateTexture (cyclomatic 48) · ×1
  • Textures.updateTexture (cyclomatic 48) src/renderers/common/Textures.js:280 — Textures.updateTexture has cyclomatic complexity 48 (threshold 15). Of this number, 46 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Script.Script (cyclomatic 47) · ×1
  • Script.Script (cyclomatic 47) editor/js/Script.js:8 — Script.Script has cyclomatic complexity 47 (threshold 15). Most of this is not in the body itself: 1 of the 47 points is its own statement and the rest belongs to 12 function items inside it that branch (a function literal at line 151, a function literal at line 425, a function literal at line 83, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · OperatorNode.generate (cyclomatic 47) · ×1
  • OperatorNode.generate (cyclomatic 47) src/nodes/math/OperatorNode.js:195 — OperatorNode.generate has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WebGPUTextureUtils._getBytesPerTexel (cyclomatic 47) · ×1
  • WebGPUTextureUtils._getBytesPerTexel (cyclomatic 47) src/renderers/webgpu/utils/WebGPUTextureUtils.js:1323 — WebGPUTextureUtils._getBytesPerTexel has cyclomatic complexity 47 (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 · WebGPUTextureUtils._getTypedArrayType (cyclomatic 47) · ×1
  • WebGPUTextureUtils._getTypedArrayType (cyclomatic 47) src/renderers/webgpu/utils/WebGPUTextureUtils.js:1392 — WebGPUTextureUtils._getTypedArrayType has cyclomatic complexity 47 (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 · acorn.pp$9.getTokenFromCode (cyclomatic 46) · ×1
  • acorn.pp$9.getTokenFromCode (cyclomatic 46) editor/js/libs/acorn/acorn.js:4489 — acorn.pp$9.getTokenFromCode has cyclomatic complexity 46 (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 · parseTypeInner (cyclomatic 46) · ×1
  • parseTypeInner (cyclomatic 46) editor/js/libs/ternjs/def.js:166 — parseTypeInner has cyclomatic complexity 46 (threshold 15). Of this number, 45 points are the body's own statements and 1 belongs to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · acorn.pp$3.parseExprAtom (cyclomatic 45) · ×1
  • acorn.pp$3.parseExprAtom (cyclomatic 45) editor/js/libs/acorn/acorn.js:2167 — acorn.pp$3.parseExprAtom 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 · codemirror.markText (cyclomatic 44) · ×1
  • codemirror.markText (cyclomatic 44) editor/js/libs/codemirror/codemirror.js:5970 — codemirror.markText has cyclomatic complexity 44 (threshold 15). Of this number, 34 points are the body's own statements and 10 belong to 2 function literals inside it that branch. 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 · ExtrudeGeometry.constructor · ×1
  • ExtrudeGeometry.constructor::addShape (cyclomatic 44) src/geometries/ExtrudeGeometry.js:81 — ExtrudeGeometry.constructor::addShape has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · acorn.pp$1.parseStatement (cyclomatic 43) · ×1
  • acorn.pp$1.parseStatement (cyclomatic 43) editor/js/libs/acorn/acorn.js:808 — acorn.pp$1.parseStatement has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · prettify.numberLines (cyclomatic 43) · ×1
  • prettify.numberLines (cyclomatic 43) REDACTED:991 — prettify.numberLines has cyclomatic complexity 43 (threshold 15). Most of this is not in the body itself: 14 of the 43 points are its own statements and the rest belongs to 5 function items inside it that branch (walk, findTextWithPrefix, breakAfter, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · copyTextureToTexture (cyclomatic 43) · ×1
  • copyTextureToTexture (cyclomatic 43) src/renderers/webgl-fallback/utils/WebGLTextureUtils.js:857 — copyTextureToTexture has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · earcut.isEarHashed (cyclomatic 42) · ×1
  • earcut.isEarHashed (cyclomatic 42) src/extras/lib/earcut.js:163 — earcut.isEarHashed has cyclomatic complexity 42 (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 · MarkdownUtils.parse (cyclomatic 42) · ×1
  • MarkdownUtils.parse (cyclomatic 42) tsl/js/utils/MarkdownUtils.js:283 — MarkdownUtils.parse has cyclomatic complexity 42 (threshold 15). Of this number, 32 points are the body's own statements and 10 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · codemirror.findPosH (cyclomatic 41) · ×1
  • codemirror.findPosH (cyclomatic 41) editor/js/libs/codemirror/codemirror.js:8710 — codemirror.findPosH has cyclomatic complexity 41 (threshold 15). Of this number, 28 points are the body's own statements and 13 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 41) · ×1
  • (anonymous) (cyclomatic 41) editor/js/libs/codemirror/codemirror.js:14 — (anonymous) has cyclomatic complexity 41 (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 · Node.build (cyclomatic 40) · ×1
  • Node.build (cyclomatic 40) src/nodes/core/Node.js:1129 — Node.build 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 · WebGPUBindingUtils._createLayoutEntries (cyclomatic 40) · ×1
  • WebGPUBindingUtils._createLayoutEntries (cyclomatic 40) src/renderers/webgpu/utils/WebGPUBindingUtils.js:420 — WebGPUBindingUtils._createLayoutEntries 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 · acorn-loose.lp$1.parseClass (cyclomatic 39) · ×1
  • acorn-loose.lp$1.parseClass (cyclomatic 39) editor/js/libs/acorn/acorn-loose.js:554 — acorn-loose.lp$1.parseClass 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 · prettify.$prettyPrint · ×1
  • prettify.$prettyPrint::doWork (cyclomatic 39) REDACTED:1532 — prettify.$prettyPrint::doWork has cyclomatic complexity 39 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D1 · Cyclomatic Complexity · WebGLBackend.draw (cyclomatic 39) · ×1
  • WebGLBackend.draw (cyclomatic 39) src/renderers/webgl-fallback/WebGLBackend.js:1214 — WebGLBackend.draw 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 · LayoutManager.setupResizer (cyclomatic 39) · ×1
  • LayoutManager.setupResizer (cyclomatic 39) tsl/js/managers/LayoutManager.js:116 — LayoutManager.setupResizer has cyclomatic complexity 39 (threshold 15). Most of this is not in the body itself: 12 of the 39 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 126, 335, 210, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · WebGLShadowMap · ×1
  • WebGLShadowMap::render (cyclomatic 39) src/renderers/webgl/WebGLShadowMap.js:92 — WebGLShadowMap::render 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 · codemirror.moveVisually (cyclomatic 37) · ×1
  • codemirror.moveVisually (cyclomatic 37) editor/js/libs/codemirror/codemirror.js:6914 — codemirror.moveVisually has cyclomatic complexity 37 (threshold 15). Of this number, 25 points are the body's own statements and 12 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WebGLOutput.WebGLOutput (cyclomatic 37) · ×1
  • WebGLOutput.WebGLOutput (cyclomatic 37) src/renderers/webgl/WebGLOutput.js:34 — WebGLOutput.WebGLOutput has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 10 of the 37 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 144, 242, 198, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · WebGLLights.WebGLLights.setup (cyclomatic 37) · ×1
  • WebGLLights.WebGLLights.setup (cyclomatic 37) src/renderers/webgl/WebGLLights.js:221 — WebGLLights.WebGLLights.setup has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Guide.setupTOC (cyclomatic 37) · ×1
  • Guide.setupTOC (cyclomatic 37) REDACTED:1965 — Guide.setupTOC has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 14 of the 37 points are its own statements and the rest belongs to 7 function items inside it that branch (createTOCNode, a function literal at line 2121, a function literal at line 2149, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · publish.publish (cyclomatic 37) · ×1
  • publish.publish (cyclomatic 37) utils/docs/template/publish.js:655 — publish.publish has cyclomatic complexity 37 (threshold 15). Of this number, 16 points are the body's own statements and 21 belong to 7 function literals inside it that branch. 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 · WebGLLights.setup (cyclomatic 37) · ×1
  • WebGLLights.setup (cyclomatic 37) src/renderers/webgl/WebGLLights.js:221 — WebGLLights.setup has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · acorn.pp$3.parsePropertyValue (cyclomatic 36) · ×1
  • acorn.pp$3.parsePropertyValue (cyclomatic 36) editor/js/libs/acorn/acorn.js:2521 — acorn.pp$3.parsePropertyValue 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 · NodeBuilder.generateConst (cyclomatic 36) · ×1
  • NodeBuilder.generateConst (cyclomatic 36) src/nodes/core/NodeBuilder.js:1557 — NodeBuilder.generateConst has cyclomatic complexity 36 (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 · WebGPUTextureUtils.createTexture (cyclomatic 36) · ×1
  • WebGPUTextureUtils.createTexture (cyclomatic 36) src/renderers/webgpu/utils/WebGPUTextureUtils.js:302 — WebGPUTextureUtils.createTexture has cyclomatic complexity 36 (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 · EditorControls.constructor (cyclomatic 35) · ×1
  • EditorControls.constructor (cyclomatic 35) editor/js/EditorControls.js:5 — EditorControls.constructor has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 1 of the 35 points is its own statement and the rest belongs to 17 function items inside it that branch (onPointerDown, onMouseDown, onMouseMove, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · Sidebar.Material.SidebarMaterial (cyclomatic 35) · ×1
  • Sidebar.Material.SidebarMaterial (cyclomatic 35) editor/js/Sidebar.Material.js:15 — Sidebar.Material.SidebarMaterial has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 1 of the 35 points is its own statement and the rest belongs to 6 function items inside it that branch (update, refreshUI, a function literal at line 654, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · Animation.Animation (cyclomatic 35) · ×1
  • Animation.Animation (cyclomatic 35) editor/js/Animation.js:5 — Animation.Animation has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 1 of the 35 points is its own statement and the rest belongs to 15 function items inside it that branch (update, a function literal at line 51, getObjectName, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · codemirror.measureCharInner (cyclomatic 35) · ×1
  • codemirror.measureCharInner (cyclomatic 35) editor/js/libs/codemirror/codemirror.js:2489 — codemirror.measureCharInner 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 · ShapePath.toShapes (cyclomatic 35) · ×1
  • ShapePath.toShapes (cyclomatic 35) src/extras/core/ShapePath.js:146 — ShapePath.toShapes has cyclomatic complexity 35 (threshold 15). Of this number, 28 points are the body's own statements and 7 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Textures.updateRenderTarget (cyclomatic 35) · ×1
  • Textures.updateRenderTarget (cyclomatic 35) src/renderers/common/Textures.js:131 — Textures.updateRenderTarget 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 · WebGPUBackend.beginRender (cyclomatic 35) · ×1
  • WebGPUBackend.beginRender (cyclomatic 35) src/renderers/webgpu/WebGPUBackend.js:893 — WebGPUBackend.beginRender 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. This is NOT this file's highest cyclomatic complexity: WebGPUBackend.needsRenderUpdate (cyclomatic 38) 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 · codemirror.onScrollWheel (cyclomatic 34) · ×1
  • codemirror.onScrollWheel (cyclomatic 34) editor/js/libs/codemirror/codemirror.js:4511 — codemirror.onScrollWheel has cyclomatic complexity 34 (threshold 15). Of this number, 27 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ObjectLoader.parseTextures (cyclomatic 34) · ×1
  • ObjectLoader.parseTextures (cyclomatic 34) src/loaders/ObjectLoader.js:674 — ObjectLoader.parseTextures has cyclomatic complexity 34 (threshold 15). Of this number, 33 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WebGLTextureUtils.updateTexture (cyclomatic 34) · ×1
  • WebGLTextureUtils.updateTexture (cyclomatic 34) src/renderers/webgl-fallback/utils/WebGLTextureUtils.js:530 — WebGLTextureUtils.updateTexture 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 · WebGPUBackend._getRenderPassDescriptor (cyclomatic 34) · ×1
  • WebGPUBackend._getRenderPassDescriptor (cyclomatic 34) src/renderers/webgpu/WebGPUBackend.js:681 — WebGPUBackend._getRenderPassDescriptor 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. This is NOT this file's highest cyclomatic complexity: WebGPUBackend.needsRenderUpdate (cyclomatic 38) 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 · packLDrawModel.parseObject (cyclomatic 34) · ×1
  • packLDrawModel.parseObject (cyclomatic 34) utils/packLDrawModel.mjs:93 — packLDrawModel.parseObject 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 · acorn-loose.lp$2.parseExprAtom (cyclomatic 33) · ×1
  • acorn-loose.lp$2.parseExprAtom (cyclomatic 33) editor/js/libs/acorn/acorn-loose.js:961 — acorn-loose.lp$2.parseExprAtom 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 · acorn.pp$1.parseClassElement (cyclomatic 33) · ×1
  • acorn.pp$1.parseClassElement (cyclomatic 33) editor/js/libs/acorn/acorn.js:1329 — acorn.pp$1.parseClassElement has cyclomatic complexity 33 (threshold 15). Of this number, 27 points are the body's own statements and 6 belong to one function item inside it that branches. 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 · codemirror.leftButtonSelect (cyclomatic 33) · ×1
  • codemirror.leftButtonSelect (cyclomatic 33) editor/js/libs/codemirror/codemirror.js:7477 — codemirror.leftButtonSelect has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 14 of the 33 points are its own statements and the rest belongs to 6 function items inside it that branch (extendTo, extend, a function literal at line 7603, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · WebGPUPipelineUtils.createRenderPipeline (cyclomatic 33) · ×1
  • WebGPUPipelineUtils.createRenderPipeline (cyclomatic 33) src/renderers/webgpu/utils/WebGPUPipelineUtils.js:71 — WebGPUPipelineUtils.createRenderPipeline has cyclomatic complexity 33 (threshold 15). Of this number, 23 points are the body's own statements and 10 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · changelog.processCommit (cyclomatic 33) · ×1
  • changelog.processCommit (cyclomatic 33) utils/changelog.js:451 — changelog.processCommit has cyclomatic complexity 33 (threshold 15). Of this number, 32 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Sidebar.Material.MapProperty.SidebarMaterialMapProperty (cyclomatic 32) · ×1
  • Sidebar.Material.MapProperty.SidebarMaterialMapProperty (cyclomatic 32) editor/js/Sidebar.Material.MapProperty.js:11 — Sidebar.Material.MapProperty.SidebarMaterialMapProperty has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 7 of the 32 points are its own statements and the rest belongs to 9 function items inside it that branch (update, onChange, onMapChange, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · Sidebar.Settings.Shortcuts.SidebarSettingsShortcuts (cyclomatic 32) · ×1
  • Sidebar.Settings.Shortcuts.SidebarSettingsShortcuts (cyclomatic 32) editor/js/Sidebar.Settings.Shortcuts.js:6 — Sidebar.Settings.Shortcuts.SidebarSettingsShortcuts has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 2 of the 32 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 99, a function literal at line 37, a function literal at line 58, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · codemirror.stretchSpansOverChange (cyclomatic 32) · ×1
  • codemirror.stretchSpansOverChange (cyclomatic 32) editor/js/libs/codemirror/codemirror.js:1372 — codemirror.stretchSpansOverChange 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 · codemirror.buildToken (cyclomatic 32) · ×1
  • codemirror.buildToken (cyclomatic 32) editor/js/libs/codemirror/codemirror.js:1801 — codemirror.buildToken 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 · codemirror.registerEventHandlers (cyclomatic 32) · ×1
  • codemirror.registerEventHandlers (cyclomatic 32) editor/js/libs/codemirror/codemirror.js:7962 — codemirror.registerEventHandlers has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 3 of the 32 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 8020, a function literal at line 8004, a function literal at line 7967, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · codemirror.ContentEditableInput.pollContent (cyclomatic 32) · ×1
  • codemirror.ContentEditableInput.pollContent (cyclomatic 32) editor/js/libs/codemirror/codemirror.js:9060 — codemirror.ContentEditableInput.pollContent 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 · make-geo-picking-texture.main (cyclomatic 32) · ×1
  • make-geo-picking-texture.main (cyclomatic 32) manual/resources/tools/geo-picking/make-geo-picking-texture.js:7 — make-geo-picking-texture.main has cyclomatic complexity 32 (threshold 15). Of this number, 22 points are the body's own statements and 10 belong to 3 function items inside it that branch. 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 · BatchedMesh._updateDrawParameters (cyclomatic 32) · ×1
  • BatchedMesh._updateDrawParameters (cyclomatic 32) src/objects/BatchedMesh.js:1578 — BatchedMesh._updateDrawParameters 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 · OperatorNode.generateNodeType (cyclomatic 32) · ×1
  • OperatorNode.generateNodeType (cyclomatic 32) src/nodes/math/OperatorNode.js:109 — OperatorNode.generateNodeType 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 · LoopNode.generate (cyclomatic 32) · ×1
  • LoopNode.generate (cyclomatic 32) src/nodes/utils/LoopNode.js:155 — LoopNode.generate has cyclomatic complexity 32 (threshold 15). Of this number, 31 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WebGLBindingStates.WebGLBindingStates.setupVertexAttributes (cyclomatic 32) · ×1
  • WebGLBindingStates.WebGLBindingStates.setupVertexAttributes (cyclomatic 32) src/renderers/webgl/WebGLBindingStates.js:315 — WebGLBindingStates.WebGLBindingStates.setupVertexAttributes 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 · WebGLBindingStates.setupVertexAttributes (cyclomatic 32) · ×1
  • WebGLBindingStates.setupVertexAttributes (cyclomatic 32) src/renderers/webgl/WebGLBindingStates.js:315 — WebGLBindingStates.setupVertexAttributes 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 · codemirror.skipAtomicInner (cyclomatic 31) · ×1
  • codemirror.skipAtomicInner (cyclomatic 31) editor/js/libs/codemirror/codemirror.js:5204 — codemirror.skipAtomicInner 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 · FileLoader.load (cyclomatic 31) · ×1
  • FileLoader.load (cyclomatic 31) src/loaders/FileLoader.js:78 — FileLoader.load has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 7 of the 31 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 144, 227, 183, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · StandardDrawingPipeline.project (cyclomatic 31) · ×1
  • StandardDrawingPipeline.project (cyclomatic 31) src/renderers/common/StandardDrawingPipeline.js:182 — StandardDrawingPipeline.project 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 · Renderer._renderScene (cyclomatic 31) · ×1
  • Renderer._renderScene (cyclomatic 31) src/renderers/common/Renderer.js:1989 — Renderer._renderScene has cyclomatic complexity 31 (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 · WebGLBackend._resolveRenderTarget (cyclomatic 31) · ×1
  • WebGLBackend._resolveRenderTarget (cyclomatic 31) src/renderers/webgl-fallback/WebGLBackend.js:2786 — WebGLBackend._resolveRenderTarget 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 · MenubarFile (cyclomatic 31) · ×1
  • MenubarFile (cyclomatic 31) editor/js/Menubar.File.js:4 — MenubarFile has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 2 of the 31 points are its own statements and the rest belongs to 34 function items inside it that branch (a function literal at line 513, a function literal at line 541, a function literal at line 275, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · codemirror.TextMarker.clear (cyclomatic 30) · ×1
  • codemirror.TextMarker.clear (cyclomatic 30) editor/js/libs/codemirror/codemirror.js:5860 — codemirror.TextMarker.clear 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 · Renderer.compileAsync (cyclomatic 30) · ×1
  • Renderer.compileAsync (cyclomatic 30) src/renderers/common/Renderer.js:1019 — Renderer.compileAsync has cyclomatic complexity 30 (threshold 15). Of this number, 27 points are the body's own statements and 3 belong to 2 function items inside it that branch. 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 · WebGPUBackend.finishRender (cyclomatic 30) · ×1
  • WebGPUBackend.finishRender (cyclomatic 30) src/renderers/webgpu/WebGPUBackend.js:1431 — WebGPUBackend.finishRender 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. This is NOT this file's highest cyclomatic complexity: WebGPUBackend.needsRenderUpdate (cyclomatic 38) 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 · WebGPUBackend.draw (cyclomatic 30) · ×1
  • WebGPUBackend.draw (cyclomatic 30) src/renderers/webgpu/WebGPUBackend.js:2286 — WebGPUBackend.draw 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. This is NOT this file's highest cyclomatic complexity: WebGPUBackend.needsRenderUpdate (cyclomatic 38) 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 · WebXRManager.constructor · ×1
  • WebXRManager.constructor::onAnimationFrame (cyclomatic 30) src/renderers/webxr/WebXRManager.js:854 — WebXRManager.constructor::onAnimationFrame 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 · CodeRunner.serializeArg (cyclomatic 30) · ×1
  • CodeRunner.serializeArg (cyclomatic 30) REDACTED:288 — CodeRunner.serializeArg 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 · build-defs.buildDefs (cyclomatic 29) · ×1
  • build-defs.buildDefs (cyclomatic 29) editor/js/libs/tern-threejs/build-defs.js:107 — build-defs.buildDefs 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 · Sidebar.Project.Resources.SidebarProjectResources (cyclomatic 29) · ×1
  • Sidebar.Project.Resources.SidebarProjectResources (cyclomatic 29) editor/js/Sidebar.Project.Resources.js:6 — Sidebar.Project.Resources.SidebarProjectResources has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 1 of the 29 points is its own statement and the rest belongs to 5 function items inside it that branch (getTextureType, refreshTexturesUI, a function literal at line 207, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · PropertyBinding.bind (cyclomatic 29) · ×1
  • PropertyBinding.bind (cyclomatic 29) REDACTED:487 — PropertyBinding.bind 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 · ShadowNode.setupShadow (cyclomatic 29) · ×1
  • ShadowNode.setupShadow (cyclomatic 29) src/nodes/lighting/ShadowNode.js:365 — ShadowNode.setupShadow has cyclomatic complexity 29 (threshold 15). Of this number, 26 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WebGLBackend.clear (cyclomatic 29) · ×1
  • WebGLBackend.clear (cyclomatic 29) src/renderers/webgl-fallback/WebGLBackend.js:877 — WebGLBackend.clear 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 · WebGLState.WebGLState.setBlending (cyclomatic 29) · ×1
  • WebGLState.WebGLState.setBlending (cyclomatic 29) src/renderers/webgl/WebGLState.js:606 — WebGLState.WebGLState.setBlending 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 · SearchManager.calculateScore (cyclomatic 29) · ×1
  • SearchManager.calculateScore (cyclomatic 29) REDACTED:76 — SearchManager.calculateScore 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 · acorn.pp$2.toAssignable (cyclomatic 28) · ×1
  • acorn.pp$2.toAssignable (cyclomatic 28) editor/js/libs/acorn/acorn.js:1622 — acorn.pp$2.toAssignable 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 · codemirror.makeChangeFromHistory (cyclomatic 28) · ×1
  • codemirror.makeChangeFromHistory (cyclomatic 28) editor/js/libs/codemirror/codemirror.js:5343 — codemirror.makeChangeFromHistory has cyclomatic complexity 28 (threshold 15). Of this number, 21 points are the body's own statements and 7 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · codemirror.applyTextInput (cyclomatic 28) · ×1
  • codemirror.applyTextInput (cyclomatic 28) editor/js/libs/codemirror/codemirror.js:8148 — codemirror.applyTextInput 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 · codemirror.locateNodeInLineView (cyclomatic 28) · ×1
  • codemirror.locateNodeInLineView (cyclomatic 28) editor/js/libs/codemirror/codemirror.js:9282 — codemirror.locateNodeInLineView has cyclomatic complexity 28 (threshold 15). Of this number, 18 points are the body's own statements and 10 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · codemirror.TextareaInput.onContextMenu (cyclomatic 28) · ×1
  • codemirror.TextareaInput.onContextMenu (cyclomatic 28) editor/js/libs/codemirror/codemirror.js:9610 — codemirror.TextareaInput.onContextMenu has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 13 of the 28 points are its own statements and the rest belongs to 3 function items inside it that branch (rehide, rehide::poll, prepareSelectAllHack). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · acorn.pp$1.parseForStatement (cyclomatic 27) · ×1
  • acorn.pp$1.parseForStatement (cyclomatic 27) editor/js/libs/acorn/acorn.js:936 — acorn.pp$1.parseForStatement 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 · codemirror.updateDisplayIfNeeded (cyclomatic 27) · ×1
  • codemirror.updateDisplayIfNeeded (cyclomatic 27) editor/js/libs/codemirror/codemirror.js:4106 — codemirror.updateDisplayIfNeeded has cyclomatic complexity 27 (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 · BufferGeometryLoader.parse (cyclomatic 27) · ×1
  • BufferGeometryLoader.parse (cyclomatic 27) src/loaders/BufferGeometryLoader.js:90 — BufferGeometryLoader.parse has cyclomatic complexity 27 (threshold 15). Of this number, 24 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Info._getTextureMemorySize (cyclomatic 27) · ×1
  • Info._getTextureMemorySize (cyclomatic 27) src/renderers/common/Info.js:469 — Info._getTextureMemorySize has cyclomatic complexity 27 (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 · WebGPUTextureUtils.updateTexture (cyclomatic 27) · ×1
  • WebGPUTextureUtils.updateTexture (cyclomatic 27) src/renderers/webgpu/utils/WebGPUTextureUtils.js:643 — WebGPUTextureUtils.updateTexture 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 · WebGPUBackend._draw (cyclomatic 27) · ×1
  • WebGPUBackend._draw (cyclomatic 27) src/renderers/webgpu/WebGPUBackend.js:2087 — WebGPUBackend._draw 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. This is NOT this file's highest cyclomatic complexity: WebGPUBackend.needsRenderUpdate (cyclomatic 38) 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 · findHoleBridge (cyclomatic 27) · ×1
  • findHoleBridge (cyclomatic 27) src/extras/lib/earcut.js:314 — findHoleBridge 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 · acorn-loose.lp$2.parseObj (cyclomatic 26) · ×1
  • acorn-loose.lp$2.parseObj (cyclomatic 26) editor/js/libs/acorn/acorn-loose.js:1129 — acorn-loose.lp$2.parseObj 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 · codemirror.ContentEditableInput.showPrimarySelection (cyclomatic 26) · ×1
  • codemirror.ContentEditableInput.showPrimarySelection (cyclomatic 26) editor/js/libs/codemirror/codemirror.js:8919 — codemirror.ContentEditableInput.showPrimarySelection 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 · codemirror.TextareaInput.poll (cyclomatic 26) · ×1
  • codemirror.TextareaInput.poll (cyclomatic 26) editor/js/libs/codemirror/codemirror.js:9550 — codemirror.TextareaInput.poll has cyclomatic complexity 26 (threshold 15). Of this number, 22 points are the body's own statements and 4 belong to one function literal inside it that branches. 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 · tern.resolveFile (cyclomatic 26) · ×1
  • tern.resolveFile (cyclomatic 26) editor/js/libs/ternjs/tern.js:436 — tern.resolveFile has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 7 of the 26 points are its own statements and the rest belongs to one function literal inside it that branches (line 453). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · WebXRController.update (cyclomatic 26) · ×1
  • WebXRController.update (cyclomatic 26) src/renderers/webxr/WebXRController.js:224 — WebXRController.update 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 · TextureNode.generate (cyclomatic 26) · ×1
  • TextureNode.generate (cyclomatic 26) src/nodes/accessors/TextureNode.js:658 — TextureNode.generate 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 · Bindings._update (cyclomatic 26) · ×1
  • Bindings._update (cyclomatic 26) src/renderers/common/Bindings.js:450 — Bindings._update 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 · MarkdownUtils.renderSingleApiCard (cyclomatic 26) · ×1
  • MarkdownUtils.renderSingleApiCard (cyclomatic 26) tsl/js/utils/MarkdownUtils.js:999 — MarkdownUtils.renderSingleApiCard has cyclomatic complexity 26 (threshold 15). Of this number, 22 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SearchManager.scrollToSearchMatch (cyclomatic 26) · ×1
  • SearchManager.scrollToSearchMatch (cyclomatic 26) REDACTED:345 — SearchManager.scrollToSearchMatch has cyclomatic complexity 26 (threshold 15). Of this number, 25 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · acorn-loose.lp.readToken (cyclomatic 25) · ×1
  • acorn-loose.lp.readToken (cyclomatic 25) editor/js/libs/acorn/acorn-loose.js:201 — acorn-loose.lp.readToken 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 · codemirror.regChange (cyclomatic 25) · ×1
  • codemirror.regChange (cyclomatic 25) editor/js/libs/codemirror/codemirror.js:3004 — codemirror.regChange has cyclomatic complexity 25 (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 · infer.similarType (cyclomatic 25) · ×1
  • infer.similarType (cyclomatic 25) editor/js/libs/ternjs/infer.js:229 — infer.similarType 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 · TextureNode.setup (cyclomatic 25) · ×1
  • TextureNode.setup (cyclomatic 25) src/nodes/accessors/TextureNode.js:451 — TextureNode.setup has cyclomatic complexity 25 (threshold 15). Of this number, 20 points are the body's own statements and 5 belong to one function literal inside it that branches. 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 · NodeBuilder._resolveLayoutDefaults (cyclomatic 25) · ×1
  • NodeBuilder._resolveLayoutDefaults (cyclomatic 25) src/nodes/core/NodeBuilder.js:2913 — NodeBuilder._resolveLayoutDefaults has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 11 of the 25 points are its own statements and the rest belongs to 3 function items inside it that branch (walk, a function literal at line 2919, a function literal at line 2925). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · XRManager.onAnimationFrame (cyclomatic 25) · ×1
  • XRManager.onAnimationFrame (cyclomatic 25) src/renderers/common/XRManager.js:1772 — XRManager.onAnimationFrame 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 · Renderer._getShadowNodes (cyclomatic 25) · ×1
  • Renderer._getShadowNodes (cyclomatic 25) src/renderers/common/Renderer.js:3692 — Renderer._getShadowNodes 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 · Renderer.renderObject (cyclomatic 25) · ×1
  • Renderer.renderObject (cyclomatic 25) src/renderers/common/Renderer.js:3921 — Renderer.renderObject 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 · acorn.pp$2.checkLVal (cyclomatic 24) · ×1
  • acorn.pp$2.checkLVal (cyclomatic 24) editor/js/libs/acorn/acorn.js:1802 — acorn.pp$2.checkLVal 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 · acorn.pp$9.readNumber (cyclomatic 24) · ×1
  • acorn.pp$9.readNumber (cyclomatic 24) editor/js/libs/acorn/acorn.js:4642 — acorn.pp$9.readNumber 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 · codemirror.onKeyDown (cyclomatic 24) · ×1
  • codemirror.onKeyDown (cyclomatic 24) editor/js/libs/codemirror/codemirror.js:7244 — codemirror.onKeyDown has cyclomatic complexity 24 (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 · infer.canonicalType (cyclomatic 24) · ×1
  • infer.canonicalType (cyclomatic 24) editor/js/libs/ternjs/infer.js:276 — infer.canonicalType 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 · MeshPhysicalNodeMaterial.setupVariants (cyclomatic 24) · ×1
  • MeshPhysicalNodeMaterial.setupVariants (cyclomatic 24) src/materials/nodes/MeshPhysicalNodeMaterial.js:427 — MeshPhysicalNodeMaterial.setupVariants 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 · GLSLNodeBuilder.getVaryings (cyclomatic 24) · ×1
  • GLSLNodeBuilder.getVaryings (cyclomatic 24) src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js:1255 — GLSLNodeBuilder.getVaryings 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 · WebGLMorphtargets.WebGLMorphtargets.update (cyclomatic 24) · ×1
  • WebGLMorphtargets.WebGLMorphtargets.update (cyclomatic 24) src/renderers/webgl/WebGLMorphtargets.js:11 — WebGLMorphtargets.WebGLMorphtargets.update 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 · PlaygroundManager.renderPlaygroundTabs (cyclomatic 24) · ×1
  • PlaygroundManager.renderPlaygroundTabs (cyclomatic 24) tsl/js/managers/PlaygroundManager.js:265 — PlaygroundManager.renderPlaygroundTabs has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 4 of the 24 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 389, a function literal at line 496, a function literal at line 340, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · Guide.updateUI (cyclomatic 24) · ×1
  • Guide.updateUI (cyclomatic 24) REDACTED:1871 — Guide.updateUI has cyclomatic complexity 24 (threshold 15). Of this number, 17 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · highlight.getLightShape (cyclomatic 23) · ×1
  • highlight.getLightShape (cyclomatic 23) devtools/highlight.js:134 — highlight.getLightShape has cyclomatic complexity 23 (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 · Sidebar.Geometry.SidebarGeometry (cyclomatic 23) · ×1
  • Sidebar.Geometry.SidebarGeometry (cyclomatic 23) editor/js/Sidebar.Geometry.js:12 — Sidebar.Geometry.SidebarGeometry has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to 7 function items inside it that branch (build, refreshUI, a function literal at line 151, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · acorn.pp$9.readEscapedChar (cyclomatic 23) · ×1
  • acorn.pp$9.readEscapedChar (cyclomatic 23) editor/js/libs/acorn/acorn.js:4814 — acorn.pp$9.readEscapedChar 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 · codemirror.buildLineContent (cyclomatic 23) · ×1
  • codemirror.buildLineContent (cyclomatic 23) editor/js/libs/codemirror/codemirror.js:1734 — codemirror.buildLineContent 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 · codemirror.onDrop (cyclomatic 23) · ×1
  • codemirror.onDrop (cyclomatic 23) editor/js/libs/codemirror/codemirror.js:6534 — codemirror.onDrop has cyclomatic complexity 23 (threshold 15). Of this number, 19 points are the body's own statements and 4 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · codemirror.indentLine (cyclomatic 23) · ×1
  • codemirror.indentLine (cyclomatic 23) editor/js/libs/codemirror/codemirror.js:8080 — codemirror.indentLine 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 · comment.commentsBefore (cyclomatic 23) · ×1
  • comment.commentsBefore (cyclomatic 23) editor/js/libs/ternjs/comment.js:22 — comment.commentsBefore 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 · infer.inferClass (cyclomatic 23) · ×1
  • infer.inferClass (cyclomatic 23) editor/js/libs/ternjs/infer.js:1301 — infer.inferClass has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 11 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 1322). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · PolyhedronGeometry.constructor (cyclomatic 23) · ×1
  • PolyhedronGeometry.constructor (cyclomatic 23) src/geometries/PolyhedronGeometry.js:23 — PolyhedronGeometry.constructor has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 2 of the 23 points are its own statements and the rest belongs to 7 function items inside it that branch (subdivideFace, correctSeam, correctUV, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · Morph.morphReference (cyclomatic 23) · ×1
  • Morph.morphReference (cyclomatic 23) src/nodes/accessors/Morph.js:223 — Morph.morphReference has cyclomatic complexity 23 (threshold 15). Of this number, 16 points are the body's own statements and 7 belong to 4 function literals inside it that branch. 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 · WGSLNodeBuilder._getTextureBindingTypes (cyclomatic 23) · ×1
  • WGSLNodeBuilder._getTextureBindingTypes (cyclomatic 23) src/renderers/webgpu/nodes/WGSLNodeBuilder.js:2333 — WGSLNodeBuilder._getTextureBindingTypes 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 · WebGPUAttributeUtils.createAttribute (cyclomatic 23) · ×1
  • WebGPUAttributeUtils.createAttribute (cyclomatic 23) src/renderers/webgpu/utils/WebGPUAttributeUtils.js:131 — WebGPUAttributeUtils.createAttribute 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 · WebGLMaterials.WebGLMaterials.refreshUniformsPhysical (cyclomatic 23) · ×1
  • WebGLMaterials.WebGLMaterials.refreshUniformsPhysical (cyclomatic 23) src/renderers/webgl/WebGLMaterials.js:413 — WebGLMaterials.WebGLMaterials.refreshUniformsPhysical 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 · MarkdownUtils.parseGuide · ×1
  • MarkdownUtils.parseGuide::flatten (cyclomatic 23) tsl/js/utils/MarkdownUtils.js:131 — MarkdownUtils.parseGuide::flatten 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. This shape REPEATS in the file: one other method here (MarkdownUtils.parseGuide) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · MarkdownUtils.splitArguments (cyclomatic 23) · ×1
  • MarkdownUtils.splitArguments (cyclomatic 23) tsl/js/utils/MarkdownUtils.js:648 — MarkdownUtils.splitArguments 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 · MarkdownUtils.renderApiTableCard (cyclomatic 23) · ×1
  • MarkdownUtils.renderApiTableCard (cyclomatic 23) tsl/js/utils/MarkdownUtils.js:1119 — MarkdownUtils.renderApiTableCard has cyclomatic complexity 23 (threshold 15). Of this number, 19 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CodeRunner.parseScript (cyclomatic 23) · ×1
  • CodeRunner.parseScript (cyclomatic 23) REDACTED:23 — CodeRunner.parseScript has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 2 of the 23 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 66, extractPattern, a function literal at line 74, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · addCompletion (cyclomatic 23) · ×1
  • addCompletion (cyclomatic 23) editor/js/libs/ternjs/tern.js:686 — addCompletion 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 · WebGLMaterials.refreshUniformsPhysical (cyclomatic 23) · ×1
  • WebGLMaterials.refreshUniformsPhysical (cyclomatic 23) src/renderers/webgl/WebGLMaterials.js:413 — WebGLMaterials.refreshUniformsPhysical 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 · acorn.pp$3.checkPropClash (cyclomatic 22) · ×1
  • acorn.pp$3.checkPropClash (cyclomatic 22) editor/js/libs/acorn/acorn.js:1871 — acorn.pp$3.checkPropClash 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 · acorn.pp$3.parseProperty (cyclomatic 22) · ×1
  • acorn.pp$3.parseProperty (cyclomatic 22) editor/js/libs/acorn/acorn.js:2470 — acorn.pp$3.parseProperty 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 · codemirror.nodeAndOffsetInLineMap (cyclomatic 22) · ×1
  • codemirror.nodeAndOffsetInLineMap (cyclomatic 22) editor/js/libs/codemirror/codemirror.js:2441 — codemirror.nodeAndOffsetInLineMap 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 · codemirror.defineOptions (cyclomatic 22) · ×1
  • codemirror.defineOptions (cyclomatic 22) editor/js/libs/codemirror/codemirror.js:7710 — codemirror.defineOptions has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 2 of the 22 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 7776, option, a function literal at line 7741, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · codemirror.CodeMirror (cyclomatic 22) · ×1
  • codemirror.CodeMirror (cyclomatic 22) editor/js/libs/codemirror/codemirror.js:7885 — codemirror.CodeMirror has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 belong to one function literal inside it that branches. 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 · tern.doRequest (cyclomatic 22) · ×1
  • tern.doRequest (cyclomatic 22) editor/js/libs/ternjs/tern.js:235 — tern.doRequest has cyclomatic complexity 22 (threshold 15). Of this number, 14 points are the body's own statements and 8 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AnimationAction._updateTime (cyclomatic 22) · ×1
  • AnimationAction._updateTime (cyclomatic 22) src/animation/AnimationAction.js:724 — AnimationAction._updateTime 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 · NodeUtils.getValueFromType (cyclomatic 22) · ×1
  • NodeUtils.getValueFromType (cyclomatic 22) src/nodes/core/NodeUtils.js:370 — NodeUtils.getValueFromType 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 · MathNode.generate (cyclomatic 22) · ×1
  • MathNode.generate (cyclomatic 22) src/nodes/math/MathNode.js:226 — MathNode.generate 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 · NodeBuilder.format (cyclomatic 22) · ×1
  • NodeBuilder.format (cyclomatic 22) src/nodes/core/NodeBuilder.js:3761 — NodeBuilder.format 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 · WebGLTextureUtils._getBytesPerTexel (cyclomatic 22) · ×1
  • WebGLTextureUtils._getBytesPerTexel (cyclomatic 22) src/renderers/webgl-fallback/utils/WebGLTextureUtils.js:1395 — WebGLTextureUtils._getBytesPerTexel has cyclomatic complexity 22 (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 · WebGLClipping.WebGLClipping (cyclomatic 22) · ×1
  • WebGLClipping.WebGLClipping (cyclomatic 22) src/renderers/webgl/WebGLClipping.js:4 — WebGLClipping.WebGLClipping has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 5 of the 22 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 59, projectPlanes, a function literal at line 22, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · WebGLEnvironments.WebGLEnvironments.getPMREM (cyclomatic 22) · ×1
  • WebGLEnvironments.WebGLEnvironments.getPMREM (cyclomatic 22) src/renderers/webgl/WebGLEnvironments.js:71 — WebGLEnvironments.WebGLEnvironments.getPMREM 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 · MarkdownUtils.splitTypeTokens (cyclomatic 22) · ×1
  • MarkdownUtils.splitTypeTokens (cyclomatic 22) tsl/js/utils/MarkdownUtils.js:691 — MarkdownUtils.splitTypeTokens 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 · CodeRunner.processExportDeclarations (cyclomatic 22) · ×1
  • CodeRunner.processExportDeclarations (cyclomatic 22) REDACTED:165 — CodeRunner.processExportDeclarations has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 2 of the 22 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 205, extractPattern, a function literal at line 236, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · build.categorize (cyclomatic 22) · ×1
  • build.categorize (cyclomatic 22) utils/llms/build.js:566 — build.categorize 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 · updateDebugWGSL (cyclomatic 22) · ×1
  • updateDebugWGSL (cyclomatic 22) tsl/js/managers/PlaygroundManager.js:998 — updateDebugWGSL has cyclomatic complexity 22 (threshold 15). Of this number, 19 points are the body's own statements and 3 belong to 2 function literals inside it that branch. 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 · codemirror.coordsCharInner (cyclomatic 21) · ×1
  • codemirror.coordsCharInner (cyclomatic 21) editor/js/libs/codemirror/codemirror.js:2755 — codemirror.coordsCharInner has cyclomatic complexity 21 (threshold 15). Of this number, 18 points are the body's own statements and 3 belong to one function literal inside it that branches. 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 · codemirror.highlightWorker (cyclomatic 21) · ×1
  • codemirror.highlightWorker (cyclomatic 21) editor/js/libs/codemirror/codemirror.js:3993 — codemirror.highlightWorker has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 3 of the 21 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 4000, 4029). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · codemirror.ContentEditableInput.init (cyclomatic 21) · ×1
  • codemirror.ContentEditableInput.init (cyclomatic 21) editor/js/libs/codemirror/codemirror.js:8810 — codemirror.ContentEditableInput.init has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 7 function items inside it that branch (onCopyCut, a function literal at line 8826, belongsToInput, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · Ray.intersectTriangle (cyclomatic 21) · ×1
  • Ray.intersectTriangle (cyclomatic 21) src/math/Ray.js:538 — Ray.intersectTriangle has cyclomatic complexity 21 (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 · NodeMaterial.setup (cyclomatic 21) · ×1
  • NodeMaterial.setup (cyclomatic 21) src/materials/nodes/NodeMaterial.js:482 — NodeMaterial.setup 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 · NodeMaterial.setupDiffuseColor (cyclomatic 21) · ×1
  • NodeMaterial.setupDiffuseColor (cyclomatic 21) src/materials/nodes/NodeMaterial.js:828 — NodeMaterial.setupDiffuseColor has cyclomatic complexity 21 (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 · Textures.getSize (cyclomatic 21) · ×1
  • Textures.getSize (cyclomatic 21) src/renderers/common/Textures.js:556 — Textures.getSize has cyclomatic complexity 21 (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 · WebGPUBackend.clear (cyclomatic 21) · ×1
  • WebGPUBackend.clear (cyclomatic 21) src/renderers/webgpu/WebGPUBackend.js:1762 — WebGPUBackend.clear 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. This is NOT this file's highest cyclomatic complexity: WebGPUBackend.needsRenderUpdate (cyclomatic 38) 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 · CodeFormatter.removeUnusedImports · ×1
  • CodeFormatter.removeUnusedImports::getFullLineRange (cyclomatic 21) tsl/js/code/CodeFormatter.js:69 — CodeFormatter.removeUnusedImports::getFullLineRange 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 · (anonymous) (cyclomatic 21) · ×1
  • (anonymous) (cyclomatic 21) editor/js/libs/ternjs/infer.js:1487 — (anonymous) has cyclomatic complexity 21 (threshold 15). Of this number, 17 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · acorn-loose.lp$2.parseSubscripts (cyclomatic 20) · ×1
  • acorn-loose.lp$2.parseSubscripts (cyclomatic 20) editor/js/libs/acorn/acorn-loose.js:912 — acorn-loose.lp$2.parseSubscripts 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 · acorn.pp$3.parseSubscript (cyclomatic 20) · ×1
  • acorn.pp$3.parseSubscript (cyclomatic 20) editor/js/libs/acorn/acorn.js:2110 — acorn.pp$3.parseSubscript 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 · acorn.pp$5.declareName (cyclomatic 20) · ×1
  • acorn.pp$5.declareName (cyclomatic 20) editor/js/libs/acorn/acorn.js:2867 — acorn.pp$5.declareName 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 · codemirror.bidiSimplify (cyclomatic 20) · ×1
  • codemirror.bidiSimplify (cyclomatic 20) editor/js/libs/codemirror/codemirror.js:7615 — codemirror.bidiSimplify 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 · def.descendProps (cyclomatic 20) · ×1
  • def.descendProps (cyclomatic 20) editor/js/libs/ternjs/def.js:385 — def.descendProps 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 · infer.findPropRefs (cyclomatic 20) · ×1
  • infer.findPropRefs (cyclomatic 20) editor/js/libs/ternjs/infer.js:2191 — infer.findPropRefs has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to 4 function items inside it that branch (isObjTypeProto, a function literal at line 2211, a function literal at line 2215, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · ShaderMaterial.toJSON (cyclomatic 20) · ×1
  • ShaderMaterial.toJSON (cyclomatic 20) src/materials/ShaderMaterial.js:313 — ShaderMaterial.toJSON 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 · ShaderCallNodeInternal.call (cyclomatic 20) · ×1
  • ShaderCallNodeInternal.call (cyclomatic 20) src/nodes/tsl/TSLCore.js:497 — ShaderCallNodeInternal.call has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConditionalNode.generate (cyclomatic 20) · ×1
  • ConditionalNode.generate (cyclomatic 20) src/nodes/math/ConditionalNode.js:140 — ConditionalNode.generate 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 · Morph.getEntry (cyclomatic 20) · ×1
  • Morph.getEntry (cyclomatic 20) src/nodes/accessors/Morph.js:89 — Morph.getEntry 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 · WebGLMaterials.WebGLMaterials.refreshMaterialUniforms (cyclomatic 20) · ×1
  • WebGLMaterials.WebGLMaterials.refreshMaterialUniforms (cyclomatic 20) src/renderers/webgl/WebGLMaterials.js:42 — WebGLMaterials.WebGLMaterials.refreshMaterialUniforms 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 · MarkdownUtils.formatApiParameters (cyclomatic 20) · ×1
  • MarkdownUtils.formatApiParameters (cyclomatic 20) tsl/js/utils/MarkdownUtils.js:873 — MarkdownUtils.formatApiParameters 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 · CodeEditor.updateTokenizerForCode (cyclomatic 20) · ×1
  • CodeEditor.updateTokenizerForCode (cyclomatic 20) tsl/js/editor/CodeEditor.js:24 — CodeEditor.updateTokenizerForCode has cyclomatic complexity 20 (threshold 15). Of this number, 13 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · makeupType (cyclomatic 20) · ×1
  • makeupType (cyclomatic 20) editor/js/libs/ternjs/infer.js:171 — makeupType 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 · addType (cyclomatic 20) · ×1
  • addType (cyclomatic 20) editor/js/libs/ternjs/infer.js:368 — addType 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 · WebGLMaterials.refreshMaterialUniforms (cyclomatic 20) · ×1
  • WebGLMaterials.refreshMaterialUniforms (cyclomatic 20) src/renderers/webgl/WebGLMaterials.js:42 — WebGLMaterials.refreshMaterialUniforms 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 · acorn.pp$1.parseFunction (cyclomatic 19) · ×1
  • acorn.pp$1.parseFunction (cyclomatic 19) editor/js/libs/acorn/acorn.js:1253 — acorn.pp$1.parseFunction 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 · codemirror.conflictingCollapsedRange (cyclomatic 19) · ×1
  • codemirror.conflictingCollapsedRange (cyclomatic 19) editor/js/libs/codemirror/codemirror.js:1535 — codemirror.conflictingCollapsedRange 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 · codemirror.calculateScrollPos (cyclomatic 19) · ×1
  • codemirror.calculateScrollPos (cyclomatic 19) editor/js/libs/codemirror/codemirror.js:3501 — codemirror.calculateScrollPos 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 · codemirror.onMouseDown (cyclomatic 19) · ×1
  • codemirror.onMouseDown (cyclomatic 19) editor/js/libs/codemirror/codemirror.js:7337 — codemirror.onMouseDown 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 · codemirror.domTextBetween (cyclomatic 19) · ×1
  • codemirror.domTextBetween (cyclomatic 19) editor/js/libs/codemirror/codemirror.js:9210 — codemirror.domTextBetween has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to 3 function items inside it that branch (walk, close, addText). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · def.passTwo (cyclomatic 19) · ×1
  • def.passTwo (cyclomatic 19) editor/js/libs/ternjs/def.js:456 — def.passTwo 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 · Material.setValues (cyclomatic 19) · ×1
  • Material.setValues (cyclomatic 19) src/materials/Material.js:557 — Material.setValues has cyclomatic complexity 19 (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 · CylinderGeometry.constructor (cyclomatic 19) · ×1
  • CylinderGeometry.constructor (cyclomatic 19) src/geometries/CylinderGeometry.js:34 — CylinderGeometry.constructor has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to 2 function items inside it that branch (generateTorso, generateCap). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · ShaderMaterial.fromJSON (cyclomatic 19) · ×1
  • ShaderMaterial.fromJSON (cyclomatic 19) src/materials/ShaderMaterial.js:415 — ShaderMaterial.fromJSON 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 · Node._getChildren (cyclomatic 19) · ×1
  • Node._getChildren (cyclomatic 19) src/nodes/core/Node.js:634 — Node._getChildren 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 · WGSLNodeBuilder.getUniformFromNode (cyclomatic 19) · ×1
  • WGSLNodeBuilder.getUniformFromNode (cyclomatic 19) src/renderers/webgpu/nodes/WGSLNodeBuilder.js:1387 — WGSLNodeBuilder.getUniformFromNode 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 · MarkdownUtils.formatSignatureArgs (cyclomatic 19) · ×1
  • MarkdownUtils.formatSignatureArgs (cyclomatic 19) tsl/js/utils/MarkdownUtils.js:764 — MarkdownUtils.formatSignatureArgs 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 · createSimpleLexer (cyclomatic 19) · ×1
  • createSimpleLexer (cyclomatic 19) REDACTED:662 — createSimpleLexer has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 2 function items inside it that branch (decorate, a function literal at line 665). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · findQueryExpr (cyclomatic 19) · ×1
  • findQueryExpr (cyclomatic 19) editor/js/libs/ternjs/tern.js:845 — findQueryExpr 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 · acorn.pp$3.parseParenAndDistinguishExpression (cyclomatic 18) · ×1
  • acorn.pp$3.parseParenAndDistinguishExpression (cyclomatic 18) editor/js/libs/acorn/acorn.js:2299 — acorn.pp$3.parseParenAndDistinguishExpression 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 · acorn.pp$7.braceIsBlock (cyclomatic 18) · ×1
  • acorn.pp$7.braceIsBlock (cyclomatic 18) editor/js/libs/acorn/acorn.js:3004 — acorn.pp$7.braceIsBlock has cyclomatic complexity 18 (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 · codemirror.removeReadOnlyRanges (cyclomatic 18) · ×1
  • codemirror.removeReadOnlyRanges (cyclomatic 18) editor/js/libs/codemirror/codemirror.js:1445 — codemirror.removeReadOnlyRanges has cyclomatic complexity 18 (threshold 15). Of this number, 12 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · codemirror.endOperation_finish (cyclomatic 18) · ×1
  • codemirror.endOperation_finish (cyclomatic 18) editor/js/libs/codemirror/codemirror.js:3912 — codemirror.endOperation_finish 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 · codemirror.onKeyPress (cyclomatic 18) · ×1
  • codemirror.onKeyPress (cyclomatic 18) editor/js/libs/codemirror/codemirror.js:7288 — codemirror.onKeyPress has cyclomatic complexity 18 (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 · codemirror.TextareaInput.init (cyclomatic 18) · ×1
  • codemirror.TextareaInput.init (cyclomatic 18) editor/js/libs/codemirror/codemirror.js:9355 — codemirror.TextareaInput.init has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to 7 function items inside it that branch (prepareCopyCut, a function literal at line 9367, a function literal at line 9401, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · infer.maybeTagAsGeneric (cyclomatic 18) · ×1
  • infer.maybeTagAsGeneric (cyclomatic 18) editor/js/libs/ternjs/infer.js:1027 — infer.maybeTagAsGeneric has cyclomatic complexity 18 (threshold 15). Of this number, 10 points are the body's own statements and 8 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · tern.invalidDoc (cyclomatic 18) · ×1
  • tern.invalidDoc (cyclomatic 18) editor/js/libs/ternjs/tern.js:546 — tern.invalidDoc 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 · prettify.recombineTagsAndDecorations (cyclomatic 18) · ×1
  • prettify.recombineTagsAndDecorations (cyclomatic 18) REDACTED:1181 — prettify.recombineTagsAndDecorations has cyclomatic complexity 18 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D1 · Cyclomatic Complexity · Ray.intersectBox (cyclomatic 18) · ×1
  • Ray.intersectBox (cyclomatic 18) src/math/Ray.js:449 — Ray.intersectBox 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 · ShaderCallNodeInternal.build (cyclomatic 18) · ×1
  • ShaderCallNodeInternal.build (cyclomatic 18) src/nodes/tsl/TSLCore.js:667 — ShaderCallNodeInternal.build 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 · UniformArrayNode.updateBuffer (cyclomatic 18) · ×1
  • UniformArrayNode.updateBuffer (cyclomatic 18) src/nodes/accessors/UniformArrayNode.js:213 — UniformArrayNode.updateBuffer has cyclomatic complexity 18 (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 · RenderObject.getDrawParameters (cyclomatic 18) · ×1
  • RenderObject.getDrawParameters (cyclomatic 18) src/renderers/common/RenderObject.js:675 — RenderObject.getDrawParameters 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 · NodeBuilder.getPromotedComponentType (cyclomatic 18) · ×1
  • NodeBuilder.getPromotedComponentType (cyclomatic 18) src/nodes/core/NodeBuilder.js:1998 — NodeBuilder.getPromotedComponentType 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 · XRManager.setSession (cyclomatic 18) · ×1
  • XRManager.setSession (cyclomatic 18) src/renderers/common/XRManager.js:1192 — XRManager.setSession 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 · Renderer._getFrameBufferTarget (cyclomatic 18) · ×1
  • Renderer._getFrameBufferTarget (cyclomatic 18) src/renderers/common/Renderer.js:1886 — Renderer._getFrameBufferTarget has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function item inside it that branches. 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 · Renderer._updateCamera (cyclomatic 18) · ×1
  • Renderer._updateCamera (cyclomatic 18) src/renderers/common/Renderer.js:3801 — Renderer._updateCamera 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 · WebGPUPipelineUtils._getBlending (cyclomatic 18) · ×1
  • WebGPUPipelineUtils._getBlending (cyclomatic 18) src/renderers/webgpu/utils/WebGPUPipelineUtils.js:560 — WebGPUPipelineUtils._getBlending 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 · WebGLMaterials.WebGLMaterials.refreshUniformsCommon (cyclomatic 18) · ×1
  • WebGLMaterials.WebGLMaterials.refreshUniformsCommon (cyclomatic 18) src/renderers/webgl/WebGLMaterials.js:138 — WebGLMaterials.WebGLMaterials.refreshUniformsCommon 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 · server.createHandler.<returned closure> (cyclomatic 18) · ×1
  • server.createHandler.<returned closure> (cyclomatic 18) REDACTED:47 — server.createHandler.<returned closure> has cyclomatic complexity 18 (threshold 15). Of this number, 12 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MarkdownUtils.parseGuide (cyclomatic 18) · ×1
  • MarkdownUtils.parseGuide (cyclomatic 18) tsl/js/utils/MarkdownUtils.js:30 — MarkdownUtils.parseGuide 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 shape REPEATS in the file: one other method here (MarkdownUtils.parseGuide::flatten) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · WebGLMaterials.refreshUniformsCommon (cyclomatic 18) · ×1
  • WebGLMaterials.refreshUniformsCommon (cyclomatic 18) src/renderers/webgl/WebGLMaterials.js:138 — WebGLMaterials.refreshUniformsCommon 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 · RenderImageDialog.constructor (cyclomatic 17) · ×1
  • RenderImageDialog.constructor (cyclomatic 17) editor/js/Menubar.Render.js:76 — RenderImageDialog.constructor has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 157, 163, 287). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · acorn.pp$8.regexp_eatRegExpUnicodeEscapeSequence (cyclomatic 17) · ×1
  • acorn.pp$8.regexp_eatRegExpUnicodeEscapeSequence (cyclomatic 17) editor/js/libs/acorn/acorn.js:3806 — acorn.pp$8.regexp_eatRegExpUnicodeEscapeSequence 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 · acorn.pp$9.skipSpace (cyclomatic 17) · ×1
  • acorn.pp$9.skipSpace (cyclomatic 17) editor/js/libs/acorn/acorn.js:4331 — acorn.pp$9.skipSpace 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 · tern.findRefsToVariable (cyclomatic 17) · ×1
  • tern.findRefsToVariable (cyclomatic 17) editor/js/libs/ternjs/tern.js:1063 — tern.findRefsToVariable has cyclomatic complexity 17 (threshold 15). Of this number, 11 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Texture.transformUv (cyclomatic 17) · ×1
  • Texture.transformUv (cyclomatic 17) src/textures/Texture.js:697 — Texture.transformUv 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 · Triangle.closestPointToPoint (cyclomatic 17) · ×1
  • Triangle.closestPointToPoint (cyclomatic 17) src/math/Triangle.js:442 — Triangle.closestPointToPoint 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 · BufferGeometry.computeTangents (cyclomatic 17) · ×1
  • BufferGeometry.computeTangents (cyclomatic 17) src/core/BufferGeometry.js:839 — BufferGeometry.computeTangents has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to 2 function items inside it that branch. 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 · CatmullRomCurve3.getPoint (cyclomatic 17) · ×1
  • CatmullRomCurve3.getPoint (cyclomatic 17) src/extras/curves/CatmullRomCurve3.js:175 — CatmullRomCurve3.getPoint 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 · Interpolant.evaluate (cyclomatic 17) · ×1
  • Interpolant.evaluate (cyclomatic 17) src/math/Interpolant.js:92 — Interpolant.evaluate 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 · NodeMaterial.setupLighting (cyclomatic 17) · ×1
  • NodeMaterial.setupLighting (cyclomatic 17) src/materials/nodes/NodeMaterial.js:1115 — NodeMaterial.setupLighting 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 · RenderObject.getMaterialCacheKey (cyclomatic 17) · ×1
  • RenderObject.getMaterialCacheKey (cyclomatic 17) src/renderers/common/RenderObject.js:808 — RenderObject.getMaterialCacheKey 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 · NodeBuilder._getLayoutInputs (cyclomatic 17) · ×1
  • NodeBuilder._getLayoutInputs (cyclomatic 17) src/nodes/core/NodeBuilder.js:2851 — NodeBuilder._getLayoutInputs has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to 3 function literals inside it that branch. 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 · NodeBuilder.getNodeUniform (cyclomatic 17) · ×1
  • NodeBuilder.getNodeUniform (cyclomatic 17) src/nodes/core/NodeBuilder.js:3736 — NodeBuilder.getNodeUniform 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 · WebGLAttributeUtils.createAttribute (cyclomatic 17) · ×1
  • WebGLAttributeUtils.createAttribute (cyclomatic 17) src/renderers/webgl-fallback/utils/WebGLAttributeUtils.js:79 — WebGLAttributeUtils.createAttribute 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 · WebGLTextureUtils.setTextureParameters (cyclomatic 17) · ×1
  • WebGLTextureUtils.setTextureParameters (cyclomatic 17) src/renderers/webgl-fallback/utils/WebGLTextureUtils.js:325 — WebGLTextureUtils.setTextureParameters 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 · WebGPUBindingUtils.createBindGroup (cyclomatic 17) · ×1
  • WebGPUBindingUtils.createBindGroup (cyclomatic 17) src/renderers/webgpu/utils/WebGPUBindingUtils.js:302 — WebGPUBindingUtils.createBindGroup 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 · WebGPUBackend.copyFramebufferToTexture (cyclomatic 17) · ×1
  • WebGPUBackend.copyFramebufferToTexture (cyclomatic 17) src/renderers/webgpu/WebGPUBackend.js:3355 — WebGPUBackend.copyFramebufferToTexture 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: WebGPUBackend.needsRenderUpdate (cyclomatic 38) 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 · MarkdownUtils.tokenizeCodeToElement (cyclomatic 17) · ×1
  • MarkdownUtils.tokenizeCodeToElement (cyclomatic 17) tsl/js/utils/MarkdownUtils.js:1388 — MarkdownUtils.tokenizeCodeToElement 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 · PlaygroundManager.loadPlaygroundFromHash (cyclomatic 17) · ×1
  • PlaygroundManager.loadPlaygroundFromHash (cyclomatic 17) tsl/js/managers/PlaygroundManager.js:169 — PlaygroundManager.loadPlaygroundFromHash 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 · publish.buildSearchListForData (cyclomatic 17) · ×1
  • publish.buildSearchListForData (cyclomatic 17) utils/docs/template/publish.js:145 — publish.buildSearchListForData has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to one function literal inside it that branches (line 161). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · renderObject (cyclomatic 17) · ×1
  • renderObject (cyclomatic 17) devtools/panel/panel.js:443 — renderObject has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to 9 function literals inside it that branch. 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 · UIOutliner.setOptions (cyclomatic 16) · ×1
  • UIOutliner.setOptions (cyclomatic 16) editor/js/libs/ui.three.js:342 — UIOutliner.setOptions has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 5 function items inside it that branch (onDrop, onDragOver, moveObject, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · acorn.pp$3.parseMaybeUnary (cyclomatic 16) · ×1
  • acorn.pp$3.parseMaybeUnary (cyclomatic 16) editor/js/libs/acorn/acorn.js:2047 — acorn.pp$3.parseMaybeUnary 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 · acorn.pp$9.readTmplToken (cyclomatic 16) · ×1
  • acorn.pp$9.readTmplToken (cyclomatic 16) editor/js/libs/acorn/acorn.js:4743 — acorn.pp$9.readTmplToken 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 · codemirror.updateLineGutter (cyclomatic 16) · ×1
  • codemirror.updateLineGutter (cyclomatic 16) editor/js/libs/codemirror/codemirror.js:2177 — codemirror.updateLineGutter 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 · codemirror.patchDisplay (cyclomatic 16) · ×1
  • codemirror.patchDisplay (cyclomatic 16) editor/js/libs/codemirror/codemirror.js:4227 — codemirror.patchDisplay has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · codemirror.addChangeToHistory (cyclomatic 16) · ×1
  • codemirror.addChangeToHistory (cyclomatic 16) editor/js/libs/codemirror/codemirror.js:4898 — codemirror.addChangeToHistory 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 · codemirror.makeChangeSingleDocInEditor (cyclomatic 16) · ×1
  • codemirror.makeChangeSingleDocInEditor (cyclomatic 16) editor/js/libs/codemirror/codemirror.js:5471 — codemirror.makeChangeSingleDocInEditor has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · tern.analyzeAll (cyclomatic 16) · ×1
  • tern.analyzeAll (cyclomatic 16) editor/js/libs/ternjs/tern.js:361 — tern.analyzeAll 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 · Texture.setValues (cyclomatic 16) · ×1
  • Texture.setValues (cyclomatic 16) src/textures/Texture.js:554 — Texture.setValues has cyclomatic complexity 16 (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 · RenderTarget._setTextureOptions (cyclomatic 16) · ×1
  • RenderTarget._setTextureOptions (cyclomatic 16) src/core/RenderTarget.js:284 — RenderTarget._setTextureOptions 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 · Color.setStyle (cyclomatic 16) · ×1
  • Color.setStyle (cyclomatic 16) src/math/Color.js:286 — Color.setStyle has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BufferGeometry.toJSON (cyclomatic 16) · ×1
  • BufferGeometry.toJSON (cyclomatic 16) src/core/BufferGeometry.js:1242 — BufferGeometry.toJSON 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 · AnimationUtils.makeClipAdditive (cyclomatic 16) · ×1
  • AnimationUtils.makeClipAdditive (cyclomatic 16) src/animation/AnimationUtils.js:263 — AnimationUtils.makeClipAdditive has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ImageLoader.load (cyclomatic 16) · ×1
  • ImageLoader.load (cyclomatic 16) src/loaders/ImageLoader.js:45 — ImageLoader.load has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 3 function items inside it that branch (onImageLoad, onImageError, a function literal at line 61). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · CubeCamera.update (cyclomatic 16) · ×1
  • CubeCamera.update (cyclomatic 16) src/cameras/CubeCamera.js:178 — CubeCamera.update 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 · NodeUtils.getValueType (cyclomatic 16) · ×1
  • NodeUtils.getValueType (cyclomatic 16) src/nodes/core/NodeUtils.js:229 — NodeUtils.getValueType 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 · NodeBuilder.isDeterministic (cyclomatic 16) · ×1
  • NodeBuilder.isDeterministic (cyclomatic 16) src/nodes/core/NodeBuilder.js:2465 — NodeBuilder.isDeterministic 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 · NodeManager.updateBackground (cyclomatic 16) · ×1
  • NodeManager.updateBackground (cyclomatic 16) src/renderers/common/nodes/NodeManager.js:517 — NodeManager.updateBackground has cyclomatic complexity 16 (threshold 15). Of this number, 8 points are the body's own statements and 8 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · XRManager.foveateBoundTexture (cyclomatic 16) · ×1
  • XRManager.foveateBoundTexture (cyclomatic 16) src/renderers/common/XRManager.js:654 — XRManager.foveateBoundTexture 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 · DirectRenderPipeline.render (cyclomatic 16) · ×1
  • DirectRenderPipeline.render (cyclomatic 16) src/renderers/common/DirectRenderPipeline.js:77 — DirectRenderPipeline.render 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 · SearchManager.getRankedTree (cyclomatic 16) · ×1
  • SearchManager.getRankedTree (cyclomatic 16) REDACTED:214 — SearchManager.getRankedTree has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 2 function items inside it that branch (processNodes, a function literal at line 276). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · PlaygroundManager.getImportedCustomScripts (cyclomatic 16) · ×1
  • PlaygroundManager.getImportedCustomScripts (cyclomatic 16) tsl/js/managers/PlaygroundManager.js:1104 — PlaygroundManager.getImportedCustomScripts 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 · generateMaterialXNodeInterfaceRegistry.parseNodeDefs (cyclomatic 16) · ×1
  • generateMaterialXNodeInterfaceRegistry.parseNodeDefs (cyclomatic 16) utils/generateMaterialXNodeInterfaceRegistry.js:71 — generateMaterialXNodeInterfaceRegistry.parseNodeDefs 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 · (anonymous) (cyclomatic 16) · ×1
  • (anonymous) (cyclomatic 16) editor/js/libs/ternjs/infer.js:1401 — (anonymous) has cyclomatic complexity 16 (threshold 15). Of this number, 9 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · getDepthBuffer (cyclomatic 16) · ×1
  • getDepthBuffer (cyclomatic 16) src/renderers/webgpu/utils/WebGPUTextureUtils.js:573 — getDepthBuffer 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 · parseFnType (cyclomatic 16) · ×1
  • parseFnType (cyclomatic 16) editor/js/libs/ternjs/def.js:96 — parseFnType 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 · parseEffect (cyclomatic 16) · ×1
  • parseEffect (cyclomatic 16) editor/js/libs/ternjs/def.js:314 — parseEffect has cyclomatic complexity 16 (threshold 15). Of this number, 11 points are the body's own statements and 5 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · flattenJSON (cyclomatic 16) · ×1
  • flattenJSON (cyclomatic 16) src/animation/AnimationUtils.js:99 — flattenJSON 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.
D15 · Churn × Complexity Hotspots · Repeated repair · ×1
  • Repeated repair: examples/jsm/tsl/WebGLNodesHandler.js examples/jsm/tsl/WebGLNodesHandler.js:275 — examples/jsm/tsl/WebGLNodesHandler.js changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is WebGLNodesHandler.constructor at line 275), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “WebGLNodesHandler: Fix `camera` reference. (#35415)”; “GLSLNodeBuilder: Fix uniform block lookups in shared bind groups. (#35222)”; “WebGPURenderer: Fix shader reuse for instanced meshes. (#34872)”; “WebGLNodesHandler: Fix error with `getCanvasTarget` in WebGLRenderer. (#34303)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 11:38:01 +01:00' --until='2026-11-13 11:38:01 +01:00' --full-history --no-merges -- examples/jsm/tsl/WebGLNodesHandler.js`: 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.
D2 · Cognitive Complexity · WebGLProgram (cognitive 356) · ×1
  • WebGLProgram (cognitive 356) src/renderers/webgl/WebGLProgram.js:372 — WebGLProgram has cognitive complexity 356 (threshold 15). Drivers by points: ternaries 161 (320 pts), if/else 17 (23 pts), boolean chains 13 (nesting depth added 165). Of this number, 338 points are the body's own statements and 18 belong to 5 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WebGLUtils.convert (cognitive 256) · ×1
  • WebGLUtils.convert (cognitive 256) src/renderers/webgl-fallback/utils/WebGLUtils.js:51 — WebGLUtils.convert has cognitive complexity 256 (threshold 15). Drivers by points: if/else 84 (180 pts), ternaries 18 (69 pts), boolean chains 7 (nesting depth added 147). 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 · WebGLUtils.WebGLUtils.convert (cognitive 256) · ×1
  • WebGLUtils.WebGLUtils.convert (cognitive 256) src/renderers/webgl/WebGLUtils.js:6 — WebGLUtils.WebGLUtils.convert has cognitive complexity 256 (threshold 15). Drivers by points: if/else 84 (180 pts), ternaries 18 (69 pts), boolean chains 7 (nesting depth added 147). 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 · Material.fromJSON (cognitive 166) · ×1
  • Material.fromJSON (cognitive 166) src/materials/Material.js:920 — Material.fromJSON has cognitive complexity 166 (threshold 15). Drivers by points: if/else 131 (133 pts), boolean chains 33 (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 · getInternalFormat (cognitive 156) · ×1
  • getInternalFormat (cognitive 156) src/renderers/webgl-fallback/utils/WebGLTextureUtils.js:165 — getInternalFormat has cognitive complexity 156 (threshold 15). Drivers by points: if/else 75 (137 pts), ternaries 4 (10 pts), boolean chains 9 (nesting depth added 68). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · run (cognitive 151) · ×1
  • run (cognitive 151) REDACTED:897 — run has cognitive complexity 151 (threshold 15). Drivers by points: if/else 38 (107 pts), boolean chains 14, ternaries 4 (12 pts), loops 8 (11 pts), error handling 3 (7 pts) (nesting depth added 84). Of this number, 130 points are the body's own statements and 21 belong to 6 function literals inside it that branch. 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 · insertLineContent (cognitive 147) · ×1
  • insertLineContent (cognitive 147) editor/js/libs/codemirror/codemirror.js:1921 — insertLineContent has cognitive complexity 147 (threshold 15). Drivers by points: if/else 23 (84 pts), ternaries 5 (25 pts), loops 7 (22 pts), boolean chains 16 (nesting depth added 96). 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 · parseObject (cognitive 141) · ×1
  • parseObject (cognitive 141) src/loaders/ObjectLoader.js:784 — parseObject has cognitive complexity 141 (threshold 15). Drivers by points: if/else 75 (130 pts), loops 4 (8 pts), boolean chains 2, match/switch 1 (nesting depth added 59). Of this number, 127 points are the body's own statements and 14 belong to 6 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · getFormat (cognitive 138) · ×1
  • getFormat (cognitive 138) src/renderers/webgpu/utils/WebGPUTextureUtils.js:1481 — getFormat has cognitive complexity 138 (threshold 15). Drivers by points: ternaries 28 (92 pts), match/switch 11 (31 pts), if/else 7 (13 pts), boolean chains 2 (nesting depth added 90). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _setFramebuffer (cognitive 133) · ×1
  • _setFramebuffer (cognitive 133) src/renderers/webgl-fallback/WebGLBackend.js:2384 — _setFramebuffer has cognitive complexity 133 (threshold 15). Drivers by points: if/else 39 (93 pts), ternaries 5 (20 pts), boolean chains 12, loops 2 (8 pts) (nesting depth added 75). 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 · load (cognitive 132) · ×1
  • load (cognitive 132) REDACTED:584 — load has cognitive complexity 132 (threshold 15). Drivers by points: if/else 31 (89 pts), error handling 7 (20 pts), loops 4 (13 pts), boolean chains 10 (nesting depth added 80). Of this number, 19 points are the body's own statements and 113 belong to 4 function literals inside it that branch. 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 · Loader (cognitive 127) · ×1
  • Loader (cognitive 127) editor/js/Loader.js:14 — Loader has cognitive complexity 127 (threshold 15). Drivers by points: if/else 37 (75 pts), loops 13 (29 pts), error handling 6 (14 pts), boolean chains 5, match/switch 3 (4 pts) (nesting depth added 63). None of this is in the body itself: all 127 points belong to 48 function items inside it that branch (a function literal at line 691, handleZIP, loadFiles::createFileFinder, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · (anonymous) (cognitive 124) · ×1
  • (anonymous) (cognitive 124) editor/js/libs/codemirror/codemirror.js:370 — (anonymous) has cognitive complexity 124 (threshold 15). Drivers by points: if/else 29 (49 pts), loops 16 (34 pts), boolean chains 21, ternaries 8 (20 pts) (nesting depth added 50). None of this is in the body itself: all 124 points belong to 3 function items inside it that branch (a function literal at line 393, charType, BidiSpan). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · equals (cognitive 123) · ×1
  • equals (cognitive 123) src/materials/nodes/manager/NodeMaterialObserver.js:587 — equals has cognitive complexity 123 (threshold 15). Drivers by points: if/else 41 (78 pts), ternaries 8 (21 pts), boolean chains 14, loops 5 (10 pts) (nesting depth added 55). 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 · Material.toJSON (cognitive 119) · ×1
  • Material.toJSON (cognitive 119) src/materials/Material.js:610 — Material.toJSON has cognitive complexity 119 (threshold 15). Drivers by points: if/else 81 (84 pts), boolean chains 34, loops 1 (nesting depth added 3). Of this number, 118 points are the body's own statements and 1 belongs to one function item inside it that branches. 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 · Viewport.Viewport (cognitive 113) · ×1
  • Viewport.Viewport (cognitive 113) editor/js/Viewport.js:25 — Viewport.Viewport has cognitive complexity 113 (threshold 15). Drivers by points: if/else 58 (80 pts), boolean chains 12, ternaries 5 (9 pts), match/switch 6, loops 3 (4 pts), error handling 1 (2 pts) (nesting depth added 28). None of this is in the body itself: all 113 points belong to 32 function items inside it that branch (a function literal at line 105, a function literal at line 493, a function literal at line 348, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · setup (cognitive 110) · ×1
  • setup (cognitive 110) src/nodes/accessors/MaterialNode.js:120 — setup has cognitive complexity 110 (threshold 15). Drivers by points: if/else 68 (91 pts), boolean chains 15, ternaries 2 (4 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 · WebGLBindingStates.WebGLBindingStates.setupVertexAttributes (cognitive 105) · ×1
  • WebGLBindingStates.WebGLBindingStates.setupVertexAttributes (cognitive 105) src/renderers/webgl/WebGLBindingStates.js:315 — WebGLBindingStates.WebGLBindingStates.setupVertexAttributes has cognitive complexity 105 (threshold 15). Drivers by points: if/else 16 (54 pts), loops 7 (35 pts), boolean chains 6, match/switch 1 (5 pts), ternaries 1 (5 pts) (nesting depth added 74). 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 · skipAtomicInner (cognitive 105) · ×1
  • skipAtomicInner (cognitive 105) editor/js/libs/codemirror/codemirror.js:5204 — skipAtomicInner has cognitive complexity 105 (threshold 15). Drivers by points: ternaries 12 (55 pts), if/else 11 (42 pts), boolean chains 6, loops 1 (2 pts) (nesting depth added 75). 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 · WebGLBindingStates.setupVertexAttributes (cognitive 105) · ×1
  • WebGLBindingStates.setupVertexAttributes (cognitive 105) src/renderers/webgl/WebGLBindingStates.js:315 — WebGLBindingStates.setupVertexAttributes has cognitive complexity 105 (threshold 15). Drivers by points: if/else 16 (54 pts), loops 7 (35 pts), boolean chains 6, match/switch 1 (5 pts), ternaries 1 (5 pts) (nesting depth added 74). 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 · Guide.renderPage (cognitive 104) · ×1
  • Guide.renderPage (cognitive 104) REDACTED:1153 — Guide.renderPage has cognitive complexity 104 (threshold 15). Drivers by points: if/else 45 (67 pts), boolean chains 25, ternaries 7 (10 pts), loops 1 (2 pts) (nesting depth added 26). Of this number, 65 points are the body's own statements and 39 belong to 19 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _initMonaco (cognitive 103) · ×1
  • _initMonaco (cognitive 103) tsl/js/editor/CodeEditor.js:253 — _initMonaco has cognitive complexity 103 (threshold 15). Drivers by points: if/else 38 (82 pts), boolean chains 14, loops 1 (3 pts), error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 48). None of this is in the body itself: all 103 points belong to 23 function items inside it that branch (a function literal at line 255, (anonymous)::_touchMoveListener, (anonymous)::provideCompletionItems::getAdditionalTextEdits, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · ObjectLoader.parseTextures (cognitive 97) · ×1
  • ObjectLoader.parseTextures (cognitive 97) src/loaders/ObjectLoader.js:674 — ObjectLoader.parseTextures has cognitive complexity 97 (threshold 15). Drivers by points: if/else 33 (94 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 62). Of this number, 96 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parseStatement (cognitive 94) · ×1
  • parseStatement (cognitive 94) editor/js/libs/acorn/acorn-loose.js:304 — parseStatement has cognitive complexity 94 (threshold 15). Drivers by points: if/else 28 (61 pts), boolean chains 16, ternaries 6 (14 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WebGLPrograms.getParameters (cognitive 94) · ×1
  • WebGLPrograms.getParameters (cognitive 94) src/renderers/webgl/WebGLPrograms.js:54 — WebGLPrograms.getParameters has cognitive complexity 94 (threshold 15). Drivers by points: boolean chains 75, if/else 9 (11 pts), ternaries 8 (nesting depth added 2). 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 · $prettyPrint · ×1
  • $prettyPrint::doWork (cognitive 92) REDACTED:1532 — $prettyPrint::doWork has cognitive complexity 92 (threshold 15). Drivers by points: if/else 15 (48 pts), ternaries 6 (25 pts), boolean chains 13, loops 3 (6 pts) (nesting depth added 55). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · updateTexture (cognitive 92) · ×1
  • updateTexture (cognitive 92) src/renderers/common/Textures.js:280 — updateTexture has cognitive complexity 92 (threshold 15). Drivers by points: if/else 30 (66 pts), boolean chains 15, loops 2 (9 pts), ternaries 2 (nesting depth added 43). Of this number, 81 points are the body's own statements and 11 belong to 2 function items inside it that branch. 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 · WebGLPrograms.WebGLPrograms.getParameters (cognitive 91) · ×1
  • WebGLPrograms.WebGLPrograms.getParameters (cognitive 91) src/renderers/webgl/WebGLPrograms.js:54 — WebGLPrograms.WebGLPrograms.getParameters has cognitive complexity 91 (threshold 15). Drivers by points: boolean chains 70, if/else 9 (11 pts), ternaries 8 (10 pts) (nesting depth added 4). 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 · finishRender (cognitive 87) · ×1
  • finishRender (cognitive 87) src/renderers/webgpu/WebGPUBackend.js:1431 — finishRender has cognitive complexity 87 (threshold 15). Drivers by points: if/else 16 (41 pts), ternaries 6 (30 pts), loops 5 (14 pts), boolean chains 2 (nesting depth added 58). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parseTypeInner (cognitive 83) · ×1
  • parseTypeInner (cognitive 83) editor/js/libs/ternjs/def.js:166 — parseTypeInner has cognitive complexity 83 (threshold 15). Drivers by points: if/else 29 (59 pts), boolean chains 16, loops 2 (5 pts), ternaries 1 (3 pts) (nesting depth added 35). Of this number, 82 points are the body's own statements and 1 belongs to 4 function literals inside it that branch. 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 · WebGPUBindingUtils._createLayoutEntries (cognitive 82) · ×1
  • WebGPUBindingUtils._createLayoutEntries (cognitive 82) src/renderers/webgpu/utils/WebGPUBindingUtils.js:420 — WebGPUBindingUtils._createLayoutEntries has cognitive complexity 82 (threshold 15). Drivers by points: if/else 34 (72 pts), boolean chains 9, loops 1 (nesting depth added 38). 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 · drawSelectionRange (cognitive 81) · ×1
  • drawSelectionRange (cognitive 81) editor/js/libs/codemirror/codemirror.js:3204 — drawSelectionRange has cognitive complexity 81 (threshold 15). Drivers by points: ternaries 23 (47 pts), if/else 16 (22 pts), boolean chains 12 (nesting depth added 30). Most of this is not in the body itself: 14 of the 81 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 3234, drawForLine::wrapX, add, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · Sidebar.Scene.SidebarScene (cognitive 80) · ×1
  • Sidebar.Scene.SidebarScene (cognitive 80) editor/js/Sidebar.Scene.js:6 — Sidebar.Scene.SidebarScene has cognitive complexity 80 (threshold 15). Drivers by points: if/else 39 (51 pts), ternaries 13 (16 pts), loops 5 (7 pts), boolean chains 5, match/switch 1 (nesting depth added 17). None of this is in the body itself: all 80 points belong to 17 function items inside it that branch (refreshUI, a function literal at line 596, refreshBackgroundUI, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · toJSON (cognitive 80) · ×1
  • toJSON (cognitive 80) src/core/Object3D.js:1302 — toJSON has cognitive complexity 80 (threshold 15). Drivers by points: if/else 37 (58 pts), loops 5 (12 pts), boolean chains 6, ternaries 2 (4 pts) (nesting depth added 30). Of this number, 74 points are the body's own statements and 6 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WebGLTextureUtils.updateTexture (cognitive 79) · ×1
  • WebGLTextureUtils.updateTexture (cognitive 79) src/renderers/webgl-fallback/utils/WebGLTextureUtils.js:530 — WebGLTextureUtils.updateTexture has cognitive complexity 79 (threshold 15). Drivers by points: if/else 30 (51 pts), loops 8 (24 pts), boolean chains 4 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WebGLBackend._resolveRenderTarget (cognitive 77) · ×1
  • WebGLBackend._resolveRenderTarget (cognitive 77) src/renderers/webgl-fallback/WebGLBackend.js:2786 — WebGLBackend._resolveRenderTarget has cognitive complexity 77 (threshold 15). Drivers by points: if/else 15 (45 pts), loops 4 (16 pts), boolean chains 8, ternaries 2 (8 pts) (nesting depth added 48). 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 · WebGLRenderer.constructor · ×1
  • WebGLRenderer.constructor::projectObject (cognitive 77) src/renderers/WebGLRenderer.js:1873 — WebGLRenderer.constructor::projectObject has cognitive complexity 77 (threshold 15). Drivers by points: if/else 21 (61 pts), loops 2 (6 pts), ternaries 2 (6 pts), boolean chains 4 (nesting depth added 48). 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. This shape REPEATS in the file: one other method here (WebGLRenderer.constructor) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · copyTextureToTexture (cognitive 76) · ×1
  • copyTextureToTexture (cognitive 76) src/renderers/webgl-fallback/utils/WebGLTextureUtils.js:857 — copyTextureToTexture has cognitive complexity 76 (threshold 15). Drivers by points: if/else 34 (54 pts), boolean chains 7, ternaries 4 (7 pts), loops 2 (4 pts), other 4 (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 · findCompletions (cognitive 76) · ×1
  • findCompletions (cognitive 76) editor/js/libs/ternjs/tern.js:714 — findCompletions has cognitive complexity 76 (threshold 15). Drivers by points: if/else 28 (41 pts), boolean chains 20, loops 4 (8 pts), ternaries 3 (7 pts) (nesting depth added 21). Of this number, 60 points are the body's own statements and 16 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · draw (cognitive 75) · ×1
  • draw (cognitive 75) src/renderers/webgl-fallback/WebGLBackend.js:1214 — draw has cognitive complexity 75 (threshold 15). Drivers by points: if/else 25 (49 pts), loops 5 (14 pts), boolean chains 10, ternaries 1 (2 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _getRenderPassDescriptor (cognitive 74) · ×1
  • _getRenderPassDescriptor (cognitive 74) src/renderers/webgpu/WebGPUBackend.js:681 — _getRenderPassDescriptor has cognitive complexity 74 (threshold 15). Drivers by points: if/else 15 (31 pts), ternaries 5 (25 pts), loops 4 (10 pts), boolean chains 8 (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 · _updateDrawParameters (cognitive 74) · ×1
  • _updateDrawParameters (cognitive 74) src/objects/BatchedMesh.js:1578 — _updateDrawParameters has cognitive complexity 74 (threshold 15). Drivers by points: if/else 23 (55 pts), ternaries 4 (7 pts), boolean chains 6, loops 3 (6 pts) (nesting depth added 38). 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 · Guide.init (cognitive 73) · ×1
  • Guide.init (cognitive 73) REDACTED:229 — Guide.init has cognitive complexity 73 (threshold 15). Drivers by points: if/else 26 (41 pts), boolean chains 26, ternaries 2 (4 pts), loops 1 (2 pts) (nesting depth added 18). Of this number, 22 points are the body's own statements and 51 belong to 22 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarkdownUtils.parse (cognitive 72) · ×1
  • MarkdownUtils.parse (cognitive 72) tsl/js/utils/MarkdownUtils.js:283 — MarkdownUtils.parse has cognitive complexity 72 (threshold 15). Drivers by points: if/else 19 (32 pts), ternaries 8 (22 pts), loops 13 (14 pts), boolean chains 4 (nesting depth added 28). Of this number, 57 points are the body's own statements and 15 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · packLDrawModel.parseObject (cognitive 72) · ×1
  • packLDrawModel.parseObject (cognitive 72) utils/packLDrawModel.mjs:93 — packLDrawModel.parseObject has cognitive complexity 72 (threshold 15). Drivers by points: if/else 15 (36 pts), loops 6 (15 pts), error handling 4 (14 pts), boolean chains 6, ternaries 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 · generate (cognitive 72) · ×1
  • generate (cognitive 72) src/nodes/math/OperatorNode.js:195 — generate has cognitive complexity 72 (threshold 15). Drivers by points: if/else 38 (61 pts), boolean chains 8, ternaries 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 · StandardDrawingPipeline.project (cognitive 69) · ×1
  • StandardDrawingPipeline.project (cognitive 69) src/renderers/common/StandardDrawingPipeline.js:182 — StandardDrawingPipeline.project has cognitive complexity 69 (threshold 15). Drivers by points: if/else 23 (56 pts), loops 3 (9 pts), boolean chains 4 (nesting depth added 39). 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 · draw (cognitive 68) · ×1
  • draw (cognitive 68) src/renderers/webgpu/WebGPUBackend.js:2286 — draw has cognitive complexity 68 (threshold 15). Drivers by points: if/else 17 (50 pts), boolean chains 9, loops 2 (5 pts), ternaries 2 (4 pts) (nesting depth added 38). 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 · WebXRController.update (cognitive 66) · ×1
  • WebXRController.update (cognitive 66) src/renderers/webxr/WebXRController.js:224 — WebXRController.update has cognitive complexity 66 (threshold 15). Drivers by points: if/else 23 (57 pts), boolean chains 6, loops 1 (3 pts) (nesting depth added 36). 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 · WebGPUBackend.beginRender (cognitive 66) · ×1
  • WebGPUBackend.beginRender (cognitive 66) src/renderers/webgpu/WebGPUBackend.js:893 — WebGPUBackend.beginRender has cognitive complexity 66 (threshold 15). Drivers by points: if/else 34 (52 pts), boolean chains 8, ternaries 1 (4 pts), loops 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 · stretchSpansOverChange (cognitive 64) · ×1
  • stretchSpansOverChange (cognitive 64) editor/js/libs/codemirror/codemirror.js:1372 — stretchSpansOverChange has cognitive complexity 64 (threshold 15). Drivers by points: if/else 18 (41 pts), loops 4 (9 pts), boolean chains 8, ternaries 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 · build (cognitive 64) · ×1
  • build (cognitive 64) src/nodes/core/Node.js:1129 — build has cognitive complexity 64 (threshold 15). Drivers by points: if/else 19 (41 pts), boolean chains 16, ternaries 2 (4 pts), loops 1 (3 pts) (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · clear (cognitive 63) · ×1
  • clear (cognitive 63) src/renderers/webgl-fallback/WebGLBackend.js:877 — clear has cognitive complexity 63 (threshold 15). Drivers by points: if/else 25 (50 pts), ternaries 1 (5 pts), boolean chains 4, loops 1 (4 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 · LoopNode.generate (cognitive 62) · ×1
  • LoopNode.generate (cognitive 62) src/nodes/utils/LoopNode.js:155 — LoopNode.generate has cognitive complexity 62 (threshold 15). Drivers by points: if/else 21 (45 pts), boolean chains 8, match/switch 1 (4 pts), ternaries 1 (3 pts), loops 2 (nesting depth added 29). Of this number, 59 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · generate (cognitive 62) · ×1
  • generate (cognitive 62) src/nodes/accessors/TextureNode.js:658 — generate has cognitive complexity 62 (threshold 15). Drivers by points: ternaries 11 (35 pts), if/else 12 (23 pts), boolean chains 4 (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 · renderApiTableCard (cognitive 61) · ×1
  • renderApiTableCard (cognitive 61) tsl/js/utils/MarkdownUtils.js:1119 — renderApiTableCard has cognitive complexity 61 (threshold 15). Drivers by points: if/else 12 (34 pts), ternaries 6 (20 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 38). Of this number, 50 points are the body's own statements and 11 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createRenderPipeline (cognitive 59) · ×1
  • createRenderPipeline (cognitive 59) src/renderers/webgpu/utils/WebGPUPipelineUtils.js:71 — createRenderPipeline has cognitive complexity 59 (threshold 15). Drivers by points: if/else 19 (34 pts), boolean chains 11, ternaries 2 (6 pts), error handling 2 (5 pts), loops 2 (3 pts) (nesting depth added 23). Of this number, 43 points are the body's own statements and 16 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WebGLRenderer.constructor (cognitive 58) · ×1
  • WebGLRenderer.constructor (cognitive 58) src/renderers/WebGLRenderer.js:71 — WebGLRenderer.constructor has cognitive complexity 58 (threshold 15). Drivers by points: if/else 136 (212 pts), boolean chains 109, loops 8 (18 pts), ternaries 9 (14 pts), error handling 1 (nesting depth added 91). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (WebGLRenderer.constructor::projectObject) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · PropertyBinding.bind (cognitive 57) · ×1
  • PropertyBinding.bind (cognitive 57) REDACTED:487 — PropertyBinding.bind has cognitive complexity 57 (threshold 15). Drivers by points: if/else 24 (51 pts), loops 1 (3 pts), match/switch 1 (2 pts), 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 · buildToken (cognitive 57) · ×1
  • buildToken (cognitive 57) editor/js/libs/codemirror/codemirror.js:1801 — buildToken has cognitive complexity 57 (threshold 15). Drivers by points: if/else 18 (37 pts), ternaries 3 (8 pts), boolean chains 7, loops 2 (5 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 · codemirror.leftButtonSelect (cognitive 56) · ×1
  • codemirror.leftButtonSelect (cognitive 56) editor/js/libs/codemirror/codemirror.js:7477 — codemirror.leftButtonSelect has cognitive complexity 56 (threshold 15). Drivers by points: if/else 32 (45 pts), ternaries 2 (5 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 17). Of this number, 19 points are the body's own statements and 37 belong to 6 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · build-defs.buildDefs (cognitive 55) · ×1
  • build-defs.buildDefs (cognitive 55) editor/js/libs/tern-threejs/build-defs.js:107 — build-defs.buildDefs has cognitive complexity 55 (threshold 15). Drivers by points: if/else 16 (40 pts), boolean chains 9, loops 3 (6 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 · readToken (cognitive 55) · ×1
  • readToken (cognitive 55) editor/js/libs/acorn/acorn-loose.js:201 — readToken has cognitive complexity 55 (threshold 15). Drivers by points: if/else 16 (35 pts), loops 3 (9 pts), error handling 2 (7 pts), boolean chains 4 (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 · Bindings._update (cognitive 54) · ×1
  • Bindings._update (cognitive 54) src/renderers/common/Bindings.js:450 — Bindings._update has cognitive complexity 54 (threshold 15). Drivers by points: if/else 18 (43 pts), boolean chains 5, ternaries 2 (5 pts), 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 · _updateTime (cognitive 54) · ×1
  • _updateTime (cognitive 54) src/animation/AnimationAction.js:724 — _updateTime has cognitive complexity 54 (threshold 15). Drivers by points: if/else 22 (39 pts), ternaries 4 (12 pts), boolean chains 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 · renderSingleApiCard (cognitive 53) · ×1
  • renderSingleApiCard (cognitive 53) tsl/js/utils/MarkdownUtils.js:999 — renderSingleApiCard has cognitive complexity 53 (threshold 15). Drivers by points: if/else 13 (28 pts), ternaries 7 (19 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 28). Of this number, 44 points are the body's own statements and 9 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WebGPUTextureUtils._getBlockData (cognitive 52) · ×1
  • WebGPUTextureUtils._getBlockData (cognitive 52) src/renderers/webgpu/utils/WebGPUTextureUtils.js:1212 — WebGPUTextureUtils._getBlockData has cognitive complexity 52 (threshold 15). Drivers by points: if/else 28, boolean chains 24. 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 · comment.commentsBefore (cognitive 51) · ×1
  • comment.commentsBefore (cognitive 51) editor/js/libs/ternjs/comment.js:22 — comment.commentsBefore has cognitive complexity 51 (threshold 15). Drivers by points: if/else 13 (36 pts), boolean chains 8, loops 3 (7 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 · WebGLLights.WebGLLights.setup (cognitive 51) · ×1
  • WebGLLights.WebGLLights.setup (cognitive 51) src/renderers/webgl/WebGLLights.js:221 — WebGLLights.WebGLLights.setup has cognitive complexity 51 (threshold 15). Drivers by points: if/else 21 (39 pts), loops 4 (9 pts), boolean chains 3 (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 · WebGLLights.setup (cognitive 51) · ×1
  • WebGLLights.setup (cognitive 51) src/renderers/webgl/WebGLLights.js:221 — WebGLLights.setup has cognitive complexity 51 (threshold 15). Drivers by points: if/else 21 (39 pts), loops 4 (9 pts), boolean chains 3 (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 · Script.Script (cognitive 50) · ×1
  • Script.Script (cognitive 50) editor/js/Script.js:8 — Script.Script has cognitive complexity 50 (threshold 15). Drivers by points: if/else 19 (26 pts), loops 6 (10 pts), error handling 3 (5 pts), match/switch 3 (5 pts), boolean chains 3, ternaries 1 (nesting depth added 15). None of this is in the body itself: all 50 points belong to 12 function items inside it that branch (a function literal at line 151, a function literal at line 425, setTitle, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · WebGLPrograms.WebGLPrograms.getProgramCacheKeyBooleans (cognitive 50) · ×1
  • WebGLPrograms.WebGLPrograms.getProgramCacheKeyBooleans (cognitive 50) src/renderers/webgl/WebGLPrograms.js:509 — WebGLPrograms.WebGLPrograms.getProgramCacheKeyBooleans has cognitive complexity 50 (threshold 15). Drivers by points: if/else 50. 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 · _draw (cognitive 50) · ×1
  • _draw (cognitive 50) src/renderers/webgpu/WebGPUBackend.js:2087 — _draw has cognitive complexity 50 (threshold 15). Drivers by points: if/else 18 (27 pts), loops 5 (10 pts), ternaries 3 (9 pts), boolean chains 4 (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 · WebGLPrograms.getProgramCacheKeyBooleans (cognitive 50) · ×1
  • WebGLPrograms.getProgramCacheKeyBooleans (cognitive 50) src/renderers/webgl/WebGLPrograms.js:509 — WebGLPrograms.getProgramCacheKeyBooleans has cognitive complexity 50 (threshold 15). Drivers by points: if/else 50. 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 · codemirror.findPosH (cognitive 49) · ×1
  • codemirror.findPosH (cognitive 49) editor/js/libs/codemirror/codemirror.js:8710 — codemirror.findPosH has cognitive complexity 49 (threshold 15). Drivers by points: if/else 20 (35 pts), ternaries 5 (16 pts), boolean chains 15, loops 1 (2 pts) (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · BufferGeometryLoader.parse (cognitive 49) · ×1
  • BufferGeometryLoader.parse (cognitive 49) src/loaders/BufferGeometryLoader.js:90 — BufferGeometryLoader.parse has cognitive complexity 49 (threshold 15). Drivers by points: if/else 20 (36 pts), loops 4 (8 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 22). Of this number, 46 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WebGPUTextureUtils.updateTexture (cognitive 49) · ×1
  • WebGPUTextureUtils.updateTexture (cognitive 49) src/renderers/webgpu/utils/WebGPUTextureUtils.js:643 — WebGPUTextureUtils.updateTexture has cognitive complexity 49 (threshold 15). Drivers by points: if/else 21 (29 pts), loops 5 (15 pts), boolean chains 5 (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 · measureCharInner (cognitive 49) · ×1
  • measureCharInner (cognitive 49) editor/js/libs/codemirror/codemirror.js:2489 — measureCharInner has cognitive complexity 49 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 10, loops 4 (9 pts), ternaries 4 (6 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 · parsePropertyValue (cognitive 49) · ×1
  • parsePropertyValue (cognitive 49) editor/js/libs/acorn/acorn.js:2521 — parsePropertyValue has cognitive complexity 49 (threshold 15). Drivers by points: if/else 19 (31 pts), boolean chains 14, ternaries 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 · setSession (cognitive 49) · ×1
  • setSession (cognitive 49) src/renderers/common/XRManager.js:1192 — setSession has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 8 (29 pts), if/else 8 (15 pts), loops 1 (4 pts), boolean chains 1 (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · onAnimationFrame (cognitive 49) · ×1
  • onAnimationFrame (cognitive 49) src/renderers/common/XRManager.js:1772 — onAnimationFrame has cognitive complexity 49 (threshold 15). Drivers by points: if/else 16 (32 pts), ternaries 3 (10 pts), boolean chains 4, loops 2 (3 pts) (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 · ShapePath.toShapes (cognitive 48) · ×1
  • ShapePath.toShapes (cognitive 48) src/extras/core/ShapePath.js:146 — ShapePath.toShapes has cognitive complexity 48 (threshold 15). Drivers by points: if/else 14 (27 pts), loops 9 (11 pts), boolean chains 7, ternaries 2 (3 pts) (nesting depth added 16). Of this number, 39 points are the body's own statements and 9 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LayoutManager.setupResizer (cognitive 48) · ×1
  • LayoutManager.setupResizer (cognitive 48) tsl/js/managers/LayoutManager.js:116 — LayoutManager.setupResizer has cognitive complexity 48 (threshold 15). Drivers by points: if/else 26 (32 pts), boolean chains 12, ternaries 2 (4 pts) (nesting depth added 8). Of this number, 18 points are the body's own statements and 30 belong to 6 function literals inside it that branch. 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 · parseForStatement (cognitive 48) · ×1
  • parseForStatement (cognitive 48) editor/js/libs/acorn/acorn.js:936 — parseForStatement has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (34 pts), boolean chains 11, ternaries 2 (3 pts) (nesting depth added 19). 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 · codemirror.markText (cognitive 47) · ×1
  • codemirror.markText (cognitive 47) editor/js/libs/codemirror/codemirror.js:5970 — codemirror.markText has cognitive complexity 47 (threshold 15). Drivers by points: if/else 23 (31 pts), boolean chains 11, loops 1 (3 pts), ternaries 2 (nesting depth added 10). Of this number, 38 points are the body's own statements and 9 belong to 2 function literals inside it that branch. 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 · WebGPUAttributeUtils.createAttribute (cognitive 47) · ×1
  • WebGPUAttributeUtils.createAttribute (cognitive 47) src/renderers/webgpu/utils/WebGPUAttributeUtils.js:131 — WebGPUAttributeUtils.createAttribute has cognitive complexity 47 (threshold 15). Drivers by points: if/else 11 (29 pts), boolean chains 9, loops 1 (5 pts), ternaries 1 (4 pts) (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · moveVisually (cognitive 47) · ×1
  • moveVisually (cognitive 47) editor/js/libs/codemirror/codemirror.js:6914 — moveVisually has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 11 (20 pts), if/else 12 (16 pts), boolean chains 10, loops 1 (nesting depth added 13). Of this number, 31 points are the body's own statements and 16 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Mesh._computeIntersections (cognitive 46) · ×1
  • Mesh._computeIntersections (cognitive 46) src/objects/Mesh.js:294 — Mesh._computeIntersections has cognitive complexity 46 (threshold 15). Drivers by points: if/else 10 (26 pts), loops 6 (20 pts) (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 · GLSLNodeBuilder.getVaryings (cognitive 46) · ×1
  • GLSLNodeBuilder.getVaryings (cognitive 46) src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js:1255 — GLSLNodeBuilder.getVaryings has cognitive complexity 46 (threshold 15). Drivers by points: if/else 10 (22 pts), ternaries 3 (11 pts), boolean chains 8, loops 3 (5 pts) (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 · WebGPUTextureUtils._getTypedArrayType (cognitive 46) · ×1
  • WebGPUTextureUtils._getTypedArrayType (cognitive 46) src/renderers/webgpu/utils/WebGPUTextureUtils.js:1392 — WebGPUTextureUtils._getTypedArrayType has cognitive complexity 46 (threshold 15). Drivers by points: if/else 44, boolean chains 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 · processCommit (cognitive 46) · ×1
  • processCommit (cognitive 46) utils/changelog.js:451 — processCommit has cognitive complexity 46 (threshold 15). Drivers by points: if/else 20 (32 pts), boolean chains 10, ternaries 1 (4 pts) (nesting depth added 15). Of this number, 45 points are the body's own statements and 1 belongs to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · def.passTwo (cognitive 45) · ×1
  • def.passTwo (cognitive 45) editor/js/libs/ternjs/def.js:456 — def.passTwo has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (33 pts), ternaries 2 (6 pts), boolean chains 3, 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 · parseExprAtom (cognitive 45) · ×1
  • parseExprAtom (cognitive 45) editor/js/libs/acorn/acorn.js:2167 — parseExprAtom has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (32 pts), boolean chains 10, ternaries 1 (2 pts), match/switch 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 · setupShadow (cognitive 45) · ×1
  • setupShadow (cognitive 45) src/nodes/lighting/ShadowNode.js:365 — setupShadow has cognitive complexity 45 (threshold 15). Drivers by points: if/else 24 (35 pts), boolean chains 9, ternaries 1 (nesting depth added 11). Of this number, 39 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · codemirror.onScrollWheel (cognitive 44) · ×1
  • codemirror.onScrollWheel (cognitive 44) editor/js/libs/codemirror/codemirror.js:4511 — codemirror.onScrollWheel has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 13, loops 2 (5 pts) (nesting depth added 14). Of this number, 35 points are the body's own statements and 9 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileLoader.load (cognitive 44) · ×1
  • FileLoader.load (cognitive 44) src/loaders/FileLoader.js:78 — FileLoader.load has cognitive complexity 44 (threshold 15). Drivers by points: if/else 17 (27 pts), ternaries 4 (7 pts), loops 3 (5 pts), boolean chains 4, match/switch 1 (nesting depth added 15). Most of this is not in the body itself: 6 of the 44 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 144, 227, 183, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · publish.publish (cognitive 44) · ×1
  • publish.publish (cognitive 44) utils/docs/template/publish.js:655 — publish.publish has cognitive complexity 44 (threshold 15). Drivers by points: if/else 25 (34 pts), boolean chains 7, loops 1 (2 pts), ternaries 1 (nesting depth added 10). Of this number, 16 points are the body's own statements and 28 belong to 7 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parseClass (cognitive 44) · ×1
  • parseClass (cognitive 44) editor/js/libs/acorn/acorn-loose.js:554 — parseClass has cognitive complexity 44 (threshold 15). Drivers by points: if/else 18 (29 pts), boolean chains 12, ternaries 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 · SearchManager.scrollToSearchMatch (cognitive 43) · ×1
  • SearchManager.scrollToSearchMatch (cognitive 43) REDACTED:345 — SearchManager.scrollToSearchMatch has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 5 (12 pts), boolean chains 7 (nesting depth added 20). Of this number, 41 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · renderObject (cognitive 43) · ×1
  • renderObject (cognitive 43) src/renderers/common/Renderer.js:3921 — renderObject has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (21 pts), ternaries 5 (14 pts), boolean chains 8 (nesting depth added 19). 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 · setup (cognitive 43) · ×1
  • setup (cognitive 43) src/materials/nodes/NodeMaterial.js:482 — setup has cognitive complexity 43 (threshold 15). Drivers by points: if/else 17 (38 pts), boolean chains 5 (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 · updateRenderTarget (cognitive 43) · ×1
  • updateRenderTarget (cognitive 43) src/renderers/common/Textures.js:131 — updateRenderTarget has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (16 pts), ternaries 7 (13 pts), boolean chains 12, 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 · Sidebar.Material.MapProperty.SidebarMaterialMapProperty (cognitive 42) · ×1
  • Sidebar.Material.MapProperty.SidebarMaterialMapProperty (cognitive 42) editor/js/Sidebar.Material.MapProperty.js:11 — Sidebar.Material.MapProperty.SidebarMaterialMapProperty has cognitive complexity 42 (threshold 15). Drivers by points: if/else 25 (36 pts), boolean chains 4, error handling 1, ternaries 1 (nesting depth added 11). Most of this is not in the body itself: 6 of the 42 points are its own statements and the rest belongs to 9 function items inside it that branch (update, onChange, onMapChange, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · WebGLMorphtargets.WebGLMorphtargets.update (cognitive 41) · ×1
  • WebGLMorphtargets.WebGLMorphtargets.update (cognitive 41) src/renderers/webgl/WebGLMorphtargets.js:11 — WebGLMorphtargets.WebGLMorphtargets.update has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 3 (7 pts), boolean chains 6, ternaries 2 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Sidebar.Project.Resources.SidebarProjectResources (cognitive 40) · ×1
  • Sidebar.Project.Resources.SidebarProjectResources (cognitive 40) editor/js/Sidebar.Project.Resources.js:6 — Sidebar.Project.Resources.SidebarProjectResources has cognitive complexity 40 (threshold 15). Drivers by points: if/else 22 (31 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 12). None of this is in the body itself: all 40 points belong to 5 function items inside it that branch (getTextureType, refreshTexturesUI, a function literal at line 207, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · make-geo-picking-texture.main (cognitive 40) · ×1
  • make-geo-picking-texture.main (cognitive 40) manual/resources/tools/geo-picking/make-geo-picking-texture.js:7 — make-geo-picking-texture.main has cognitive complexity 40 (threshold 15). Drivers by points: loops 12 (19 pts), if/else 7 (15 pts), boolean chains 6 (nesting depth added 15). Of this number, 23 points are the body's own statements and 17 belong to 3 function items inside it that branch. 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 · MeshPhysicalNodeMaterial.setupVariants (cognitive 40) · ×1
  • MeshPhysicalNodeMaterial.setupVariants (cognitive 40) src/materials/nodes/MeshPhysicalNodeMaterial.js:427 — MeshPhysicalNodeMaterial.setupVariants has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 15 (31 pts), if/else 8 (9 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 · WebGPUBindingUtils.createBindGroup (cognitive 40) · ×1
  • WebGPUBindingUtils.createBindGroup (cognitive 40) src/renderers/webgpu/utils/WebGPUBindingUtils.js:302 — WebGPUBindingUtils.createBindGroup has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (25 pts), ternaries 3 (13 pts), boolean chains 1, loops 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 · (anonymous) (cognitive 40) · ×1
  • (anonymous) (cognitive 40) editor/js/libs/codemirror/codemirror.js:14 — (anonymous) has cognitive complexity 40 (threshold 15). Drivers by points: boolean chains 20, if/else 11 (12 pts), loops 4, ternaries 4 (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 · parseObj (cognitive 40) · ×1
  • parseObj (cognitive 40) editor/js/libs/acorn/acorn-loose.js:1129 — parseObj has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (30 pts), boolean chains 9, 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 · serializeArg (cognitive 40) · ×1
  • serializeArg (cognitive 40) REDACTED:288 — serializeArg has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (27 pts), ternaries 4 (7 pts), boolean chains 6 (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 · updateTokenizerForCode (cognitive 40) · ×1
  • updateTokenizerForCode (cognitive 40) tsl/js/editor/CodeEditor.js:24 — updateTokenizerForCode has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (32 pts), boolean chains 4, loops 2 (3 pts), error handling 1 (nesting depth added 22). Of this number, 22 points are the body's own statements and 18 belong to 6 function literals inside it that branch. 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 · acorn.pp$1.parseStatement (cognitive 39) · ×1
  • acorn.pp$1.parseStatement (cognitive 39) editor/js/libs/acorn/acorn.js:808 — acorn.pp$1.parseStatement has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (28 pts), boolean chains 8, ternaries 1 (2 pts), match/switch 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 · Renderer.compileAsync (cognitive 39) · ×1
  • Renderer.compileAsync (cognitive 39) src/renderers/common/Renderer.js:1019 — Renderer.compileAsync has cognitive complexity 39 (threshold 15). Drivers by points: if/else 21 (25 pts), boolean chains 6, loops 2 (4 pts), ternaries 3 (4 pts) (nesting depth added 7). Of this number, 35 points are the body's own statements and 4 belong to 2 function items inside it that branch. 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 · WebGLEnvironments.WebGLEnvironments.getPMREM (cognitive 39) · ×1
  • WebGLEnvironments.WebGLEnvironments.getPMREM (cognitive 39) src/renderers/webgl/WebGLEnvironments.js:71 — WebGLEnvironments.WebGLEnvironments.getPMREM has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (28 pts), boolean chains 8, ternaries 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 · getUniformFromNode (cognitive 39) · ×1
  • getUniformFromNode (cognitive 39) src/renderers/webgpu/nodes/WGSLNodeBuilder.js:1387 — getUniformFromNode has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (28 pts), ternaries 2 (6 pts), boolean chains 5 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · createTexture (cognitive 39) · ×1
  • createTexture (cognitive 39) src/renderers/webgpu/utils/WebGPUTextureUtils.js:302 — createTexture has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (22 pts), boolean chains 13, loops 1 (3 pts), error handling 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 · call (cognitive 39) · ×1
  • call (cognitive 39) src/nodes/tsl/TSLCore.js:497 — call has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (21 pts), ternaries 4 (7 pts), loops 2 (6 pts), boolean chains 5 (nesting depth added 17). Of this number, 35 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · getMaterialCacheKey (cognitive 39) · ×1
  • getMaterialCacheKey (cognitive 39) src/renderers/common/RenderObject.js:808 — getMaterialCacheKey has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (31 pts), ternaries 2 (7 pts), 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 · findHoleBridge (cognitive 39) · ×1
  • findHoleBridge (cognitive 39) src/extras/lib/earcut.js:314 — findHoleBridge has cognitive complexity 39 (threshold 15). Drivers by points: if/else 8 (17 pts), ternaries 3 (10 pts), boolean chains 8, loops 4 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MenubarFile (cognitive 39) · ×1
  • MenubarFile (cognitive 39) editor/js/Menubar.File.js:4 — MenubarFile has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (24 pts), loops 8 (11 pts), boolean chains 3, error handling 1 (nesting depth added 9). Most of this is not in the body itself: 1 of the 39 points is its own statement and the rest belongs to 34 function items inside it that branch (a function literal at line 513, a function literal at line 541, a function literal at line 275, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · Sidebar.Settings.Shortcuts.SidebarSettingsShortcuts (cognitive 38) · ×1
  • Sidebar.Settings.Shortcuts.SidebarSettingsShortcuts (cognitive 38) editor/js/Sidebar.Settings.Shortcuts.js:6 — Sidebar.Settings.Shortcuts.SidebarSettingsShortcuts has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (30 pts), loops 3 (5 pts), boolean chains 2, match/switch 1 (nesting depth added 15). Most of this is not in the body itself: 1 of the 38 points is its own statement and the rest belongs to 5 function items inside it that branch (a function literal at line 99, a function literal at line 37, a function literal at line 58, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · PolyhedronGeometry.constructor (cognitive 38) · ×1
  • PolyhedronGeometry.constructor (cognitive 38) src/geometries/PolyhedronGeometry.js:23 — PolyhedronGeometry.constructor has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 9 (11 pts), boolean chains 4 (nesting depth added 13). Most of this is not in the body itself: 2 of the 38 points are its own statements and the rest belongs to 7 function items inside it that branch (subdivideFace, correctSeam, correctUV, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · nodeAndOffsetInLineMap (cognitive 38) · ×1
  • nodeAndOffsetInLineMap (cognitive 38) editor/js/libs/codemirror/codemirror.js:2441 — nodeAndOffsetInLineMap has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 3 (9 pts), boolean chains 7, ternaries 1 (4 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Sidebar.Material.SidebarMaterial · ×1
  • Sidebar.Material.SidebarMaterial::update (cognitive 37) editor/js/Sidebar.Material.js:454 — Sidebar.Material.SidebarMaterial::update has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (29 pts), loops 1 (4 pts), boolean chains 2, error handling 1 (2 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 · prettify.createSimpleLexer.decorate (cognitive 37) · ×1
  • prettify.createSimpleLexer.decorate (cognitive 37) REDACTED:701 — prettify.createSimpleLexer.decorate has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (28 pts), loops 2 (5 pts), boolean chains 4 (nesting depth added 20). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · WireframeGeometry.constructor (cognitive 37) · ×1
  • WireframeGeometry.constructor (cognitive 37) src/geometries/WireframeGeometry.js:32 — WireframeGeometry.constructor has cognitive complexity 37 (threshold 15). Drivers by points: loops 5 (19 pts), if/else 6 (18 pts) (nesting depth added 26). 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 · MathNode.generate (cognitive 37) · ×1
  • MathNode.generate (cognitive 37) src/nodes/math/MathNode.js:226 — MathNode.generate has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (22 pts), ternaries 3 (9 pts), boolean chains 6 (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 · Renderer._getShadowNodes (cognitive 37) · ×1
  • Renderer._getShadowNodes (cognitive 37) src/renderers/common/Renderer.js:3692 — Renderer._getShadowNodes has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 12 (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 · applyTextInput (cognitive 37) · ×1
  • applyTextInput (cognitive 37) editor/js/libs/codemirror/codemirror.js:8148 — applyTextInput has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 9, ternaries 3 (6 pts), loops 2 (5 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · acorn.pp$2.toAssignable (cognitive 36) · ×1
  • acorn.pp$2.toAssignable (cognitive 36) editor/js/libs/acorn/acorn.js:1622 — acorn.pp$2.toAssignable has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (27 pts), boolean chains 4, loops 1 (3 pts), match/switch 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Interpolant.evaluate (cognitive 36) · ×1
  • Interpolant.evaluate (cognitive 36) src/math/Interpolant.js:92 — Interpolant.evaluate has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (31 pts), loops 3 (5 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 · CodeRunner.processExportDeclarations (cognitive 36) · ×1
  • CodeRunner.processExportDeclarations (cognitive 36) REDACTED:165 — CodeRunner.processExportDeclarations has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (24 pts), ternaries 2 (6 pts), boolean chains 5, error handling 1 (nesting depth added 13). Most of this is not in the body itself: 1 of the 36 points is its own statement and the rest belongs to 4 function items inside it that branch (a function literal at line 205, extractPattern, a function literal at line 236, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · registerEventHandlers (cognitive 36) · ×1
  • registerEventHandlers (cognitive 36) editor/js/libs/codemirror/codemirror.js:7962 — registerEventHandlers has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (23 pts), boolean chains 11, ternaries 1 (2 pts) (nesting depth added 5). Most of this is not in the body itself: 3 of the 36 points are its own statements and the rest belongs to 22 function items inside it that branch (a function literal at line 8020, a function literal at line 8004, a function literal at line 7967, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · _updateCamera (cognitive 36) · ×1
  • _updateCamera (cognitive 36) src/renderers/common/Renderer.js:3801 — _updateCamera has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 3 (12 pts), boolean chains 4 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · canonicalType (cognitive 36) · ×1
  • canonicalType (cognitive 36) editor/js/libs/ternjs/infer.js:276 — canonicalType has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (23 pts), ternaries 2 (6 pts), loops 3 (5 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 · createSimpleLexer · ×1
  • createSimpleLexer::decorate (cognitive 36) REDACTED:701 — createSimpleLexer::decorate has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (28 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 20). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · Renderer._renderScene (cognitive 35) · ×1
  • Renderer._renderScene (cognitive 35) src/renderers/common/Renderer.js:1989 — Renderer._renderScene has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19 (22 pts), boolean chains 9, ternaries 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, 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 · WGSLNodeBuilder.buildCode (cognitive 35) · ×1
  • WGSLNodeBuilder.buildCode (cognitive 35) src/renderers/webgpu/nodes/WGSLNodeBuilder.js:2447 — WGSLNodeBuilder.buildCode has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (29 pts), loops 2 (3 pts), boolean chains 2, ternaries 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 · WebGLMaterials.WebGLMaterials.refreshUniformsPhysical (cognitive 35) · ×1
  • WebGLMaterials.WebGLMaterials.refreshUniformsPhysical (cognitive 35) src/renderers/webgl/WebGLMaterials.js:413 — WebGLMaterials.WebGLMaterials.refreshUniformsPhysical has cognitive complexity 35 (threshold 15). Drivers by points: if/else 22 (35 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 · PlaygroundManager.getImportedCustomScripts (cognitive 35) · ×1
  • PlaygroundManager.getImportedCustomScripts (cognitive 35) tsl/js/managers/PlaygroundManager.js:1104 — PlaygroundManager.getImportedCustomScripts has cognitive complexity 35 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 3 (8 pts), ternaries 2 (7 pts), boolean chains 3 (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 · makeChangeFromHistory (cognitive 35) · ×1
  • makeChangeFromHistory (cognitive 35) editor/js/libs/codemirror/codemirror.js:5343 — makeChangeFromHistory has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 10, ternaries 4 (6 pts), loops 3 (nesting depth added 7). Of this number, 28 points are the body's own statements and 7 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · onDrop (cognitive 35) · ×1
  • onDrop (cognitive 35) editor/js/libs/codemirror/codemirror.js:6534 — onDrop has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 6, loops 2 (6 pts), error handling 1 (2 pts) (nesting depth added 14). Of this number, 28 points are the body's own statements and 7 belong to 7 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · inferClass (cognitive 35) · ×1
  • inferClass (cognitive 35) editor/js/libs/ternjs/infer.js:1301 — inferClass has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 7, ternaries 2 (4 pts), loops 2 (nesting depth added 11). Most of this is not in the body itself: 15 of the 35 points are its own statements and the rest belongs to one function literal inside it that branches (line 1322). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · resolveFile (cognitive 35) · ×1
  • resolveFile (cognitive 35) editor/js/libs/ternjs/tern.js:436 — resolveFile has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 8, loops 2 (5 pts), ternaries 3 (nesting depth added 10). Most of this is not in the body itself: 6 of the 35 points are its own statements and the rest belongs to one function literal inside it that branches (line 453). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · setBlending (cognitive 35) · ×1
  • setBlending (cognitive 35) src/renderers/webgl-fallback/utils/WebGLState.js:468 — setBlending has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 10, match/switch 2 (8 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 · WebGLMaterials.refreshUniformsPhysical (cognitive 35) · ×1
  • WebGLMaterials.refreshUniformsPhysical (cognitive 35) src/renderers/webgl/WebGLMaterials.js:413 — WebGLMaterials.refreshUniformsPhysical has cognitive complexity 35 (threshold 15). Drivers by points: if/else 22 (35 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 · acorn.pp$1.parseClassElement (cognitive 34) · ×1
  • acorn.pp$1.parseClassElement (cognitive 34) editor/js/libs/acorn/acorn.js:1329 — acorn.pp$1.parseClassElement has cognitive complexity 34 (threshold 15). Drivers by points: if/else 18 (22 pts), boolean chains 12 (nesting depth added 4). Of this number, 28 points are the body's own statements and 6 belong to one function item inside it that branches. 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 · codemirror.regChange (cognitive 34) · ×1
  • codemirror.regChange (cognitive 34) editor/js/libs/codemirror/codemirror.js:3004 — codemirror.regChange has cognitive complexity 34 (threshold 15). Drivers by points: if/else 22 (28 pts), boolean chains 6 (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 · codemirror.indentLine (cognitive 34) · ×1
  • codemirror.indentLine (cognitive 34) editor/js/libs/codemirror/codemirror.js:8080 — codemirror.indentLine has cognitive complexity 34 (threshold 15). Drivers by points: if/else 20 (27 pts), loops 2 (4 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 · codemirror.addEditorMethods (cognitive 34) · ×1
  • codemirror.addEditorMethods (cognitive 34) editor/js/libs/codemirror/codemirror.js:8270 — codemirror.addEditorMethods has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 34. 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 · ConditionalNode.generate (cognitive 34) · ×1
  • ConditionalNode.generate (cognitive 34) src/nodes/math/ConditionalNode.js:140 — ConditionalNode.generate has cognitive complexity 34 (threshold 15). Drivers by points: if/else 17 (29 pts), boolean chains 3, ternaries 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 · Morph.getEntry (cognitive 34) · ×1
  • Morph.getEntry (cognitive 34) src/nodes/accessors/Morph.js:89 — Morph.getEntry has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (23 pts), boolean chains 5, loops 2 (5 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 · SearchManager.calculateScore (cognitive 34) · ×1
  • SearchManager.calculateScore (cognitive 34) REDACTED:76 — SearchManager.calculateScore has cognitive complexity 34 (threshold 15). Drivers by points: if/else 18 (25 pts), boolean chains 7, loops 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 · ConsoleManager._initConsoleOverrides (cognitive 34) · ×1
  • ConsoleManager._initConsoleOverrides (cognitive 34) tsl/js/managers/ConsoleManager.js:16 — ConsoleManager._initConsoleOverrides has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 19, if/else 11 (12 pts), error handling 1 (2 pts), ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 10 of the 34 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 21, 56, 41, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · buildLineContent (cognitive 34) · ×1
  • buildLineContent (cognitive 34) editor/js/libs/codemirror/codemirror.js:1734 — buildLineContent has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 9, ternaries 3 (5 pts), 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 · coordsCharInner (cognitive 34) · ×1
  • coordsCharInner (cognitive 34) editor/js/libs/codemirror/codemirror.js:2755 — coordsCharInner has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 12 (24 pts), if/else 6 (7 pts), boolean chains 3 (nesting depth added 13). Of this number, 31 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · endOfLine (cognitive 34) · ×1
  • endOfLine (cognitive 34) editor/js/libs/codemirror/codemirror.js:6886 — endOfLine has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 7 (20 pts), if/else 6 (13 pts), boolean chains 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 · _resolveLayoutDefaults (cognitive 34) · ×1
  • _resolveLayoutDefaults (cognitive 34) src/nodes/core/NodeBuilder.js:2913 — _resolveLayoutDefaults has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (23 pts), loops 5 (8 pts), boolean chains 2, ternaries 1 (nesting depth added 11). Of this number, 19 points are the body's own statements and 15 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · (anonymous) (cognitive 34) · ×1
  • (anonymous) (cognitive 34) editor/js/libs/ternjs/infer.js:1487 — (anonymous) has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (21 pts), ternaries 2 (8 pts), boolean chains 5 (nesting depth added 15). Of this number, 24 points are the body's own statements and 10 belong to one function literal inside it that branches. 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 · _getChildren (cognitive 34) · ×1
  • _getChildren (cognitive 34) src/nodes/core/Node.js:634 — _getChildren has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 7, loops 3 (7 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · highlight.getLightShape (cognitive 33) · ×1
  • highlight.getLightShape (cognitive 33) devtools/highlight.js:134 — highlight.getLightShape has cognitive complexity 33 (threshold 15). Drivers by points: loops 6 (16 pts), if/else 10 (11 pts), boolean chains 4, ternaries 1 (2 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 · KeyframeTrack.optimize (cognitive 33) · ×1
  • KeyframeTrack.optimize (cognitive 33) src/animation/KeyframeTrack.js:492 — KeyframeTrack.optimize has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 4 (11 pts), boolean chains 3 (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 · GLSLNodeBuilder.buildCode (cognitive 33) · ×1
  • GLSLNodeBuilder.buildCode (cognitive 33) src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js:1793 — GLSLNodeBuilder.buildCode has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (27 pts), loops 2 (3 pts), boolean chains 2, 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 · WGSLNodeBuilder.getUniforms (cognitive 33) · ×1
  • WGSLNodeBuilder.getUniforms (cognitive 33) src/renderers/webgpu/nodes/WGSLNodeBuilder.js:2216 — WGSLNodeBuilder.getUniforms has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 3 (7 pts), ternaries 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 · WebGLState.WebGLState.setBlending (cognitive 33) · ×1
  • WebGLState.WebGLState.setBlending (cognitive 33) src/renderers/webgl/WebGLState.js:606 — WebGLState.WebGLState.setBlending has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 8, match/switch 2 (8 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 · pollContent (cognitive 33) · ×1
  • pollContent (cognitive 33) editor/js/libs/codemirror/codemirror.js:9060 — pollContent has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 10, loops 4 (5 pts), ternaries 3 (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 · parseParenAndDistinguishExpression (cognitive 33) · ×1
  • parseParenAndDistinguishExpression (cognitive 33) editor/js/libs/acorn/acorn.js:2299 — parseParenAndDistinguishExpression has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 6, ternaries 1 (3 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 · similarType (cognitive 33) · ×1
  • similarType (cognitive 33) editor/js/libs/ternjs/infer.js:229 — similarType has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 8, loops 2 (4 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 · WebGLState.setBlending (cognitive 33) · ×1
  • WebGLState.setBlending (cognitive 33) src/renderers/webgl/WebGLState.js:606 — WebGLState.setBlending has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 8, match/switch 2 (8 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 · tern.findRefsToVariable (cognitive 32) · ×1
  • tern.findRefsToVariable (cognitive 32) editor/js/libs/ternjs/tern.js:1063 — tern.findRefsToVariable has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 4 (9 pts), boolean chains 2 (nesting depth added 15). Of this number, 23 points are the body's own statements and 9 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BufferGeometry.computeBoundingSphere (cognitive 32) · ×1
  • BufferGeometry.computeBoundingSphere (cognitive 32) src/core/BufferGeometry.js:720 — BufferGeometry.computeBoundingSphere has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 4 (12 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 · AnimationUtils.makeClipAdditive (cognitive 32) · ×1
  • AnimationUtils.makeClipAdditive (cognitive 32) src/animation/AnimationUtils.js:263 — AnimationUtils.makeClipAdditive has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 4 (11 pts), boolean chains 2 (nesting depth added 15). Of this number, 31 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GLSLNodeBuilder.getUniforms (cognitive 32) · ×1
  • GLSLNodeBuilder.getUniforms (cognitive 32) src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js:960 — GLSLNodeBuilder.getUniforms has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 3 (7 pts), ternaries 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 · server.createHandler.<returned closure> (cognitive 32) · ×1
  • server.createHandler.<returned closure> (cognitive 32) REDACTED:47 — server.createHandler.<returned closure> has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (17 pts), ternaries 4 (11 pts), boolean chains 4 (nesting depth added 13). Of this number, 21 points are the body's own statements and 11 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · publish.buildSearchListForData (cognitive 32) · ×1
  • publish.buildSearchListForData (cognitive 32) utils/docs/template/publish.js:145 — publish.buildSearchListForData has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (27 pts), boolean chains 5 (nesting depth added 16). None of this is in the body itself: all 32 points belong to one function literal inside it that branches (line 161). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · updateUI (cognitive 32) · ×1
  • updateUI (cognitive 32) REDACTED:1871 — updateUI has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 10, ternaries 4, loops 1 (2 pts) (nesting depth added 7). Of this number, 21 points are the body's own statements and 11 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · acorn.pp$9.readTmplToken (cognitive 31) · ×1
  • acorn.pp$9.readTmplToken (cognitive 31) editor/js/libs/acorn/acorn.js:4743 — acorn.pp$9.readTmplToken has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 4, match/switch 1 (3 pts), 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 · def.descendProps (cognitive 31) · ×1
  • def.descendProps (cognitive 31) editor/js/libs/ternjs/def.js:385 — def.descendProps has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 12, 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 · tern.analyzeAll (cognitive 31) · ×1
  • tern.analyzeAll (cognitive 31) editor/js/libs/ternjs/tern.js:361 — tern.analyzeAll has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 3 (5 pts), error handling 1 (4 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EdgesGeometry.constructor (cognitive 31) · ×1
  • EdgesGeometry.constructor (cognitive 31) src/geometries/EdgesGeometry.js:35 — EdgesGeometry.constructor has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 3 (7 pts), ternaries 1 (2 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 · ObjectLoader.parseImages (cognitive 31) · ×1
  • ObjectLoader.parseImages (cognitive 31) src/loaders/ObjectLoader.js:456 — ObjectLoader.parseImages has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 2 (6 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 17). Of this number, 24 points are the body's own statements and 7 belong to one function item inside it that branches. 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. This shape REPEATS in the file: one other method here (ObjectLoader.parseImagesAsync) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · ObjectLoader.parseImagesAsync (cognitive 31) · ×1
  • ObjectLoader.parseImagesAsync (cognitive 31) src/loaders/ObjectLoader.js:576 — ObjectLoader.parseImagesAsync has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 2 (6 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 17). Of this number, 24 points are the body's own statements and 7 belong to one function item inside it that branches. 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. This shape REPEATS in the file: one other method here (ObjectLoader.parseImages) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · OperatorNode.generateNodeType (cognitive 31) · ×1
  • OperatorNode.generateNodeType (cognitive 31) src/nodes/math/OperatorNode.js:109 — OperatorNode.generateNodeType has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (19 pts), ternaries 4 (7 pts), boolean chains 5 (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 · CodeRunner.parseScript (cognitive 31) · ×1
  • CodeRunner.parseScript (cognitive 31) REDACTED:23 — CodeRunner.parseScript has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (24 pts), boolean chains 3, ternaries 1 (3 pts), error handling 1 (nesting depth added 9). Most of this is not in the body itself: 1 of the 31 points is its own statement and the rest belongs to 5 function items inside it that branch (a function literal at line 66, extractPattern, a function literal at line 74, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · onContextMenu (cognitive 31) · ×1
  • onContextMenu (cognitive 31) editor/js/libs/codemirror/codemirror.js:9610 — onContextMenu has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (19 pts), boolean chains 7, ternaries 3 (5 pts) (nesting depth added 4). Most of this is not in the body itself: 13 of the 31 points are its own statements and the rest belongs to 4 function items inside it that branch (rehide, prepareSelectAllHack, rehide::poll, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · parseImportSpecifiers (cognitive 31) · ×1
  • parseImportSpecifiers (cognitive 31) editor/js/libs/acorn/acorn-loose.js:702 — parseImportSpecifiers has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (16 pts), ternaries 4 (13 pts), loops 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 · parseExprAtom (cognitive 31) · ×1
  • parseExprAtom (cognitive 31) editor/js/libs/acorn/acorn-loose.js:961 — parseExprAtom has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (20 pts), ternaries 3 (6 pts), boolean chains 4, match/switch 1 (nesting depth added 14). 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 · distanceSqToSegment (cognitive 31) · ×1
  • distanceSqToSegment (cognitive 31) src/math/Ray.js:180 — distanceSqToSegment has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (21 pts), ternaries 3 (10 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 · EditorControls.constructor (cognitive 30) · ×1
  • EditorControls.constructor (cognitive 30) editor/js/EditorControls.js:5 — EditorControls.constructor has cognitive complexity 30 (threshold 15). Drivers by points: if/else 19 (22 pts), loops 3, match/switch 3, ternaries 2 (nesting depth added 3). None of this is in the body itself: all 30 points belong to 17 function items inside it that branch (onPointerDown, onPointerMove, onMouseDown, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · codemirror.updateHeightsInViewport (cognitive 30) · ×1
  • codemirror.updateHeightsInViewport (cognitive 30) editor/js/libs/codemirror/codemirror.js:3360 — codemirror.updateHeightsInViewport has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PlaygroundManager.togglePlayground (cognitive 30) · ×1
  • PlaygroundManager.togglePlayground (cognitive 30) tsl/js/managers/PlaygroundManager.js:16 — PlaygroundManager.togglePlayground has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (27 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 · checkLVal (cognitive 30) · ×1
  • checkLVal (cognitive 30) editor/js/libs/acorn/acorn.js:1802 — checkLVal has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (17 pts), ternaries 2 (5 pts), loops 2 (4 pts), boolean chains 3, 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 · parseProperty (cognitive 30) · ×1
  • parseProperty (cognitive 30) editor/js/libs/acorn/acorn.js:2470 — parseProperty has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 7 (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 · _getTextureBindingTypes (cognitive 30) · ×1
  • _getTextureBindingTypes (cognitive 30) src/renderers/webgpu/nodes/WGSLNodeBuilder.js:2333 — _getTextureBindingTypes has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 9, ternaries 4 (9 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 · (anonymous) (cognitive 30) · ×1
  • (anonymous) (cognitive 30) editor/js/libs/ternjs/infer.js:1401 — (anonymous) has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 4, loops 2 (nesting depth added 12). Of this number, 17 points are the body's own statements and 13 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · findQueryExpr (cognitive 30) · ×1
  • findQueryExpr (cognitive 30) editor/js/libs/ternjs/tern.js:845 — findQueryExpr has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 9, ternaries 2 (8 pts) (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 · build (cognitive 30) · ×1
  • build (cognitive 30) src/nodes/tsl/TSLCore.js:667 — build has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2 (9 pts), boolean chains 5, 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 · acorn.pp$3.checkPropClash (cognitive 29) · ×1
  • acorn.pp$3.checkPropClash (cognitive 29) editor/js/libs/acorn/acorn.js:1871 — acorn.pp$3.checkPropClash has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 8, match/switch 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 · acorn.pp$5.declareName (cognitive 29) · ×1
  • acorn.pp$5.declareName (cognitive 29) editor/js/libs/acorn/acorn.js:2867 — acorn.pp$5.declareName has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 8, 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 · tern.doRequest (cognitive 29) · ×1
  • tern.doRequest (cognitive 29) editor/js/libs/ternjs/tern.js:235 — tern.doRequest has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 5, ternaries 2 (4 pts), error handling 1, loops 1 (nesting depth added 6). Of this number, 19 points are the body's own statements and 10 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NodeBuilder.generateConst (cognitive 29) · ×1
  • NodeBuilder.generateConst (cognitive 29) src/nodes/core/NodeBuilder.js:1557 — NodeBuilder.generateConst has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17 (18 pts), boolean chains 7, ternaries 2 (4 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.
D2 · Cognitive Complexity · WebGLUniformsGroups.WebGLUniformsGroups.prepareUniformsGroup (cognitive 29) · ×1
  • WebGLUniformsGroups.WebGLUniformsGroups.prepareUniformsGroup (cognitive 29) src/renderers/webgl/WebGLUniformsGroups.js:254 — WebGLUniformsGroups.WebGLUniformsGroups.prepareUniformsGroup has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 4 (12 pts), if/else 3 (9 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · conflictingCollapsedRange (cognitive 29) · ×1
  • conflictingCollapsedRange (cognitive 29) editor/js/libs/codemirror/codemirror.js:1535 — conflictingCollapsedRange has cognitive complexity 29 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 9, ternaries 2 (8 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 · parseSubscript (cognitive 29) · ×1
  • parseSubscript (cognitive 29) editor/js/libs/acorn/acorn.js:2110 — parseSubscript has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 9, 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 · copyFramebufferToTexture (cognitive 29) · ×1
  • copyFramebufferToTexture (cognitive 29) src/renderers/webgpu/WebGPUBackend.js:3355 — copyFramebufferToTexture has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17 (24 pts), boolean chains 3, loops 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 · parseSubscripts (cognitive 29) · ×1
  • parseSubscripts (cognitive 29) editor/js/libs/acorn/acorn-loose.js:912 — parseSubscripts has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 9, 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 · parseApiSignature (cognitive 29) · ×1
  • parseApiSignature (cognitive 29) tsl/js/utils/MarkdownUtils.js:945 — parseApiSignature has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 6 (18 pts), if/else 6 (10 pts), boolean chains 1 (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 · setup (cognitive 29) · ×1
  • setup (cognitive 29) src/nodes/accessors/TextureNode.js:451 — setup has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 10, ternaries 1 (3 pts) (nesting depth added 6). Of this number, 24 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parseFnType (cognitive 29) · ×1
  • parseFnType (cognitive 29) editor/js/libs/ternjs/def.js:96 — parseFnType has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (24 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 · RenderImageDialog.constructor (cognitive 28) · ×1
  • RenderImageDialog.constructor (cognitive 28) editor/js/Menubar.Render.js:76 — RenderImageDialog.constructor has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (21 pts), loops 1 (3 pts), ternaries 1 (3 pts), match/switch 1 (nesting depth added 12). None of this is in the body itself: all 28 points belong to 3 function literals inside it that branch (lines 157, 163, 287). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · CylinderGeometry.constructor (cognitive 28) · ×1
  • CylinderGeometry.constructor (cognitive 28) src/geometries/CylinderGeometry.js:34 — CylinderGeometry.constructor has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 7 (9 pts), ternaries 3, boolean chains 2 (nesting depth added 9). Most of this is not in the body itself: 5 of the 28 points are its own statements and the rest belongs to 2 function items inside it that branch (generateTorso, generateCap). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · WebGPUPipelineUtils._getBlending (cognitive 28) · ×1
  • WebGPUPipelineUtils._getBlending (cognitive 28) src/renderers/webgpu/utils/WebGPUPipelineUtils.js:560 — WebGPUPipelineUtils._getBlending has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 5 (14 pts), if/else 6 (7 pts), match/switch 2 (6 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 · WebGLBindingStates.WebGLBindingStates.needsUpdate (cognitive 28) · ×1
  • WebGLBindingStates.WebGLBindingStates.needsUpdate (cognitive 28) src/renderers/webgl/WebGLBindingStates.js:149 — WebGLBindingStates.WebGLBindingStates.needsUpdate has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (24 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 · MarkdownUtils.parseGuide · ×1
  • MarkdownUtils.parseGuide::flatten (cognitive 28) tsl/js/utils/MarkdownUtils.js:131 — MarkdownUtils.parseGuide::flatten has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 9, loops 3 (4 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. This shape REPEATS in the file: one other method here (MarkdownUtils.parseGuide) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · MarkdownUtils.parseGuide (cognitive 28) · ×1
  • MarkdownUtils.parseGuide (cognitive 28) tsl/js/utils/MarkdownUtils.js:30 — MarkdownUtils.parseGuide has cognitive complexity 28 (threshold 15). Drivers by points: if/else 20 (32 pts), boolean chains 16, loops 6 (9 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. This shape REPEATS in the file: one other method here (MarkdownUtils.parseGuide::flatten) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · MarkdownUtils.formatApiParameters (cognitive 28) · ×1
  • MarkdownUtils.formatApiParameters (cognitive 28) tsl/js/utils/MarkdownUtils.js:873 — MarkdownUtils.formatApiParameters has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 8, ternaries 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 · PlaygroundManager.showImportedFiles (cognitive 28) · ×1
  • PlaygroundManager.showImportedFiles (cognitive 28) tsl/js/managers/PlaygroundManager.js:1158 — PlaygroundManager.showImportedFiles has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (20 pts), error handling 1 (4 pts), boolean chains 3, 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 · sortLinked (cognitive 28) · ×1
  • sortLinked (cognitive 28) src/extras/lib/earcut.js:393 — sortLinked has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 5 (10 pts), boolean chains 4 (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 · intersectTriangle (cognitive 28) · ×1
  • intersectTriangle (cognitive 28) src/math/Ray.js:538 — intersectTriangle has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 5, 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 · Animation · ×1
  • Animation::update (cognitive 28) editor/js/Animation.js:300 — Animation::update has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 3 (8 pts), boolean chains 2, ternaries 1 (2 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 · WebGLBindingStates.needsUpdate (cognitive 28) · ×1
  • WebGLBindingStates.needsUpdate (cognitive 28) src/renderers/webgl/WebGLBindingStates.js:149 — WebGLBindingStates.needsUpdate has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (24 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 · flattenJSON (cognitive 28) · ×1
  • flattenJSON (cognitive 28) src/animation/AnimationUtils.js:99 — flattenJSON has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 7 (13 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 · codemirror.removeReadOnlyRanges (cognitive 27) · ×1
  • codemirror.removeReadOnlyRanges (cognitive 27) editor/js/libs/codemirror/codemirror.js:1445 — codemirror.removeReadOnlyRanges has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 8, loops 3 (5 pts) (nesting depth added 10). Of this number, 18 points are the body's own statements and 9 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tern.invalidDoc (cognitive 27) · ×1
  • tern.invalidDoc (cognitive 27) editor/js/libs/ternjs/tern.js:546 — tern.invalidDoc has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 3, loops 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 · prettify.recombineTagsAndDecorations (cognitive 27) · ×1
  • prettify.recombineTagsAndDecorations (cognitive 27) REDACTED:1181 — prettify.recombineTagsAndDecorations has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 5, loops 4 (5 pts) (nesting depth added 9). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · AnimationObjectGroup.uncache (cognitive 27) · ×1
  • AnimationObjectGroup.uncache (cognitive 27) src/animation/AnimationObjectGroup.js:249 — AnimationObjectGroup.uncache has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 3 (9 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 · WebGLTextureUtils.setupRenderBufferStorage (cognitive 27) · ×1
  • WebGLTextureUtils.setupRenderBufferStorage (cognitive 27) src/renderers/webgl-fallback/utils/WebGLTextureUtils.js:1216 — WebGLTextureUtils.setupRenderBufferStorage has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 4 (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 · markedSpansAfter (cognitive 27) · ×1
  • markedSpansAfter (cognitive 27) editor/js/libs/codemirror/codemirror.js:1352 — markedSpansAfter has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 4 (15 pts), boolean chains 6, if/else 2 (4 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 · init (cognitive 27) · ×1
  • init (cognitive 27) editor/js/libs/codemirror/codemirror.js:8810 — init has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 3, loops 1 (nesting depth added 6). None of this is in the body itself: all 27 points belong to 11 function items inside it that branch (onCopyCut, belongsToInput, a function literal at line 8826, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · showPrimarySelection (cognitive 27) · ×1
  • showPrimarySelection (cognitive 27) editor/js/libs/codemirror/codemirror.js:8919 — showPrimarySelection has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 10, ternaries 1 (2 pts), 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 · makeupType (cognitive 27) · ×1
  • makeupType (cognitive 27) editor/js/libs/ternjs/infer.js:171 — makeupType has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 4 (7 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 · addType (cognitive 27) · ×1
  • addType (cognitive 27) editor/js/libs/ternjs/infer.js:368 — addType has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (17 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 · addCompletion (cognitive 27) · ×1
  • addCompletion (cognitive 27) editor/js/libs/ternjs/tern.js:686 — addCompletion has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 10, ternaries 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 · parseEffect (cognitive 27) · ×1
  • parseEffect (cognitive 27) editor/js/libs/ternjs/def.js:314 — parseEffect has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 4 (9 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 11). Of this number, 18 points are the body's own statements and 9 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · expandByObject (cognitive 27) · ×1
  • expandByObject (cognitive 27) src/math/Box3.js:303 — expandByObject has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 2 (4 pts), boolean chains 2 (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 · getSize (cognitive 27) · ×1
  • getSize (cognitive 27) src/renderers/common/Textures.js:556 — getSize has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 11, if/else 8 (10 pts), ternaries 3 (6 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 · acorn.pp$1.parseExport (cognitive 26) · ×1
  • acorn.pp$1.parseExport (cognitive 26) editor/js/libs/acorn/acorn.js:1409 — acorn.pp$1.parseExport has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (22 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 · codemirror.copyHistoryArray (cognitive 26) · ×1
  • codemirror.copyHistoryArray (cognitive 26) editor/js/libs/codemirror/codemirror.js:5042 — codemirror.copyHistoryArray has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (16 pts), loops 3 (7 pts), ternaries 1 (3 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 · Bindings._destroyBindings (cognitive 26) · ×1
  • Bindings._destroyBindings (cognitive 26) src/renderers/common/Bindings.js:372 — Bindings._destroyBindings has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 2 (4 pts) (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · GLSLNodeFunction.parse (cognitive 26) · ×1
  • GLSLNodeFunction.parse (cognitive 26) src/nodes/parsers/GLSLNodeFunction.js:9 — GLSLNodeFunction.parse has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 4 (7 pts), loops 2 (4 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 · NodeManager.updateBackground (cognitive 26) · ×1
  • NodeManager.updateBackground (cognitive 26) src/renderers/common/nodes/NodeManager.js:517 — NodeManager.updateBackground has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 6 (nesting depth added 10). Most of this is not in the body itself: 8 of the 26 points are its own statements and the rest belongs to one function literal inside it that branches (line 528). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · runMode (cognitive 26) · ×1
  • runMode (cognitive 26) editor/js/libs/codemirror/codemirror.js:1211 — runMode has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (5 pts), ternaries 1 (4 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 · highlightWorker (cognitive 26) · ×1
  • highlightWorker (cognitive 26) editor/js/libs/codemirror/codemirror.js:3993 — highlightWorker has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4, loops 2 (4 pts), ternaries 2 (4 pts) (nesting depth added 8). Most of this is not in the body itself: 2 of the 26 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 4000, 4029). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · readNumber (cognitive 26) · ×1
  • readNumber (cognitive 26) editor/js/libs/acorn/acorn.js:4642 — readNumber has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 10, ternaries 2 (3 pts) (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 · setupDiffuseColor (cognitive 26) · ×1
  • setupDiffuseColor (cognitive 26) src/materials/nodes/NodeMaterial.js:828 — setupDiffuseColor has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (12 pts), ternaries 6 (10 pts), boolean chains 4 (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 · updateAttribute (cognitive 26) · ×1
  • updateAttribute (cognitive 26) src/renderers/webgpu/utils/WebGPUAttributeUtils.js:258 — updateAttribute has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (16 pts), ternaries 2 (6 pts), boolean chains 2, 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 · codemirror.alignHorizontally (cognitive 25) · ×1
  • codemirror.alignHorizontally (cognitive 25) editor/js/libs/codemirror/codemirror.js:4283 — codemirror.alignHorizontally has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 2 (5 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 · codemirror.locateNodeInLineView (cognitive 25) · ×1
  • codemirror.locateNodeInLineView (cognitive 25) editor/js/libs/codemirror/codemirror.js:9282 — codemirror.locateNodeInLineView has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (21 pts), ternaries 5 (12 pts), loops 5 (6 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 · Line.raycast (cognitive 25) · ×1
  • Line.raycast (cognitive 25) src/objects/Line.js:192 — Line.raycast has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 2 (4 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 · UniformArrayNode.updateBuffer (cognitive 25) · ×1
  • UniformArrayNode.updateBuffer (cognitive 25) src/nodes/accessors/UniformArrayNode.js:213 — UniformArrayNode.updateBuffer has cognitive complexity 25 (threshold 15). Drivers by points: loops 7 (15 pts), if/else 6, boolean chains 4 (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 · Morph.morphReference (cognitive 25) · ×1
  • Morph.morphReference (cognitive 25) src/nodes/accessors/Morph.js:223 — Morph.morphReference has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (17 pts), boolean chains 5, ternaries 2 (3 pts) (nesting depth added 2). Of this number, 14 points are the body's own statements and 11 belong to 4 function literals inside it that branch. 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 · WebGPUBackend._updateArrayCameraLayerDescriptors (cognitive 25) · ×1
  • WebGPUBackend._updateArrayCameraLayerDescriptors (cognitive 25) src/renderers/webgpu/WebGPUBackend.js:1359 — WebGPUBackend._updateArrayCameraLayerDescriptors has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 4, 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 · WebGLShadowMap.WebGLShadowMap · ×1
  • WebGLShadowMap.WebGLShadowMap::renderObject (cognitive 25) src/renderers/webgl/WebGLShadowMap.js:520 — WebGLShadowMap.WebGLShadowMap::renderObject has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 7, loops 2 (5 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · generateMaterialXNodeInterfaceRegistry.parseNodeDefs (cognitive 25) · ×1
  • generateMaterialXNodeInterfaceRegistry.parseNodeDefs (cognitive 25) utils/generateMaterialXNodeInterfaceRegistry.js:71 — generateMaterialXNodeInterfaceRegistry.parseNodeDefs has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · updateLineGutter (cognitive 25) · ×1
  • updateLineGutter (cognitive 25) editor/js/libs/codemirror/codemirror.js:2177 — updateLineGutter has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 4, ternaries 2 (4 pts), loops 1 (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 · scrollPosIntoView (cognitive 25) · ×1
  • scrollPosIntoView (cognitive 25) editor/js/libs/codemirror/codemirror.js:3457 — scrollPosIntoView has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 4 (8 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 · patchDisplay (cognitive 25) · ×1
  • patchDisplay (cognitive 25) editor/js/libs/codemirror/codemirror.js:4227 — patchDisplay has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 10). Of this number, 22 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · locateNodeInLineView · ×1
  • locateNodeInLineView::find (cognitive 25) editor/js/libs/codemirror/codemirror.js:9303 — locateNodeInLineView::find has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 4 (13 pts), if/else 2 (7 pts), loops 2 (3 pts), boolean chains 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 · parseFunction (cognitive 25) · ×1
  • parseFunction (cognitive 25) editor/js/libs/acorn/acorn.js:1253 — parseFunction has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 6 (8 pts), boolean chains 6 (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 · copy (cognitive 25) · ×1
  • copy (cognitive 25) src/materials/nodes/NodeMaterial.js:1350 — copy has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 4, loops 3 (4 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 · renderPlaygroundTabs (cognitive 25) · ×1
  • renderPlaygroundTabs (cognitive 25) tsl/js/managers/PlaygroundManager.js:265 — renderPlaygroundTabs has cognitive complexity 25 (threshold 15). Drivers by points: if/else 19 (20 pts), boolean chains 4, error handling 1 (nesting depth added 1). Most of this is not in the body itself: 3 of the 25 points are its own statements and the rest belongs to 26 function items inside it that branch ((anonymous)::ondrop, (anonymous)::ondragover, a function literal at line 389, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · updateDebugWGSL (cognitive 25) · ×1
  • updateDebugWGSL (cognitive 25) tsl/js/managers/PlaygroundManager.js:998 — updateDebugWGSL has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 8, ternaries 2 (3 pts), error handling 1 (2 pts) (nesting depth added 4). Of this number, 21 points are the body's own statements and 4 belong to 2 function literals inside it that branch. 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 · Selector.constructor (cognitive 24) · ×1
  • Selector.constructor (cognitive 24) editor/js/Selector.js:14 — Selector.constructor has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 9). None of this is in the body itself: all 24 points belong to 2 function literals inside it that branch (lines 32, 90). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · infer.arrayLiteralType (cognitive 24) · ×1
  • infer.arrayLiteralType (cognitive 24) editor/js/libs/ternjs/infer.js:1351 — infer.arrayLiteralType has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 3 (6 pts), boolean chains 4 (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 · ImageLoader.load (cognitive 24) · ×1
  • ImageLoader.load (cognitive 24) src/loaders/ImageLoader.js:45 — ImageLoader.load has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 2, loops 2 (nesting depth added 8). Most of this is not in the body itself: 11 of the 24 points are its own statements and the rest belongs to 3 function items inside it that branch (onImageLoad, onImageError, a function literal at line 61). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · RenderObject.needsGeometryUpdate (cognitive 24) · ×1
  • RenderObject.needsGeometryUpdate (cognitive 24) src/renderers/common/RenderObject.js:939 — RenderObject.needsGeometryUpdate has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (4 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarkdownUtils.splitArguments (cognitive 24) · ×1
  • MarkdownUtils.splitArguments (cognitive 24) tsl/js/utils/MarkdownUtils.js:648 — MarkdownUtils.splitArguments has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 6, 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 · MarkdownUtils.formatSignatureArgs (cognitive 24) · ×1
  • MarkdownUtils.formatSignatureArgs (cognitive 24) tsl/js/utils/MarkdownUtils.js:764 — MarkdownUtils.formatSignatureArgs has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 8, ternaries 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 · PlaygroundManager.loadPlaygroundFromHash (cognitive 24) · ×1
  • PlaygroundManager.loadPlaygroundFromHash (cognitive 24) tsl/js/managers/PlaygroundManager.js:169 — PlaygroundManager.loadPlaygroundFromHash has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, loops 1 (3 pts), error handling 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 · Guide.setupTOC · ×1
  • Guide.setupTOC::createTOCNode (cognitive 24) REDACTED:2008 — Guide.setupTOC::createTOCNode has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (24 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. This shape REPEATS in the file: one other method here (Guide.setupTOC) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · bidiSimplify (cognitive 24) · ×1
  • bidiSimplify (cognitive 24) editor/js/libs/codemirror/codemirror.js:7615 — bidiSimplify has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 7 (9 pts), boolean chains 6 (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 · defineOptions (cognitive 24) · ×1
  • defineOptions (cognitive 24) editor/js/libs/codemirror/codemirror.js:7710 — defineOptions has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 5 (6 pts), boolean chains 4, loops 2 (nesting depth added 3). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to 29 function items inside it that branch (a function literal at line 7776, option, a function literal at line 7745, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · regexp_eatRegExpUnicodeEscapeSequence (cognitive 24) · ×1
  • regexp_eatRegExpUnicodeEscapeSequence (cognitive 24) editor/js/libs/acorn/acorn.js:3806 — regexp_eatRegExpUnicodeEscapeSequence has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (19 pts), boolean chains 5 (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 · isDeterministic (cognitive 24) · ×1
  • isDeterministic (cognitive 24) src/nodes/core/NodeBuilder.js:2465 — isDeterministic has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 3 (6 pts), boolean chains 4, loops 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 · maybeTagAsGeneric (cognitive 24) · ×1
  • maybeTagAsGeneric (cognitive 24) editor/js/libs/ternjs/infer.js:1027 — maybeTagAsGeneric has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 4, loops 2, ternaries 1 (2 pts) (nesting depth added 6). Most of this is not in the body itself: 11 of the 24 points are its own statements and the rest belongs to 2 function items inside it that branch (explore, parsed). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · updateBinding (cognitive 24) · ×1
  • updateBinding (cognitive 24) src/renderers/webgl-fallback/WebGLBackend.js:2129 — updateBinding has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 2 (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 · tokenizeCodeToElement (cognitive 24) · ×1
  • tokenizeCodeToElement (cognitive 24) tsl/js/utils/MarkdownUtils.js:1388 — tokenizeCodeToElement has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (17 pts), ternaries 2 (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 · transformUv (cognitive 24) · ×1
  • transformUv (cognitive 24) src/textures/Texture.js:697 — transformUv has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 2 (6 pts), match/switch 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 · acorn.pp$9.readEscapedChar (cognitive 23) · ×1
  • acorn.pp$9.readEscapedChar (cognitive 23) editor/js/libs/acorn/acorn.js:4814 — acorn.pp$9.readEscapedChar has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 4, ternaries 1 (4 pts), match/switch 1 (nesting depth added 11). 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 · codemirror.normalizeKeyMap (cognitive 23) · ×1
  • codemirror.normalizeKeyMap (cognitive 23) editor/js/libs/codemirror/codemirror.js:6776 — codemirror.normalizeKeyMap has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 3 (5 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 · codemirror.onMouseDown (cognitive 23) · ×1
  • codemirror.onMouseDown (cognitive 23) editor/js/libs/codemirror/codemirror.js:7337 — codemirror.onMouseDown has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 4, 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 · codemirror.domTextBetween · ×1
  • codemirror.domTextBetween::walk (cognitive 23) editor/js/libs/codemirror/codemirror.js:9226 — codemirror.domTextBetween::walk has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 2, loops 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 · Vector4.setAxisAngleFromRotationMatrix (cognitive 23) · ×1
  • Vector4.setAxisAngleFromRotationMatrix (cognitive 23) src/math/Vector4.js:527 — Vector4.setAxisAngleFromRotationMatrix has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (20 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 · UniformsUtils.cloneUniforms (cognitive 23) · ×1
  • UniformsUtils.cloneUniforms (cognitive 23) src/renderers/shaders/UniformsUtils.js:18 — UniformsUtils.cloneUniforms has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (8 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 · CompressedTextureLoader.load (cognitive 23) · ×1
  • CompressedTextureLoader.load (cognitive 23) src/loaders/CompressedTextureLoader.js:41 — CompressedTextureLoader.load has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 3 (9 pts) (nesting depth added 11). Most of this is not in the body itself: 4 of the 23 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 102, 61). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · CubeMapNode.updateBefore (cognitive 23) · ×1
  • CubeMapNode.updateBefore (cognitive 23) src/nodes/utils/CubeMapNode.js:82 — CubeMapNode.updateBefore has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 3, ternaries 1 (2 pts) (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 · Info._getTextureMemorySize (cognitive 23) · ×1
  • Info._getTextureMemorySize (cognitive 23) src/renderers/common/Info.js:469 — Info._getTextureMemorySize has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 9, ternaries 1 (2 pts), 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, 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 · Pipelines.getForRender (cognitive 23) · ×1
  • Pipelines.getForRender (cognitive 23) src/renderers/common/Pipelines.js:166 — Pipelines.getForRender has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (21 pts), ternaries 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 · WebGPUPipelineUtils._reportShaderDiagnostics (cognitive 23) · ×1
  • WebGPUPipelineUtils._reportShaderDiagnostics (cognitive 23) src/renderers/webgpu/utils/WebGPUPipelineUtils.js:519 — WebGPUPipelineUtils._reportShaderDiagnostics has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 3 (10 pts), if/else 3 (9 pts), loops 2 (3 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 · WebGLMaterials.WebGLMaterials.refreshMaterialUniforms (cognitive 23) · ×1
  • WebGLMaterials.WebGLMaterials.refreshMaterialUniforms (cognitive 23) src/renderers/webgl/WebGLMaterials.js:42 — WebGLMaterials.WebGLMaterials.refreshMaterialUniforms has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19 (23 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 · MarkdownUtils.splitTypeTokens (cognitive 23) · ×1
  • MarkdownUtils.splitTypeTokens (cognitive 23) tsl/js/utils/MarkdownUtils.js:691 — MarkdownUtils.splitTypeTokens has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 5, 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 · markedSpansBefore (cognitive 23) · ×1
  • markedSpansBefore (cognitive 23) editor/js/libs/codemirror/codemirror.js:1340 — markedSpansBefore has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 3 (11 pts), boolean chains 6, if/else 2 (4 pts), 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 · calculateScrollPos (cognitive 23) · ×1
  • calculateScrollPos (cognitive 23) editor/js/libs/codemirror/codemirror.js:3501 — calculateScrollPos has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 7 (11 pts), if/else 9 (10 pts), boolean chains 2 (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 · endOperation_finish (cognitive 23) · ×1
  • endOperation_finish (cognitive 23) editor/js/libs/codemirror/codemirror.js:3912 — endOperation_finish has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 2 (4 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 · CodeMirror (cognitive 23) · ×1
  • CodeMirror (cognitive 23) editor/js/libs/codemirror/codemirror.js:7885 — CodeMirror has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 6, loops 2, ternaries 1 (nesting depth added 2). Of this number, 20 points are the body's own statements and 3 belong to 2 function literals inside it that branch. 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 · poll (cognitive 23) · ×1
  • poll (cognitive 23) editor/js/libs/codemirror/codemirror.js:9550 — poll has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 10, loops 1, ternaries 1 (nesting depth added 2). Of this number, 18 points are the body's own statements and 5 belong to one function literal inside it that branches. 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 · format (cognitive 23) · ×1
  • format (cognitive 23) src/nodes/core/NodeBuilder.js:3761 — format has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10, boolean chains 7, ternaries 3 (6 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.
D2 · Cognitive Complexity · isEarHashed (cognitive 23) · ×1
  • isEarHashed (cognitive 23) src/extras/lib/earcut.js:163 — isEarHashed has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 11, if/else 5 (9 pts), loops 3 (nesting depth added 4). 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 · WebGLMaterials.refreshMaterialUniforms (cognitive 23) · ×1
  • WebGLMaterials.refreshMaterialUniforms (cognitive 23) src/renderers/webgl/WebGLMaterials.js:42 — WebGLMaterials.refreshMaterialUniforms has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19 (23 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 · Viewport.Info.ViewportInfo (cognitive 22) · ×1
  • Viewport.Info.ViewportInfo (cognitive 22) editor/js/Viewport.Info.js:3 — Viewport.Info.ViewportInfo has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (13 pts), ternaries 5, boolean chains 3, loops 1 (nesting depth added 8). None of this is in the body itself: all 22 points belong to 4 function items inside it that branch (a function literal at line 56, update, a function literal at line 118, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · Sidebar.Geometry.SidebarGeometry · ×1
  • Sidebar.Geometry.SidebarGeometry::build (cognitive 22) editor/js/Sidebar.Geometry.js:279 — Sidebar.Geometry.SidebarGeometry::build has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, loops 1 (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 · codemirror.triggerElectric (cognitive 22) · ×1
  • codemirror.triggerElectric (cognitive 22) editor/js/libs/codemirror/codemirror.js:8206 — codemirror.triggerElectric has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (4 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 · def.passOne (cognitive 22) · ×1
  • def.passOne (cognitive 22) editor/js/libs/ternjs/def.js:431 — def.passOne has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (16 pts), ternaries 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 · ShaderMaterial.toJSON (cognitive 22) · ×1
  • ShaderMaterial.toJSON (cognitive 22) src/materials/ShaderMaterial.js:313 — ShaderMaterial.toJSON has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 7, loops 2 (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 · ImageBitmapLoader.load (cognitive 22) · ×1
  • ImageBitmapLoader.load (cognitive 22) src/loaders/ImageBitmapLoader.js:111 — ImageBitmapLoader.load has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 1 (nesting depth added 10). Most of this is not in the body itself: 6 of the 22 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 130, 156, 183, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · FunctionOverloadingNode.getCandidateFn (cognitive 22) · ×1
  • FunctionOverloadingNode.getCandidateFn (cognitive 22) src/nodes/utils/FunctionOverloadingNode.js:88 — FunctionOverloadingNode.getCandidateFn has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 2 (6 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Textures._destroyTexture (cognitive 22) · ×1
  • Textures._destroyTexture (cognitive 22) src/renderers/common/Textures.js:706 — Textures._destroyTexture has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 2 (7 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 · WGSLNodeBuilder.getVaryings (cognitive 22) · ×1
  • WGSLNodeBuilder.getVaryings (cognitive 22) src/renderers/webgpu/nodes/WGSLNodeBuilder.js:2149 — WGSLNodeBuilder.getVaryings has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 2 (6 pts), boolean chains 2, loops 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 · findPosH · ×1
  • findPosH::moveOnce (cognitive 22) editor/js/libs/codemirror/codemirror.js:8721 — findPosH::moveOnce has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 3 (8 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 · updateBindings (cognitive 22) · ×1
  • updateBindings (cognitive 22) src/renderers/webgl-fallback/WebGLBackend.js:2062 — updateBindings has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 2 (9 pts), if/else 4 (7 pts), loops 2 (5 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 · getRenderObjectData (cognitive 22) · ×1
  • getRenderObjectData (cognitive 22) src/materials/nodes/manager/NodeMaterialObserver.js:234 — getRenderObjectData has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 4 (11 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 · earcut (cognitive 22) · ×1
  • earcut (cognitive 22) src/extras/lib/earcut.js:5 — earcut has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 2 (3 pts), boolean chains 2, loops 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 · getVertexBufferLayout (cognitive 22) · ×1
  • getVertexBufferLayout (cognitive 22) src/renderers/webgpu/utils/WebGPUAttributeUtils.js:360 — getVertexBufferLayout has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (10 pts), ternaries 3 (10 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 · prettify.sourceDecorator (cognitive 21) · ×1
  • prettify.sourceDecorator (cognitive 21) REDACTED:805 — prettify.sourceDecorator has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (17 pts), ternaries 2 (4 pts) (nesting depth added 5). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · Color.setStyle (cognitive 21) · ×1
  • Color.setStyle (cognitive 21) src/math/Color.js:286 — Color.setStyle has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (18 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 8). Of this number, 19 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Material.setValues (cognitive 21) · ×1
  • Material.setValues (cognitive 21) src/materials/Material.js:557 — Material.setValues has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 11, if/else 6 (9 pts), loops 1 (nesting depth added 3). 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 · NodeUtils.getValueFromType (cognitive 21) · ×1
  • NodeUtils.getValueFromType (cognitive 21) src/nodes/core/NodeUtils.js:370 — NodeUtils.getValueFromType has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 4, ternaries 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 · NodeBuilder.getPromotedComponentType (cognitive 21) · ×1
  • NodeBuilder.getPromotedComponentType (cognitive 21) src/nodes/core/NodeBuilder.js:1998 — NodeBuilder.getPromotedComponentType has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 7, ternaries 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 · Renderer.compileComputeAsync (cognitive 21) · ×1
  • Renderer.compileComputeAsync (cognitive 21) src/renderers/common/Renderer.js:1369 — Renderer.compileComputeAsync has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2 (4 pts), boolean chains 2, ternaries 1 (nesting depth added 7). Of this number, 20 points are the body's own statements and 1 belongs to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WebGLVertexArrayUtils.getVAO (cognitive 21) · ×1
  • WebGLVertexArrayUtils.getVAO (cognitive 21) src/renderers/webgl-fallback/utils/WebGLVertexArrayUtils.js:45 — WebGLVertexArrayUtils.getVAO has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (4 pts), ternaries 2, 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 · WebGLTextureUtils.setTextureParameters (cognitive 21) · ×1
  • WebGLTextureUtils.setTextureParameters (cognitive 21) src/renderers/webgl-fallback/utils/WebGLTextureUtils.js:325 — WebGLTextureUtils.setTextureParameters has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 5, ternaries 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 · CodeFormatter.removeUnusedImports · ×1
  • CodeFormatter.removeUnusedImports::getFullLineRange (cognitive 21) tsl/js/code/CodeFormatter.js:69 — CodeFormatter.removeUnusedImports::getFullLineRange has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 7, loops 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 · build.categorize (cognitive 21) · ×1
  • build.categorize (cognitive 21) utils/llms/build.js:566 — build.categorize has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19, boolean chains 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 · addChangeToHistory (cognitive 21) · ×1
  • addChangeToHistory (cognitive 21) editor/js/libs/codemirror/codemirror.js:4898 — addChangeToHistory has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 6, loops 1 (2 pts), 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 · parseMaybeUnary (cognitive 21) · ×1
  • parseMaybeUnary (cognitive 21) editor/js/libs/acorn/acorn.js:2047 — parseMaybeUnary has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 6, loops 1 (2 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 · _createArrayCameraLayerDescriptors (cognitive 21) · ×1
  • _createArrayCameraLayerDescriptors (cognitive 21) src/renderers/webgpu/WebGPUBackend.js:1250 — _createArrayCameraLayerDescriptors has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 2, loops 1, other 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 · UIOutliner.setOptions (cognitive 20) · ×1
  • UIOutliner.setOptions (cognitive 20) editor/js/libs/ui.three.js:342 — UIOutliner.setOptions has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15 (17 pts), loops 2, boolean chains 1 (nesting depth added 2). Most of this is not in the body itself: 4 of the 20 points are its own statements and the rest belongs to 5 function items inside it that branch (onDrop, onDragOver, moveObject, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · acorn.pp$1.parseSwitchStatement (cognitive 20) · ×1
  • acorn.pp$1.parseSwitchStatement (cognitive 20) editor/js/libs/acorn/acorn.js:1009 — acorn.pp$1.parseSwitchStatement has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (18 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 · codemirror.makeChangeSingleDocInEditor (cognitive 20) · ×1
  • codemirror.makeChangeSingleDocInEditor (cognitive 20) editor/js/libs/codemirror/codemirror.js:5471 — codemirror.makeChangeSingleDocInEditor has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 3 (nesting depth added 5). Of this number, 16 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · infer.findPropRefs (cognitive 20) · ×1
  • infer.findPropRefs (cognitive 20) editor/js/libs/ternjs/infer.js:2191 — infer.findPropRefs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 7, loops 3 (nesting depth added 2). Most of this is not in the body itself: 4 of the 20 points are its own statements and the rest belongs to 4 function items inside it that branch (isObjTypeProto, a function literal at line 2215, a function literal at line 2211, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · Euler.setFromRotationMatrix (cognitive 20) · ×1
  • Euler.setFromRotationMatrix (cognitive 20) src/math/Euler.js:189 — Euler.setFromRotationMatrix has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (19 pts), 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 · Ray.intersectBox (cognitive 20) · ×1
  • Ray.intersectBox (cognitive 20) src/math/Ray.js:449 — Ray.intersectBox has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13, boolean chains 6, ternaries 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 · CatmullRomCurve3.getPoint (cognitive 20) · ×1
  • CatmullRomCurve3.getPoint (cognitive 20) src/extras/curves/CatmullRomCurve3.js:175 — CatmullRomCurve3.getPoint has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 4, ternaries 1 (2 pts) (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 · TSLCore.getProxyParameters (cognitive 20) · ×1
  • TSLCore.getProxyParameters (cognitive 20) src/nodes/tsl/TSLCore.js:791 — TSLCore.getProxyParameters has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (20 pts) (nesting depth added 9). None of this is in the body itself: all 20 points belong to 2 function literals inside it that branch (lines 799, 813). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · Bindings.updateSharedForRender (cognitive 20) · ×1
  • Bindings.updateSharedForRender (cognitive 20) src/renderers/common/Bindings.js:244 — Bindings.updateSharedForRender has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (15 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 · NodeManager.getCacheKey (cognitive 20) · ×1
  • NodeManager.getCacheKey (cognitive 20) src/renderers/common/nodes/NodeManager.js:453 — NodeManager.getCacheKey has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 4 (8 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GLSLNodeBuilder.getUniformFromNode (cognitive 20) · ×1
  • GLSLNodeBuilder.getUniformFromNode (cognitive 20) src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js:1900 — GLSLNodeBuilder.getUniformFromNode has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 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 · WebGLBindingStates.WebGLBindingStates.saveCache (cognitive 20) · ×1
  • WebGLBindingStates.WebGLBindingStates.saveCache (cognitive 20) src/renderers/webgl/WebGLBindingStates.js:194 — WebGLBindingStates.WebGLBindingStates.saveCache has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (16 pts), boolean chains 3, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WebGLMaterials.WebGLMaterials.refreshUniformsCommon (cognitive 20) · ×1
  • WebGLMaterials.WebGLMaterials.refreshUniformsCommon (cognitive 20) src/renderers/webgl/WebGLMaterials.js:138 — WebGLMaterials.WebGLMaterials.refreshUniformsCommon has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16 (19 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.
D2 · Cognitive Complexity · publish.buildMainNav (cognitive 20) · ×1
  • publish.buildMainNav (cognitive 20) utils/docs/template/publish.js:451 — publish.buildMainNav has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (9 pts) (nesting depth added 11). Of this number, 10 points are the body's own statements and 10 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · normalizeSelection (cognitive 20) · ×1
  • normalizeSelection (cognitive 20) editor/js/libs/codemirror/codemirror.js:4648 — normalizeSelection has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 4 (12 pts), if/else 2 (5 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 · find (cognitive 20) · ×1
  • find (cognitive 20) editor/js/libs/codemirror/codemirror.js:5907 — find has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 2 (6 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 · configureMouse (cognitive 20) · ×1
  • configureMouse (cognitive 20) editor/js/libs/codemirror/codemirror.js:7394 — configureMouse has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 7 (13 pts), if/else 4, 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 · parseMaybeAssign (cognitive 20) · ×1
  • parseMaybeAssign (cognitive 20) editor/js/libs/acorn/acorn.js:1946 — parseMaybeAssign has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (17 pts), ternaries 1 (2 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 · init (cognitive 20) · ×1
  • init (cognitive 20) src/renderers/webgpu/WebGPUBackend.js:212 — init has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 6, ternaries 2 (3 pts), loops 1 (2 pts) (nesting depth added 5). Of this number, 13 points are the body's own statements and 7 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · toJSON (cognitive 20) · ×1
  • toJSON (cognitive 20) src/core/BufferGeometry.js:1242 — toJSON has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 4 (6 pts), boolean chains 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 · getProxyParameters · ×1
  • getProxyParameters::get (cognitive 20) src/nodes/tsl/TSLCore.js:799 — getProxyParameters::get has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (20 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 · createComputePipeline (cognitive 20) · ×1
  • createComputePipeline (cognitive 20) src/renderers/webgpu/utils/WebGPUPipelineUtils.js:384 — createComputePipeline has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 5, error handling 2 (5 pts), loops 1, ternaries 1 (nesting depth added 6). Most of this is not in the body itself: 4 of the 20 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 443, 427). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · addType (cognitive 20) · ×1
  • addType (cognitive 20) editor/js/libs/ternjs/def.js:567 — addType has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 3, loops 1 (3 pts) (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 · open (cognitive 20) · ×1
  • open (cognitive 20) manual/resources/tools/geo-picking/shapefile.js:430 — open has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, error handling 1 (3 pts) (nesting depth added 5). Of this number, 17 points are the body's own statements and 3 belong to 2 function literals inside it that branch. 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 · WebGLMaterials.refreshUniformsCommon (cognitive 20) · ×1
  • WebGLMaterials.refreshUniformsCommon (cognitive 20) src/renderers/webgl/WebGLMaterials.js:138 — WebGLMaterials.refreshUniformsCommon has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16 (19 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.
D2 · Cognitive Complexity · WebGLBindingStates.saveCache (cognitive 20) · ×1
  • WebGLBindingStates.saveCache (cognitive 20) src/renderers/webgl/WebGLBindingStates.js:194 — WebGLBindingStates.saveCache has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (16 pts), boolean chains 3, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · acorn.pp$1.parseBreakContinueStatement (cognitive 19) · ×1
  • acorn.pp$1.parseBreakContinueStatement (cognitive 19) editor/js/libs/acorn/acorn.js:884 — acorn.pp$1.parseBreakContinueStatement has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 5, 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 · acorn.pp$9.skipSpace (cognitive 19) · ×1
  • acorn.pp$9.skipSpace (cognitive 19) editor/js/libs/acorn/acorn.js:4331 — acorn.pp$9.skipSpace has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 2 (5 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 · codemirror.getBidiPartAt (cognitive 19) · ×1
  • codemirror.getBidiPartAt (cognitive 19) editor/js/libs/codemirror/codemirror.js:329 — codemirror.getBidiPartAt has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, loops 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 · codemirror.mergeOldSpans (cognitive 19) · ×1
  • codemirror.mergeOldSpans (cognitive 19) editor/js/libs/codemirror/codemirror.js:5018 — codemirror.mergeOldSpans has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (8 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 · codemirror.TextareaInput.init (cognitive 19) · ×1
  • codemirror.TextareaInput.init (cognitive 19) editor/js/libs/codemirror/codemirror.js:9355 — codemirror.TextareaInput.init has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 3 (nesting depth added 1). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 7 function items inside it that branch (prepareCopyCut, a function literal at line 9401, a function literal at line 9367, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · Texture.setValues (cognitive 19) · ×1
  • Texture.setValues (cognitive 19) src/textures/Texture.js:554 — Texture.setValues has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (9 pts), loops 1 (nesting depth added 3). 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 · CurvePath.getPoints (cognitive 19) · ×1
  • CurvePath.getPoints (cognitive 19) src/extras/core/CurvePath.js:208 — CurvePath.getPoints has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 2 (4 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 · SphereGeometry.constructor (cognitive 19) · ×1
  • SphereGeometry.constructor (cognitive 19) src/geometries/SphereGeometry.js:31 — SphereGeometry.constructor has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 4 (6 pts), boolean chains 4 (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 · KeyframeTrack.validate (cognitive 19) · ×1
  • KeyframeTrack.validate (cognitive 19) src/animation/KeyframeTrack.js:410 — KeyframeTrack.validate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LightsNode.setupLightsNode (cognitive 19) · ×1
  • LightsNode.setupLightsNode (cognitive 19) src/nodes/lighting/LightsNode.js:233 — LightsNode.setupLightsNode has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (17 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 · Bindings._createBindings (cognitive 19) · ×1
  • Bindings._createBindings (cognitive 19) src/renderers/common/Bindings.js:312 — Bindings._createBindings has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 1 (5 pts), loops 2 (4 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 · XRManager.onInputSourcesChange (cognitive 19) · ×1
  • XRManager.onInputSourcesChange (cognitive 19) src/renderers/common/XRManager.js:1669 — XRManager.onInputSourcesChange has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 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 · WGSLNodeFunction.parse (cognitive 19) · ×1
  • WGSLNodeFunction.parse (cognitive 19) src/renderers/webgpu/nodes/WGSLNodeFunction.js:79 — WGSLNodeFunction.parse has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (4 pts), boolean chains 3, 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 · SearchManager.getRankedTree · ×1
  • SearchManager.getRankedTree::processNodes (cognitive 19) REDACTED:216 — SearchManager.getRankedTree::processNodes has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 5, 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 · onKeyDown (cognitive 19) · ×1
  • onKeyDown (cognitive 19) editor/js/libs/codemirror/codemirror.js:7244 — onKeyDown has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 6, ternaries 2 (5 pts) (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 · _getFrameBufferTarget (cognitive 19) · ×1
  • _getFrameBufferTarget (cognitive 19) src/renderers/common/Renderer.js:1886 — _getFrameBufferTarget has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 12, if/else 5 (6 pts), boolean chains 1 (nesting depth added 1). Of this number, 17 points are the body's own statements and 2 belong to one function item inside it that branches. 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 · _createExternalTextureViews (cognitive 19) · ×1
  • _createExternalTextureViews (cognitive 19) src/renderers/webgpu/WebGPUBackend.js:630 — _createExternalTextureViews has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 4 (10 pts), boolean chains 5, if/else 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 · renderPage · ×1
  • renderPage::(anonymous)::onclick (cognitive 19) REDACTED:1672 — renderPage::(anonymous)::onclick has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 4 (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 · setupPBO (cognitive 19) · ×1
  • setupPBO (cognitive 19) src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js:428 — setupPBO has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 4 (11 pts), if/else 5 (7 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 · setGeometryAt (cognitive 19) · ×1
  • setGeometryAt (cognitive 19) src/objects/BatchedMesh.js:725 — setGeometryAt has cognitive complexity 19 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 5, boolean chains 2, ternaries 2 (nesting depth added 5). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · optimize (cognitive 19) · ×1
  • optimize (cognitive 19) src/objects/BatchedMesh.js:890 — optimize has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (8 pts), ternaries 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 · parseMaybeUnary (cognitive 19) · ×1
  • parseMaybeUnary (cognitive 19) editor/js/libs/acorn/acorn-loose.js:863 — parseMaybeUnary has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 6, loops 1 (2 pts), ternaries 1 (2 pts) (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 · ConvertType (cognitive 19) · ×1
  • ConvertType (cognitive 19) src/nodes/tsl/TSLCore.js:971 — ConvertType has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 5, loops 1 (nesting depth added 6). None of this is in the body itself: all 19 points belong to 3 function literals inside it that branch (lines 973, 987, 1026). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · XR.constructor (cognitive 18) · ×1
  • XR.constructor (cognitive 18) editor/js/Viewport.XR.js:10 — XR.constructor has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 1 (2 pts) (nesting depth added 7). None of this is in the body itself: all 18 points belong to 5 function items inside it that branch (onSessionStarted::onSelect, onSessionStarted, onSessionStarted::onControllerEvent, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · acorn.pp$8.regexp_eatBracedQuantifier (cognitive 18) · ×1
  • acorn.pp$8.regexp_eatBracedQuantifier (cognitive 18) editor/js/libs/acorn/acorn.js:3431 — acorn.pp$8.regexp_eatBracedQuantifier has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 3 (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 · acorn.pp$9.readRegexp (cognitive 18) · ×1
  • acorn.pp$9.readRegexp (cognitive 18) editor/js/libs/acorn/acorn.js:4569 — acorn.pp$9.readRegexp has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, error handling 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 · codemirror.prepareSelection (cognitive 18) · ×1
  • codemirror.prepareSelection (cognitive 18) editor/js/libs/codemirror/codemirror.js:3150 — codemirror.prepareSelection has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, 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 · codemirror.makeChange (cognitive 18) · ×1
  • codemirror.makeChange (cognitive 18) editor/js/libs/codemirror/codemirror.js:5303 — codemirror.makeChange has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 3, ternaries 1 (3 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 · BufferGeometry.computeTangents (cognitive 18) · ×1
  • BufferGeometry.computeTangents (cognitive 18) src/core/BufferGeometry.js:839 — BufferGeometry.computeTangents has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 4 (5 pts), boolean chains 2, ternaries 1 (nesting depth added 3). Of this number, 12 points are the body's own statements and 6 belong to 2 function items inside it that branch. 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 · ObjectLoader.parseGeometries (cognitive 18) · ×1
  • ObjectLoader.parseGeometries (cognitive 18) src/loaders/ObjectLoader.js:350 — ObjectLoader.parseGeometries has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 1 (3 pts), loops 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 · TSLCore.ConvertType.<returned closure> (cognitive 18) · ×1
  • TSLCore.ConvertType.<returned closure> (cognitive 18) src/nodes/tsl/TSLCore.js:973 — TSLCore.ConvertType.<returned closure> has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4, 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 · FunctionCallNode.generate (cognitive 18) · ×1
  • FunctionCallNode.generate (cognitive 18) src/nodes/code/FunctionCallNode.js:98 — FunctionCallNode.generate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 3 (7 pts) (nesting depth added 7). Of this number, 16 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PMREMNode._getPMREMFromTexture (cognitive 18) · ×1
  • PMREMNode._getPMREMFromTexture (cognitive 18) src/nodes/pmrem/PMREMNode.js:23 — PMREMNode._getPMREMFromTexture has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (17 pts), ternaries 1 (nesting depth added 8). Of this number, 15 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RenderObject.getAttributes (cognitive 18) · ×1
  • RenderObject.getAttributes (cognitive 18) src/renderers/common/RenderObject.js:598 — RenderObject.getAttributes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 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 · RenderObjects.get (cognitive 18) · ×1
  • RenderObjects.get (cognitive 18) src/renderers/common/RenderObjects.js:100 — RenderObjects.get has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 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 · NodeBuilder.getBindings (cognitive 18) · ×1
  • NodeBuilder.getBindings (cognitive 18) src/nodes/core/NodeBuilder.js:781 — NodeBuilder.getBindings has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (11 pts), if/else 2 (6 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 · WebGLBackend.finishRender (cognitive 18) · ×1
  • WebGLBackend.finishRender (cognitive 18) src/renderers/webgl-fallback/WebGLBackend.js:632 — WebGLBackend.finishRender has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 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 · WebGLBackend.resolveOccludedAsync (cognitive 18) · ×1
  • WebGLBackend.resolveOccludedAsync (cognitive 18) src/renderers/webgl-fallback/WebGLBackend.js:719 — WebGLBackend.resolveOccludedAsync has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 9). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to one function item inside it that branches (check). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · WebGPUBackend.compute (cognitive 18) · ×1
  • WebGPUBackend.compute (cognitive 18) src/renderers/webgpu/WebGPUBackend.js:1957 — WebGPUBackend.compute has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 5, loops 2 (4 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 · WebGLBackground.WebGLBackground.addToRenderList (cognitive 18) · ×1
  • WebGLBackground.WebGLBackground.addToRenderList (cognitive 18) src/renderers/webgl/WebGLBackground.js:88 — WebGLBackground.WebGLBackground.addToRenderList has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 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 · WebGLUniformsGroups.WebGLUniformsGroups.hasValueChanged (cognitive 18) · ×1
  • WebGLUniformsGroups.WebGLUniformsGroups.hasValueChanged (cognitive 18) src/renderers/webgl/WebGLUniformsGroups.js:195 — WebGLUniformsGroups.WebGLUniformsGroups.hasValueChanged has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 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 · viewCuttingPoint (cognitive 18) · ×1
  • viewCuttingPoint (cognitive 18) editor/js/libs/codemirror/codemirror.js:3089 — viewCuttingPoint has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (5 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 · update (cognitive 18) · ×1
  • update (cognitive 18) editor/js/libs/codemirror/codemirror.js:3648 — update has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 6 (7 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 · updateDisplayIfNeeded (cognitive 18) · ×1
  • updateDisplayIfNeeded (cognitive 18) editor/js/libs/codemirror/codemirror.js:4106 — updateDisplayIfNeeded has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, boolean chains 8. 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 · fromTextArea (cognitive 18) · ×1
  • fromTextArea (cognitive 18) editor/js/libs/codemirror/codemirror.js:9701 — fromTextArea has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, error handling 1 (3 pts), ternaries 1 (nesting depth added 4). Of this number, 14 points are the body's own statements and 4 belong to 6 function items inside it that branch. 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 · parseExprList (cognitive 18) · ×1
  • parseExprList (cognitive 18) editor/js/libs/acorn/acorn.js:2712 — parseExprList has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4, 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 · readWord1 (cognitive 18) · ×1
  • readWord1 (cognitive 18) editor/js/libs/acorn/acorn.js:4874 — readWord1 has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 2 (7 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 · generateTextureDimension (cognitive 18) · ×1
  • generateTextureDimension (cognitive 18) src/renderers/webgpu/nodes/WGSLNodeBuilder.js:562 — generateTextureDimension has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · numberLines (cognitive 18) · ×1
  • numberLines (cognitive 18) REDACTED:991 — numberLines has cognitive complexity 18 (threshold 15). Drivers by points: if/else 23 (53 pts), loops 9 (19 pts), boolean chains 8, ternaries 3 (nesting depth added 40). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · parseExport (cognitive 18) · ×1
  • parseExport (cognitive 18) editor/js/libs/acorn/acorn-loose.js:644 — parseExport has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 2 (4 pts), boolean chains 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 · setupLighting (cognitive 18) · ×1
  • setupLighting (cognitive 18) src/materials/nodes/NodeMaterial.js:1115 — setupLighting has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, ternaries 4 (6 pts), if/else 3 (nesting depth added 2). 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 · computeBoundingBox (cognitive 18) · ×1
  • computeBoundingBox (cognitive 18) src/core/BufferGeometry.js:645 — computeBoundingBox has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · (anonymous) (cognitive 18) · ×1
  • (anonymous) (cognitive 18) src/materials/nodes/Line2NodeMaterial.js:306 — (anonymous) has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 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 · getSearchSnippet (cognitive 18) · ×1
  • getSearchSnippet (cognitive 18) REDACTED:628 — getSearchSnippet has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, ternaries 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 · build-defs.parseDoc (cognitive 17) · ×1
  • build-defs.parseDoc (cognitive 17) editor/js/libs/tern-threejs/build-defs.js:53 — build-defs.parseDoc has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · codemirror.lineIsHidden (cognitive 17) · ×1
  • codemirror.lineIsHidden (cognitive 17) editor/js/libs/codemirror/codemirror.js:1602 — codemirror.lineIsHidden has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 2, 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 · codemirror.postUpdateDisplay (cognitive 17) · ×1
  • codemirror.postUpdateDisplay (cognitive 17) editor/js/libs/codemirror/codemirror.js:4178 — codemirror.postUpdateDisplay has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, 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 · codemirror.rebaseHistArray (cognitive 17) · ×1
  • codemirror.rebaseHistArray (cognitive 17) editor/js/libs/codemirror/codemirror.js:5556 — codemirror.rebaseHistArray has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 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 · codemirror.leftButtonStartDrag (cognitive 17) · ×1
  • codemirror.leftButtonStartDrag (cognitive 17) editor/js/libs/codemirror/codemirror.js:7425 — codemirror.leftButtonStartDrag has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4 (nesting depth added 3). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 7427, mouseMove). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · codemirror.domToPos (cognitive 17) · ×1
  • codemirror.domToPos (cognitive 17) editor/js/libs/codemirror/codemirror.js:9263 — codemirror.domToPos has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · infer.AVal.purge (cognitive 17) · ×1
  • infer.AVal.purge (cognitive 17) editor/js/libs/ternjs/infer.js:1808 — infer.AVal.purge has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 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 · BufferGeometry.computeVertexNormals (cognitive 17) · ×1
  • BufferGeometry.computeVertexNormals (cognitive 17) src/core/BufferGeometry.js:1017 — BufferGeometry.computeVertexNormals has cognitive complexity 17 (threshold 15). Drivers by points: loops 3 (9 pts), if/else 5 (7 pts), boolean chains 1 (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 · PropertyBinding.findNode (cognitive 17) · ×1
  • PropertyBinding.findNode (cognitive 17) REDACTED:266 — PropertyBinding.findNode has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 7). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to one function item inside it that branches (searchNodeSubtree). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · StackNode.build (cognitive 17) · ×1
  • StackNode.build (cognitive 17) src/nodes/core/StackNode.js:369 — StackNode.build has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, 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 · NodeMaterialObserver.getMaterialData (cognitive 17) · ×1
  • NodeMaterialObserver.getMaterialData (cognitive 17) src/materials/nodes/manager/NodeMaterialObserver.js:533 — NodeMaterialObserver.getMaterialData 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 · Background.update (cognitive 17) · ×1
  • Background.update (cognitive 17) src/renderers/common/Background.js:57 — Background.update has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 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 · NodeBuilder._getLayoutInputs (cognitive 17) · ×1
  • NodeBuilder._getLayoutInputs (cognitive 17) src/nodes/core/NodeBuilder.js:2851 — NodeBuilder._getLayoutInputs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 5 (6 pts), boolean chains 3 (nesting depth added 2). Of this number, 12 points are the body's own statements and 5 belong to 3 function literals inside it that branch. 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 · WebGLState._setMRTBlendingIndex (cognitive 17) · ×1
  • WebGLState._setMRTBlendingIndex (cognitive 17) src/renderers/webgl-fallback/utils/WebGLState.js:369 — WebGLState._setMRTBlendingIndex has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 2 (6 pts), ternaries 3 (6 pts), if/else 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 · WebGLTextureUtils.deallocateRenderBuffers (cognitive 17) · ×1
  • WebGLTextureUtils.deallocateRenderBuffers (cognitive 17) src/renderers/webgl-fallback/utils/WebGLTextureUtils.js:764 — WebGLTextureUtils.deallocateRenderBuffers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (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 · WebGLTextureUtils.copyFramebufferToTexture (cognitive 17) · ×1
  • WebGLTextureUtils.copyFramebufferToTexture (cognitive 17) src/renderers/webgl-fallback/utils/WebGLTextureUtils.js:1121 — WebGLTextureUtils.copyFramebufferToTexture has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, 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 · WebGLTextureUtils._getBytesPerTexel (cognitive 17) · ×1
  • WebGLTextureUtils._getBytesPerTexel (cognitive 17) src/renderers/webgl-fallback/utils/WebGLTextureUtils.js:1395 — WebGLTextureUtils._getBytesPerTexel has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, boolean chains 8. 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 · WebGLClipping.WebGLClipping (cognitive 17) · ×1
  • WebGLClipping.WebGLClipping (cognitive 17) src/renderers/webgl/WebGLClipping.js:4 — WebGLClipping.WebGLClipping has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 6, loops 1 (3 pts), ternaries 1 (nesting depth added 5). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to 4 function items inside it that branch (projectPlanes, resetGlobalState, a function literal at line 22, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · Guide.setupTOC (cognitive 17) · ×1
  • Guide.setupTOC (cognitive 17) REDACTED:1965 — Guide.setupTOC has cognitive complexity 17 (threshold 15). Drivers by points: if/else 20 (35 pts), boolean chains 4, loops 1 (2 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. This shape REPEATS in the file: one other method here (Guide.setupTOC::createTOCNode) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · changelog.categorizeFile (cognitive 17) · ×1
  • changelog.categorizeFile (cognitive 17) utils/changelog.js:173 — changelog.categorizeFile has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 1 (3 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 · changelog.generateChangelog (cognitive 17) · ×1
  • changelog.generateChangelog (cognitive 17) utils/changelog.js:654 — changelog.generateChangelog has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, loops 2 (nesting depth added 3). Of this number, 15 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · onKeyPress (cognitive 17) · ×1
  • onKeyPress (cognitive 17) editor/js/libs/codemirror/codemirror.js:7288 — onKeyPress has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, if/else 6, ternaries 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 · parseExprOp (cognitive 17) · ×1
  • parseExprOp (cognitive 17) editor/js/libs/acorn/acorn-loose.js:841 — parseExprOp has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 6, ternaries 1 (3 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 · parsePath (cognitive 17) · ×1
  • parsePath (cognitive 17) editor/js/libs/ternjs/def.js:360 — parsePath has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 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 · renderObject (cognitive 17) · ×1
  • renderObject (cognitive 17) devtools/panel/panel.js:443 — renderObject has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 3, ternaries 2, loops 1, other 1 (nesting depth added 1). Of this number, 15 points are the body's own statements and 2 belong to 9 function literals inside it that branch. 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 · renderObjectDetails (cognitive 17) · ×1
  • renderObjectDetails (cognitive 17) devtools/panel/panel.js:578 — renderObjectDetails has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 3 (5 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 · highlight.draw (cognitive 16) · ×1
  • highlight.draw (cognitive 16) devtools/highlight.js:284 — highlight.draw has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (5 pts), ternaries 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · preview.drawTriangles (cognitive 16) · ×1
  • preview.drawTriangles (cognitive 16) devtools/preview.js:180 — preview.drawTriangles has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (6 pts), loops 4 (6 pts), boolean chains 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 · Sidebar.Geometry.BufferGeometry.SidebarGeometryBufferGeometry · ×1
  • Sidebar.Geometry.BufferGeometry.SidebarGeometryBufferGeometry::update (cognitive 16) editor/js/Sidebar.Geometry.BufferGeometry.js:11 — Sidebar.Geometry.BufferGeometry.SidebarGeometryBufferGeometry::update has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (5 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 · Menubar.View.MenubarView (cognitive 16) · ×1
  • Menubar.View.MenubarView (cognitive 16) editor/js/Menubar.View.js:3 — Menubar.View.MenubarView has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (16 pts) (nesting depth added 6). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 106, 144, 161). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · acorn.pp$3.parseFunctionBody (cognitive 16) · ×1
  • acorn.pp$3.parseFunctionBody (cognitive 16) editor/js/libs/acorn/acorn.js:2644 — acorn.pp$3.parseFunctionBody has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 6 (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 · acorn.pp$8.regexp_eatAssertion (cognitive 16) · ×1
  • acorn.pp$8.regexp_eatAssertion (cognitive 16) editor/js/libs/acorn/acorn.js:3374 — acorn.pp$8.regexp_eatAssertion has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4 (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 · acorn.pp$9.getTokenFromCode (cognitive 16) · ×1
  • acorn.pp$9.getTokenFromCode (cognitive 16) editor/js/libs/acorn/acorn.js:4489 — acorn.pp$9.getTokenFromCode has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 3, match/switch 1 (nesting depth added 7). 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 · codemirror.updateDoc (cognitive 16) · ×1
  • codemirror.updateDoc (cognitive 16) editor/js/libs/codemirror/codemirror.js:4756 — codemirror.updateDoc has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 1, ternaries 1 (nesting depth added 4). Of this number, 14 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tern.ensureFile (cognitive 16) · ×1
  • tern.ensureFile (cognitive 16) editor/js/libs/ternjs/tern.js:297 — tern.ensureFile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2 (nesting depth added 6). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · prettify.extractSourceSpans · ×1
  • prettify.extractSourceSpans::walk (cognitive 16) REDACTED:536 — prettify.extractSourceSpans::walk 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). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · ImageUtils.sRGBToLinear (cognitive 16) · ×1
  • ImageUtils.sRGBToLinear (cognitive 16) src/extras/ImageUtils.js:73 — ImageUtils.sRGBToLinear has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 5, loops 2 (4 pts) (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 · TextureSource.toJSON (cognitive 16) · ×1
  • TextureSource.toJSON (cognitive 16) src/textures/TextureSource.js:131 — TextureSource.toJSON has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ShaderMaterial.fromJSON (cognitive 16) · ×1
  • ShaderMaterial.fromJSON (cognitive 16) src/materials/ShaderMaterial.js:415 — ShaderMaterial.fromJSON has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, loops 2 (4 pts), match/switch 1 (3 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 · AnimationUtils.subclip (cognitive 16) · ×1
  • AnimationUtils.subclip (cognitive 16) src/animation/AnimationUtils.js:183 — AnimationUtils.subclip has cognitive complexity 16 (threshold 15). Drivers by points: loops 5 (8 pts), if/else 3 (7 pts), boolean chains 1 (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 · CubeCamera.update (cognitive 16) · ×1
  • CubeCamera.update (cognitive 16) src/cameras/CubeCamera.js:178 — CubeCamera.update has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 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 · AnimationAction._updateTimeScale (cognitive 16) · ×1
  • AnimationAction._updateTimeScale (cognitive 16) src/animation/AnimationAction.js:675 — AnimationAction._updateTimeScale has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (16 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DataUtils._generateTables (cognitive 16) · ×1
  • DataUtils._generateTables (cognitive 16) src/extras/DataUtils.js:8 — DataUtils._generateTables has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 7 (8 pts) (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 · Node.deserialize (cognitive 16) · ×1
  • Node.deserialize (cognitive 16) src/nodes/core/Node.js:1382 — Node.deserialize has cognitive complexity 16 (threshold 15). Drivers by points: loops 3 (10 pts), if/else 4 (6 pts) (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 · NormalMapNode.setup (cognitive 16) · ×1
  • NormalMapNode.setup (cognitive 16) src/nodes/display/NormalMapNode.js:72 — NormalMapNode.setup has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (16 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 · LightsNode.customCacheKey (cognitive 16) · ×1
  • LightsNode.customCacheKey (cognitive 16) src/nodes/lighting/LightsNode.js:153 — LightsNode.customCacheKey has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (11 pts), if/else 2 (4 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 · Renderer._bundleNeedsUpdate (cognitive 16) · ×1
  • Renderer._bundleNeedsUpdate (cognitive 16) src/renderers/common/Renderer.js:1673 — Renderer._bundleNeedsUpdate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (5 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 · WebGLAttributeUtils.createAttribute (cognitive 16) · ×1
  • WebGLAttributeUtils.createAttribute (cognitive 16) src/renderers/webgl-fallback/utils/WebGLAttributeUtils.js:79 — WebGLAttributeUtils.createAttribute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 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 · transposeChars (cognitive 16) · ×1
  • transposeChars (cognitive 16) editor/js/libs/codemirror/codemirror.js:7087 — transposeChars has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 1 (nesting depth added 9). None of this is in the body itself: all 16 points belong to one function literal inside it that branches (line 7087). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · Parser (cognitive 16) · ×1
  • Parser (cognitive 16) editor/js/libs/acorn/acorn.js:468 — Parser has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 3, boolean chains 2, loops 1 (2 pts) (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 · parseTryStatement (cognitive 16) · ×1
  • parseTryStatement (cognitive 16) editor/js/libs/acorn/acorn.js:1062 — parseTryStatement has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 3 (7 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 · toString (cognitive 16) · ×1
  • toString (cognitive 16) editor/js/libs/ternjs/infer.js:775 — toString has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 1 (3 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 · (anonymous) (cognitive 16) · ×1
  • (anonymous) (cognitive 16) editor/js/libs/ternjs/infer.js:1554 — (anonymous) has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 6, loops 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 · compute (cognitive 16) · ×1
  • compute (cognitive 16) src/renderers/webgl-fallback/WebGLBackend.js:1013 — compute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), loops 5, boolean chains 3, ternaries 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 · findExprType (cognitive 16) · ×1
  • findExprType (cognitive 16) editor/js/libs/ternjs/tern.js:894 — findExprType has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, loops 1 (2 pts) (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 · startRenameTab (cognitive 16) · ×1
  • startRenameTab (cognitive 16) tsl/js/managers/PlaygroundManager.js:773 — startRenameTab has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4 (nesting depth added 3). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 7 function items inside it that branch (finishRename, onkeydown, a function literal at line 797, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · ShaderNodeProxy (cognitive 16) · ×1
  • ShaderNodeProxy (cognitive 16) src/nodes/tsl/TSLCore.js:356 — ShaderNodeProxy has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 2). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 7 function items inside it that branch (verifyParamsLimit, assignNode, setParameterLength, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · earcutLinked (cognitive 16) · ×1
  • earcutLinked (cognitive 16) src/extras/lib/earcut.js:87 — earcutLinked has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · addHelper (cognitive 16) · ×1
  • addHelper (cognitive 16) editor/js/Editor.js:393 — addHelper has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 4). None of this is in the body itself: all 16 points belong to 2 function items inside it that branch (a function literal at line 398, (anonymous)::updateMatrixWorld). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · updateBinding (cognitive 16) · ×1
  • updateBinding (cognitive 16) src/renderers/webgpu/utils/WebGPUBindingUtils.js:193 — updateBinding has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 2 (5 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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Medium CVE · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
IC1 · Incompleteness & stubs · Fake-async · ×1
  • Fake-async — async method never awaits tsl/js/managers/PlaygroundManager.js:897 — `cleanAndFormatActiveTab` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×1
  • Sync-over-async blocking editor/js/Loader.js:974 — `unzipSync` in `handleZIP` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
R1 · Type Safety · Type Safety · ×1
  • Type Safety — 0 typed · 1215 plain JS — the untyped files are devtools/background.js, devtools/bridge.js, devtools/constants.js, devtools/content-script.js, devtools/devtools.js, devtools/highlight.js (+1209 more).
R10 · Code Duplication · Forked directory tree (9 identical files, ~4155 lines × 2 trees) · ×1
  • Forked directory tree (9 identical files, ~4155 lines × 2 trees) docs/scripts/highlight.min.js:1 — docs/ and utils/docs/template/static/ are near-verbatim copies of each other: 9 files are byte-identical under the same relative paths (~4155 lines; the trees hold 1688 and 10 files). That is one structural fact, not 9 local ones: every edit made to one tree and not the other drifts silently, which is the failure whole-tree forks guarantee. Pick one tree as the single source and produce the other from it (generated, copied at build or release time, or re-exported) — or, if the copy is a stale snapshot nothing produces any more, delete it. Check first whether the copy is a deliberately published deliverable (a template consumers copy verbatim, a released sample frozen at a version); where it is, keep it produced from the source tree rather than edited in place.
R10 · Code Duplication · Duplication concentrated across 14 sibling directories (61 clone groups) · ×1
  • Duplication concentrated across 14 sibling directories (61 clone groups) src/extras/PMREMGenerator.js:22 — 61 duplicated blocks under src/ have copies in at least two of the sibling directories audio, cameras, core, extras, geometries, helpers (+8 more sibling(s) not listed) — 25 of them are reported below, and 36 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 61 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 61 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 61 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 5 sibling directories (44 clone groups) · ×1
  • Duplication concentrated across 5 sibling directories (44 clone groups) src/renderers/webgl-fallback/utils/WebGLUtils.js:55 — 44 duplicated blocks under src/renderers/ have copies in at least two of the sibling directories common, webgl, webgl-fallback, webgpu, webxr — 36 of them are reported below, and 8 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 44 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 44 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 44 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 10 sibling directories (22 clone groups) · ×1
  • Duplication concentrated across 10 sibling directories (22 clone groups) src/nodes/core/StackNode.js:32 — 22 duplicated blocks under src/nodes/ have copies in at least two of the sibling directories accessors, code, core, display, functions, gpgpu (+4 more sibling(s) not listed) — 4 of them are reported below, and 18 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 22 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 22 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 22 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 6 sibling directories (19 clone groups) · ×1
  • Duplication concentrated across 6 sibling directories (19 clone groups) devtools/panel/panel.js:197 — 19 duplicated blocks under the repository root have copies in at least two of the sibling directories devtools, editor, manual, src, tsl, utils — 8 of them are reported below, and 11 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 19 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 19 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 19 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplicated block with local edits (197 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (197 matched lines × 2 locations) src/extras/PMREMGenerator.js:22 — src/extras/PMREMGenerator.js:22 · src/renderers/common/extras/PMREMGenerator.js:33 — the two spans are one implementation copied and then locally edited — 1488 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (120 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (120 matched lines × 2 locations) src/renderers/WebGLRenderer.js:3373 — src/renderers/WebGLRenderer.js:3373 · src/renderers/webgl-fallback/utils/WebGLTextureUtils.js:867 — the two spans are one implementation copied and then locally edited — 1159 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (118 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (118 matched lines × 2 locations) src/renderers/webgl-fallback/utils/WebGLUtils.js:55 — src/renderers/webgl-fallback/utils/WebGLUtils.js:55 · src/renderers/webgl/WebGLUtils.js:8 — the two spans are one implementation copied and then locally edited — 1199 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (100 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (100 matched lines × 2 locations) src/core/BufferAttribute.js:312 — src/core/BufferAttribute.js:312 · src/core/InterleavedBufferAttribute.js:125 — the two spans are one implementation copied and then locally edited — 732 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (99 lines × 2 locations) · ×1
  • Duplicated block (99 lines × 2 locations) editor/js/libs/ui.js:533 — editor/js/libs/ui.js:533 · editor/js/libs/ui.js:754 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (80 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (80 matched lines × 2 locations) src/renderers/common/XRManager.js:1676 — src/renderers/common/XRManager.js:1676 · src/renderers/webxr/WebXRManager.js:570 — the two spans are one implementation copied and then locally edited — 564 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Wholesale file copy (76 identical lines × 2 files) · ×1
  • Wholesale file copy (76 identical lines × 2 files) tsl/js/imports/scripts/scenes/empty.js:1 — tsl/js/imports/scripts/scenes/empty.js:1 · tsl/js/imports/scripts/scenes/plane.js:1 — these 2 files are line-for-line copies of one another — 76 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication · Duplicated block with local edits (70 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (70 matched lines × 2 locations) src/nodes/accessors/ReferenceBaseNode.js:17 — src/nodes/accessors/ReferenceBaseNode.js:17 · src/nodes/accessors/ReferenceNode.js:22 — the two spans are one implementation copied and then locally edited — 424 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (65 lines × 2 locations) · ×1
  • Duplicated block (65 lines × 2 locations) src/materials/nodes/MeshPhongNodeMaterial.js:30 — src/materials/nodes/MeshPhongNodeMaterial.js:30 · src/materials/nodes/MeshStandardNodeMaterial.js:32 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R10 · Code Duplication · Wholesale file copy (64 identical lines × 3 files) · ×1
  • Wholesale file copy (64 identical lines × 3 files) src/materials/MeshLambertMaterial.js:1 — src/materials/MeshLambertMaterial.js:1 · src/materials/MeshPhongMaterial.js:1 · src/materials/MeshStandardMaterial.js:2 — these 3 files are line-for-line copies of one another — 64 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication · Duplicated block (64 lines × 2 locations) · ×1
  • Duplicated block (64 lines × 2 locations) src/renderers/common/XRManager.js:909 — src/renderers/common/XRManager.js:909 · src/renderers/common/XRManager.js:1004 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block with local edits (62 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (62 matched lines × 2 locations) src/math/Plane.js:21 — src/math/Plane.js:21 · src/math/Sphere.js:20 — the two spans are one implementation copied and then locally edited — 281 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (53 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (53 matched lines × 2 locations) editor/js/Loader.js:238 — editor/js/Loader.js:238 · editor/js/Loader.js:560 — the two spans are one implementation copied and then locally edited — 297 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (51 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (51 matched lines × 2 locations) src/cameras/OrthographicCamera.js:112 — src/cameras/OrthographicCamera.js:112 · src/cameras/PerspectiveCamera.js:129 — the two spans are one implementation copied and then locally edited — 348 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (51 lines × 2 locations) · ×1
  • Duplicated block (51 lines × 2 locations) src/math/Vector3.js:230 — src/math/Vector3.js:230 · src/math/Vector4.js:291 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (50 lines × 2 locations) · ×1
  • Duplicated block (50 lines × 2 locations) src/math/Euler.js:49 — src/math/Euler.js:49 · src/math/Quaternion.js:161 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (46 lines × 2 locations) · ×1
  • Duplicated block (46 lines × 2 locations) src/extras/curves/LineCurve.js:9 — src/extras/curves/LineCurve.js:9 · src/extras/curves/LineCurve3.js:9 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R10 · Code Duplication · Duplicated block with local edits (45 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (45 matched lines × 2 locations) editor/js/Sidebar.Scene.js:175 — editor/js/Sidebar.Scene.js:175 · editor/js/Sidebar.Scene.js:278 — the two spans are one implementation copied and then locally edited — 372 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (42 lines × 3 locations) · ×1
  • Duplicated block (42 lines × 3 locations) editor/js/commands/SetPositionCommand.js:4 — editor/js/commands/SetPositionCommand.js:4 · editor/js/commands/SetRotationCommand.js:4 · editor/js/commands/SetScaleCommand.js:4 — the 3 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete.
R10 · Code Duplication · Duplicated block (41 lines × 2 locations) · ×1
  • Duplicated block (41 lines × 2 locations) editor/js/commands/SetMaterialColorCommand.js:3 — editor/js/commands/SetMaterialColorCommand.js:3 · editor/js/commands/SetMaterialVectorCommand.js:3 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (41 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (41 matched lines × 2 locations) src/renderers/webgl-fallback/utils/WebGLAttributeUtils.js:91 — src/renderers/webgl-fallback/utils/WebGLAttributeUtils.js:91 · src/renderers/webgl/WebGLAttributes.js:16 — the two spans are one implementation copied and then locally edited — 285 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (40 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (40 matched lines × 2 locations) src/renderers/WebGLCubeRenderTarget.js:15 — src/renderers/WebGLCubeRenderTarget.js:15 · src/renderers/common/CubeRenderTarget.js:20 — the two spans are one implementation copied and then locally edited — 322 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (39 lines × 5 locations) · ×1
  • Duplicated block (39 lines × 5 locations) src/nodes/accessors/Camera.js:85 — src/nodes/accessors/Camera.js:85 · src/nodes/accessors/Camera.js:131 · src/nodes/accessors/Camera.js:177 · src/nodes/accessors/Camera.js:223 · +1 more site(s) not listed — all 5 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.
R10 · Code Duplication · Duplicated block (37 lines × 2 locations) · ×1
  • Duplicated block (37 lines × 2 locations) src/renderers/webgpu/nodes/WGSLNodeBuilder.js:426 — src/renderers/webgpu/nodes/WGSLNodeBuilder.js:426 · src/renderers/webgpu/nodes/WGSLNodeBuilder.js:1114 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (36 lines × 2 locations) · ×1
  • Duplicated block (36 lines × 2 locations) editor/js/commands/MultiCmdsCommand.js:19 — editor/js/commands/MultiCmdsCommand.js:19 · editor/js/commands/SetSceneCommand.js:38 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R2 · Cyclomatic Complexity · Complex function WebGLProgram (cyclomatic 177, cognitive 338) · ×1
  • Complex function WebGLProgram (cyclomatic 177, cognitive 338) src/renderers/webgl/WebGLProgram.js:372 — WebGLProgram has cyclomatic complexity 177 and cognitive complexity 338; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function fromJSON (cyclomatic 164, cognitive 166) · ×1
  • Complex function fromJSON (cyclomatic 164, cognitive 166) src/materials/Material.js:920 — fromJSON has cyclomatic complexity 164 and cognitive complexity 166; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function parseBlock (cyclomatic 161, cognitive 20) · ×1
  • Complex function parseBlock (cyclomatic 161, cognitive 20) examples/jsm/loaders/lwo/LWO2Parser.js:9 — parseBlock has cyclomatic complexity 161 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function parseBlock (cyclomatic 145, cognitive 19) · ×1
  • Complex function parseBlock (cyclomatic 145, cognitive 19) examples/jsm/loaders/lwo/LWO3Parser.js:9 — parseBlock has cyclomatic complexity 145 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function setProgram (cyclomatic 129, cognitive 149) · ×1
  • Complex function setProgram (cyclomatic 129, cognitive 149) src/renderers/WebGLRenderer.js:2397 — setProgram has cyclomatic complexity 129 and cognitive complexity 149; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function toJSON (cyclomatic 116, cognitive 118) · ×1
  • Complex function toJSON (cyclomatic 116, cognitive 118) src/materials/Material.js:610 — toJSON has cyclomatic complexity 116 and cognitive complexity 118; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function getFormat (cyclomatic 115, cognitive 138) · ×1
  • Complex function getFormat (cyclomatic 115, cognitive 138) src/renderers/webgpu/utils/WebGPUTextureUtils.js:1481 — getFormat has cyclomatic complexity 115 and cognitive complexity 138; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function getParameters (cyclomatic 100, cognitive 94) · ×1
  • Complex function getParameters (cyclomatic 100, cognitive 94) src/renderers/webgl/WebGLPrograms.js:54 — getParameters has cyclomatic complexity 100 and cognitive complexity 94; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function _drawBatches (cyclomatic 97, cognitive 171) · ×1
  • Complex function _drawBatches (cyclomatic 97, cognitive 171) examples/jsm/pipelines/MeshletDrawingPipeline.js:4310 — _drawBatches has cyclomatic complexity 97 and cognitive complexity 171; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function parseObject (cyclomatic 94, cognitive 127) · ×1
  • Complex function parseObject (cyclomatic 94, cognitive 127) src/loaders/ObjectLoader.js:784 — parseObject has cyclomatic complexity 94 and cognitive complexity 127; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function getInternalFormat (cyclomatic 93, cognitive 156) · ×1
  • Complex function getInternalFormat (cyclomatic 93, cognitive 156) src/renderers/webgl-fallback/utils/WebGLTextureUtils.js:165 — getInternalFormat has cyclomatic complexity 93 and cognitive complexity 156; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function toRGBA8 (cyclomatic 82, cognitive 196) · ×1
  • Complex function toRGBA8 (cyclomatic 82, cognitive 196) examples/jsm/libs/utif.module.js:1300 — toRGBA8 has cyclomatic complexity 82 and cognitive complexity 196; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function _buildGeometryWithSubsets (cyclomatic 80, cognitive 107) · ×1
  • Complex function _buildGeometryWithSubsets (cyclomatic 80, cognitive 107) examples/jsm/loaders/usd/USDComposer.js:1922 — _buildGeometryWithSubsets has cyclomatic complexity 80 and cognitive complexity 107; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function getCallDetail (cyclomatic 80, cognitive 80) · ×1
  • Complex function getCallDetail (cyclomatic 80, cognitive 80) examples/jsm/inspector/tabs/Timeline.js:918 — getCallDetail has cyclomatic complexity 80 and cognitive complexity 80; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function uploadTexture (cyclomatic 79, cognitive 315) · ×1
  • Complex function uploadTexture (cyclomatic 79, cognitive 315) src/renderers/webgl/WebGLTextures.js:962 — uploadTexture has cyclomatic complexity 79 and cognitive complexity 315; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function equals (cyclomatic 76, cognitive 123) · ×1
  • Complex function equals (cyclomatic 76, cognitive 123) src/materials/nodes/manager/NodeMaterialObserver.js:587 — equals has cyclomatic complexity 76 and cognitive complexity 123; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function getInternalFormat (cyclomatic 74, cognitive 119) · ×1
  • Complex function getInternalFormat (cyclomatic 74, cognitive 119) src/renderers/webgl/WebGLTextures.js:132 — getInternalFormat has cyclomatic complexity 74 and cognitive complexity 119; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function load (cyclomatic 73, cognitive 85) · ×1
  • Complex function load (cyclomatic 73, cognitive 85) examples/jsm/inspector/extensions/color-grading/ColorGrading.js:1898 — load has cyclomatic complexity 73 and cognitive complexity 85; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function parse (cyclomatic 67, cognitive 95) · ×1
  • Complex function parse (cyclomatic 67, cognitive 95) examples/jsm/libs/utif.module.js:12 — parse has cyclomatic complexity 67 and cognitive complexity 95; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function parseStatement (cyclomatic 67, cognitive 94) · ×1
  • Complex function parseStatement (cyclomatic 67, cognitive 94) editor/js/libs/acorn/acorn-loose.js:304 — parseStatement has cyclomatic complexity 67 and cognitive complexity 94; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function _readScalarValue (cyclomatic 67, cognitive 54) · ×1
  • Complex function _readScalarValue (cyclomatic 67, cognitive 54) examples/jsm/loaders/usd/USDCParser.js:1301 — _readScalarValue has cyclomatic complexity 67 and cognitive complexity 54; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function updateMatrixWorld (cyclomatic 65, cognitive 146) · ×1
  • Complex function updateMatrixWorld (cyclomatic 65, cognitive 146) examples/jsm/controls/TransformControls.js:1587 — updateMatrixWorld has cyclomatic complexity 65 and cognitive complexity 146; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function _readIFD (cyclomatic 65, cognitive 145) · ×1
  • Complex function _readIFD (cyclomatic 65, cognitive 145) examples/jsm/libs/utif.module.js:1175 — _readIFD has cyclomatic complexity 65 and cognitive complexity 145; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function setup (cyclomatic 65, cognitive 110) · ×1
  • Complex function setup (cyclomatic 65, cognitive 110) src/nodes/accessors/MaterialNode.js:120 — setup has cyclomatic complexity 65 and cognitive complexity 110; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function processMeshAsync (cyclomatic 64, cognitive 140) · ×1
  • Complex function processMeshAsync (cyclomatic 64, cognitive 140) examples/jsm/exporters/GLTFExporter.js:1848 — processMeshAsync has cyclomatic complexity 64 and cognitive complexity 140; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 63, cognitive 113) · ×1
  • Complex function (anonymous) (cyclomatic 63, cognitive 113) editor/js/libs/codemirror/codemirror.js:393 — (anonymous) has cyclomatic complexity 63 and cognitive complexity 113; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function run (cyclomatic 60, cognitive 130) · ×1
  • Complex function run (cyclomatic 60, cognitive 130) REDACTED:897 — run has cyclomatic complexity 60 and cognitive complexity 130; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function parse (cyclomatic 58, cognitive 139) · ×1
  • Complex function parse (cyclomatic 58, cognitive 139) examples/jsm/loaders/OBJLoader.js:543 — parse has cyclomatic complexity 58 and cognitive complexity 139; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function generateTangentSpaces (cyclomatic 58, cognitive 116) · ×1
  • Complex function generateTangentSpaces (cyclomatic 58, cognitive 116) examples/jsm/libs/mikktspace.module.js:432 — generateTangentSpaces has cyclomatic complexity 58 and cognitive complexity 116; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function av (cyclomatic 57, cognitive 206) · ×1
  • Complex function av (cyclomatic 57, cognitive 206) examples/jsm/libs/utif.module.js:460 — av has cyclomatic complexity 57 and cognitive complexity 206; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function setupDecoder (cyclomatic 57, cognitive 58) · ×1
  • Complex function setupDecoder (cyclomatic 57, cognitive 58) examples/jsm/loaders/EXRLoader.js:2891 — setupDecoder has cyclomatic complexity 57 and cognitive complexity 58; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function insertLineContent (cyclomatic 56, cognitive 147) · ×1
  • Complex function insertLineContent (cyclomatic 56, cognitive 147) editor/js/libs/codemirror/codemirror.js:1921 — insertLineContent has cyclomatic complexity 56 and cognitive complexity 147; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function pointerMove (cyclomatic 56, cognitive 110) · ×1
  • Complex function pointerMove (cyclomatic 56, cognitive 110) examples/jsm/controls/TransformControls.js:516 — pointerMove has cyclomatic complexity 56 and cognitive complexity 110; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function parsePathNode (cyclomatic 56, cognitive 96) · ×1
  • Complex function parsePathNode (cyclomatic 56, cognitive 96) examples/jsm/loaders/SVGLoader.js:300 — parsePathNode has cyclomatic complexity 56 and cognitive complexity 96; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function _decodeOldJPEGInit (cyclomatic 54, cognitive 117) · ×1
  • Complex function _decodeOldJPEGInit (cyclomatic 54, cognitive 117) examples/jsm/libs/utif.module.js:764 — _decodeOldJPEGInit has cyclomatic complexity 54 and cognitive complexity 117; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function update (cyclomatic 54, cognitive 103) · ×1
  • Complex function update (cyclomatic 54, cognitive 103) examples/jsm/inspector/tabs/Viewer.js:956 — update has cyclomatic complexity 54 and cognitive complexity 103; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function applyColorTransform (cyclomatic 54, cognitive 102) · ×1
  • Complex function applyColorTransform (cyclomatic 54, cognitive 102) examples/jsm/inspector/extensions/color-grading/LUTMath.js:180 — applyColorTransform has cyclomatic complexity 54 and cognitive complexity 102; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function emitExpression (cyclomatic 54, cognitive 79) · ×1
  • Complex function emitExpression (cyclomatic 54, cognitive 79) examples/jsm/transpiler/TSLEncoder.js:130 — emitExpression has cyclomatic complexity 54 and cognitive complexity 79; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files · editor/js/libs/codemirror/codemirror.js · ×1
  • editor/js/libs/codemirror/codemirror.js: 8884 lines of code editor/js/libs/codemirror/codemirror.js:1 — editor/js/libs/codemirror/codemirror.js has 8884 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · editor/js/libs/acorn/acorn.js · ×1
  • editor/js/libs/acorn/acorn.js: 4396 lines of code editor/js/libs/acorn/acorn.js:1 — editor/js/libs/acorn/acorn.js has 4396 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/renderers/common/Renderer.js · ×1
  • src/renderers/common/Renderer.js: 2978 lines of code src/renderers/common/Renderer.js:1 — src/renderers/common/Renderer.js has 2978 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/nodes/core/NodeBuilder.js · ×1
  • src/nodes/core/NodeBuilder.js: 2698 lines of code src/nodes/core/NodeBuilder.js:1 — src/nodes/core/NodeBuilder.js has 2698 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/renderers/WebGLRenderer.js · ×1
  • src/renderers/WebGLRenderer.js: 2472 lines of code src/renderers/WebGLRenderer.js:1 — src/renderers/WebGLRenderer.js has 2472 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · editor/js/Strings.js · ×1
  • editor/js/Strings.js: 2423 lines of code editor/js/Strings.js:1 — editor/js/Strings.js has 2423 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/renderers/webgpu/WebGPUBackend.js · ×1
  • src/renderers/webgpu/WebGPUBackend.js: 2369 lines of code src/renderers/webgpu/WebGPUBackend.js:1 — src/renderers/webgpu/WebGPUBackend.js has 2369 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · editor/js/libs/ternjs/infer.js · ×1
  • editor/js/libs/ternjs/infer.js: 2069 lines of code editor/js/libs/ternjs/infer.js:1 — editor/js/libs/ternjs/infer.js has 2069 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/renderers/webgpu/nodes/WGSLNodeBuilder.js · ×1
  • src/renderers/webgpu/nodes/WGSLNodeBuilder.js: 1939 lines of code src/renderers/webgpu/nodes/WGSLNodeBuilder.js:1 — src/renderers/webgpu/nodes/WGSLNodeBuilder.js has 1939 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/renderers/webgl-fallback/WebGLBackend.js · ×1
  • src/renderers/webgl-fallback/WebGLBackend.js: 1914 lines of code src/renderers/webgl-fallback/WebGLBackend.js:1 — src/renderers/webgl-fallback/WebGLBackend.js has 1914 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 1670 lines of code REDACTED:1 — REDACTED has 1670 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 1598 lines of code REDACTED:1 — REDACTED has 1598 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/renderers/webgl/WebGLTextures.js · ×1
  • src/renderers/webgl/WebGLTextures.js: 1442 lines of code src/renderers/webgl/WebGLTextures.js:1 — src/renderers/webgl/WebGLTextures.js has 1442 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/renderers/common/XRManager.js · ×1
  • src/renderers/common/XRManager.js: 1408 lines of code src/renderers/common/XRManager.js:1 — src/renderers/common/XRManager.js has 1408 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js · ×1
  • src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js: 1338 lines of code src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js:1 — src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js has 1338 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/renderers/webgpu/utils/WebGPUTextureUtils.js · ×1
  • src/renderers/webgpu/utils/WebGPUTextureUtils.js: 1320 lines of code src/renderers/webgpu/utils/WebGPUTextureUtils.js:1 — src/renderers/webgpu/utils/WebGPUTextureUtils.js has 1320 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/objects/BatchedMesh.js · ×1
  • src/objects/BatchedMesh.js: 1267 lines of code src/objects/BatchedMesh.js:1 — src/objects/BatchedMesh.js has 1267 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/core/Object3D.js · ×1
  • src/core/Object3D.js: 1252 lines of code src/core/Object3D.js:1 — src/core/Object3D.js has 1252 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · editor/js/libs/acorn/acorn-loose.js · ×1
  • editor/js/libs/acorn/acorn-loose.js: 1242 lines of code editor/js/libs/acorn/acorn-loose.js:1 — editor/js/libs/acorn/acorn-loose.js has 1242 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · editor/js/libs/ternjs/tern.js · ×1
  • editor/js/libs/ternjs/tern.js: 1060 lines of code editor/js/libs/ternjs/tern.js:1 — editor/js/libs/ternjs/tern.js has 1060 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/renderers/webgl-fallback/utils/WebGLState.js · ×1
  • src/renderers/webgl-fallback/utils/WebGLState.js: 1045 lines of code src/renderers/webgl-fallback/utils/WebGLState.js:1 — src/renderers/webgl-fallback/utils/WebGLState.js has 1045 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/nodes/materialx/MaterialXNoise.js · ×1
  • src/nodes/materialx/MaterialXNoise.js: 1042 lines of code src/nodes/materialx/MaterialXNoise.js:1 — src/nodes/materialx/MaterialXNoise.js has 1042 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/nodes/core/Node.js · ×1
  • src/nodes/core/Node.js: 1038 lines of code src/nodes/core/Node.js:1 — src/nodes/core/Node.js has 1038 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/nodes/math/MathNode.js · ×1
  • src/nodes/math/MathNode.js: 1038 lines of code src/nodes/math/MathNode.js:1 — src/nodes/math/MathNode.js has 1038 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/core/BufferGeometry.js · ×1
  • src/core/BufferGeometry.js: 988 lines of code src/core/BufferGeometry.js:1 — src/core/BufferGeometry.js has 988 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/math/Matrix4.js · ×1
  • src/math/Matrix4.js: 987 lines of code src/math/Matrix4.js:1 — src/math/Matrix4.js has 987 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/materials/nodes/NodeMaterial.js · ×1
  • src/materials/nodes/NodeMaterial.js: 977 lines of code src/materials/nodes/NodeMaterial.js:1 — src/materials/nodes/NodeMaterial.js has 977 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/materials/Material.js · ×1
  • src/materials/Material.js: 972 lines of code src/materials/Material.js:1 — src/materials/Material.js has 972 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/math/Vector3.js · ×1
  • src/math/Vector3.js: 955 lines of code src/math/Vector3.js:1 — src/math/Vector3.js has 955 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · tsl/js/utils/MarkdownUtils.js · ×1
  • tsl/js/utils/MarkdownUtils.js: 938 lines of code tsl/js/utils/MarkdownUtils.js:1 — tsl/js/utils/MarkdownUtils.js has 938 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · manual/resources/threejs-primitives.js · ×1
  • manual/resources/threejs-primitives.js: 930 lines of code manual/resources/threejs-primitives.js:1 — manual/resources/threejs-primitives.js has 930 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/renderers/webgl-fallback/utils/WebGLTextureUtils.js · ×1
  • src/renderers/webgl-fallback/utils/WebGLTextureUtils.js: 929 lines of code src/renderers/webgl-fallback/utils/WebGLTextureUtils.js:1 — src/renderers/webgl-fallback/utils/WebGLTextureUtils.js has 929 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/nodes/display/PassNode.js · ×1
  • src/nodes/display/PassNode.js: 859 lines of code src/nodes/display/PassNode.js:1 — src/nodes/display/PassNode.js has 859 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/renderers/webgl/WebGLState.js · ×1
  • src/renderers/webgl/WebGLState.js: 810 lines of code src/renderers/webgl/WebGLState.js:1 — src/renderers/webgl/WebGLState.js has 810 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · tsl/js/managers/PlaygroundManager.js · ×1
  • tsl/js/managers/PlaygroundManager.js: 804 lines of code tsl/js/managers/PlaygroundManager.js:1 — tsl/js/managers/PlaygroundManager.js has 804 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/loaders/ObjectLoader.js · ×1
  • src/loaders/ObjectLoader.js: 799 lines of code src/loaders/ObjectLoader.js:1 — src/loaders/ObjectLoader.js has 799 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/nodes/accessors/TextureNode.js · ×1
  • src/nodes/accessors/TextureNode.js: 799 lines of code src/nodes/accessors/TextureNode.js:1 — src/nodes/accessors/TextureNode.js has 799 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/math/Vector4.js · ×1
  • src/math/Vector4.js: 797 lines of code src/math/Vector4.js:1 — src/math/Vector4.js has 797 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/nodes/tsl/TSLCore.js · ×1
  • src/nodes/tsl/TSLCore.js: 774 lines of code src/nodes/tsl/TSLCore.js:1 — src/nodes/tsl/TSLCore.js has 774 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · src/renderers/common/Backend.js · ×1
  • src/renderers/common/Backend.js: 752 lines of code src/renderers/common/Backend.js:1 — src/renderers/common/Backend.js has 752 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R6 · Tooling · No typecheck script · ×1
  • No typecheck script — test ✓ · lint ✓ · typecheck ✗ — read from this repository's package.json scripts and corroborated against its CI workflows. A script counts when its name or command matches the step: `test` for the suite, `lint` or `prettier` for linting, `typecheck`/`type-check`/`tsc` for type checking. ✗ therefore means no script or CI step under those names was found, NOT that the step is absent from your pipeline — a task invoked by a runner this check does not read, or named something else entirely, is not seen and is worth confirming before acting on a cross. A ✓ means the wiring is DECLARED — a script or CI step under those names exists. It is not a statement that the step passes, or that it runs at all: nothing here installs a dependency or executes a suite.
R7 · Dead Code · Dead file (~341 LoC) · ×1
  • Dead file (~341 LoC) utils/generateDFGLUT.js — no import path from any entry point (1582 application, 4 tooling, 295 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~306 LoC) · ×1
  • Dead file (~306 LoC) utils/packLDrawModel.mjs — no import path from any entry point (1582 application, 4 tooling, 295 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~201 LoC) · ×1
  • Dead file (~201 LoC) tsl/js/imports/scripts/scenes/shaderball.js — no import path from any entry point (1582 application, 4 tooling, 295 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~158 LoC) · ×1
  • Dead file (~158 LoC) tsl/js/imports/scripts/scenes/plane.js — no import path from any entry point (1582 application, 4 tooling, 295 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~140 LoC) · ×1
  • Dead file (~140 LoC) manual/resources/threejs-post-processing-3dlut.js — no import path from any entry point (1582 application, 4 tooling, 295 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~139 LoC) · ×1
  • Dead file (~139 LoC) tsl/js/imports/scripts/scenes/empty.js — no import path from any entry point (1582 application, 4 tooling, 295 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~39 LoC) · ×1
  • Dead file (~39 LoC) manual/resources/tools/geo-picking/make-geo-picking-texture-ogc.js — no import path from any entry point (1582 application, 4 tooling, 295 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R8 · Dependency Hygiene · Unused dependency 'magic-string' · ×1
  • Unused dependency 'magic-string' — Declared in the root package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
S1 · Web-Security Posture · Third-party script without Subresource Integrity · ×1
  • Third-party script without Subresource Integrity editor/index.html:29 — `https://cdn.jsdelivr.net/gh/google/draco@1.5.7/javascript/draco_encoder.js` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session.
X17 · Uncapped recursion over a caller-supplied document · Recursive walk over a caller-supplied document has no depth cap · ×1
  • Recursive walk over a caller-supplied document has no depth cap src/nodes/core/StructNode.js:137 — `struct` is exported and takes `membersLayout: object` from its caller, and it calls itself at line 137 (`struct`) with a piece of `membersLayout` — and nowhere in `struct` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `struct` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Minor — 161 finding(s)
D24 · Comment Value · redundant comment · ×59
  • redundant comment editor/js/History.js:204 — "creates a new object of type "json.type"" repeats the code it sits on: 4 of its 5 words (creates, new, type, json) are already in `const cmd = new Commands[ cmdJSON.type ]( this.editor );`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment editor/js/History.js:216 — "creates a new object of type "json.type"" repeats the code it sits on: 4 of its 5 words (creates, new, type, json) are already in `const cmd = new Commands[ cmdJSON.type ]( this.editor );`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment editor/js/Menubar.Render.js:715 — "stss - Sync Samples" repeats the code it sits on: 3 of its 3 words (stss, sync, samples) are already in `const stssData = [ u32( syncSamples.length ) ];`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment editor/js/Sidebar.Geometry.Modifiers.js:16 — "Compute Vertex Normals" repeats the code it sits on: 3 of its 3 words (compute, vertex, normals) are already in `const computeVertexNormalsButton = new UIButton( strings.getKey( 'sidebar/geometry/compute_vertex_normals' ) );`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment editor/js/Sidebar.Material.js:153 — 7 comments in this file only repeat the code they sit on (lines 153, 248, 253, 278, 283, 288, 373), for example "iridescenceThicknessMax". Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment editor/js/libs/acorn/acorn.js:3131 — "#table-unicode-general-category-values" repeats the code it sits on: 4 of its 5 words (unicode, general, category, values) are already in `var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Curre …`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment editor/js/libs/acorn/acorn.js:3941 — "LoneUnicodePropertyNameOrValue" repeats the code it sits on: 5 of its 5 words (lone, unicode, property, name, value) are already in `if (this.regexp_eatLoneUnicodePropertyNameOrValue(state))`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment editor/js/libs/acorn/acorn.js:3990 — "LoneUnicodePropertyNameOrValue :: UnicodePropertyValueCharacters" repeats the code it sits on: 5 of its 6 words (lone, unicode, property, name, value) are already in `pp$8.regexp_eatLoneUnicodePropertyNameOrValue = function(state)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment editor/js/libs/codemirror/codemirror.js:1324 — "Add a span to a line." repeats the code it sits on: 3 of its 3 words (add, span, line) are already in `function addMarkedSpan(line, span, op)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/materials/nodes/manager/NodeMaterialObserver.js:801 — "check drawRange" repeats the code it sits on: 3 of its 3 words (check, draw, range) are already in `if ( geometryData.drawRange.start !== geometry.drawRange.start || geometryData.drawRange.count !== geometry.drawRange.co …`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/math/Interpolant.js:271 — "copies a sample value to the result buffer" repeats the code it sits on: 4 of its 5 words (sample, value, result, buffer) are already in `const result = this.resultBuffer,`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/nodes/core/Node.js:994 — "return a outputNode if exists or null" repeats the code it sits on: 4 of its 5 words (return, output, node, null) are already in `return nodeProperties.outputNode || null;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/nodes/core/NodeBuilder.js:3618 — "< renderer.contextNode >" repeats the code it sits on: 3 of its 3 words (renderer, context, node) are already in `if ( renderer.contextNode.isContextNode === true )`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/nodes/core/NodeBuilder.js:3630 — "< material.contextNode >" repeats the code it sits on: 3 of its 3 words (material, context, node) are already in `if ( material && material.contextNode )`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/nodes/core/StackNode.js:363 — "return a outputNode if exists or null" repeats the code it sits on: 4 of its 5 words (return, output, node, null) are already in `return nodeProperties.outputNode || null;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/nodes/display/RenderOutputNode.js:142 — "working to output color space" repeats the code it sits on: 4 of its 4 words (working, output, color, space) are already in `if ( outputColorSpace !== NoColorSpace && outputColorSpace !== ColorManagement.workingColorSpace )`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/renderers/WebGLRenderer.js:3465 — "set up the src texture" repeats the code it sits on: 3 of its 3 words (set, src, texture) are already in `const isSrc3D = srcTexture.isDataArrayTexture || srcTexture.isData3DTexture;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/renderers/common/Bindings.js:79 — "assign bindings to pipelines" repeats the code it sits on: 3 of its 3 words (assign, bindings, pipelines) are already in `this.pipelines.bindings = this;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/renderers/common/RenderObjects.js:107 — "set chain keys" repeats the code it sits on: 3 of its 3 words (set, chain, keys) are already in `const chainKeys = sourceMaterial !== null ? _overrideChainKeys : _chainKeys;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/renderers/common/UniformsGroup.js:216 — "size of the uniform in bytes" repeats the code it sits on: 3 of its 3 words (size, uniform, bytes) are already in `const itemSize = uniform.itemSize * bytesPerElement;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/renderers/webgl-fallback/utils/WebGLTextureUtils.js:937 — "set up the src texture" repeats the code it sits on: 3 of its 3 words (set, src, texture) are already in `const isSrc3D = srcTexture.isDataArrayTexture || srcTexture.isData3DTexture || srcTexture.isArrayTexture;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/renderers/webgl-fallback/utils/WebGLVertexArrayUtils.js:89 — "get cache entry" repeats the code it sits on: 3 of its 3 words (get, cache, entry) are already in `let entry = this.cache.get( key );`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/renderers/webgl-fallback/utils/WebGLVertexArrayUtils.js:306 — "interleaved attributes can also view a buffer attribute" repeats the code it sits on: 4 of its 5 words (interleaved, attributes, buffer, attribute) are already in `const bufferStride = bufferAttribute.isInterleavedBuffer === true ? bufferAttribute.stride : bufferAttribute.itemSize;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/renderers/webgl/WebGLBindingStates.js:355 — "check for integer attributes" repeats the code it sits on: 3 of its 3 words (check, integer, attributes) are already in `const integer = ( type === gl.INT || type === gl.UNSIGNED_INT || geometryAttribute.gpuType === IntType );`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/renderers/webgpu/nodes/WGSLNodeBuilder.js:1345 — "Honor read-write for storage texture in the fragment stage." repeats the code it sits on: 6 of its 7 words (read, write, storage, texture, fragment, stage) are already in `if ( shaderStage === 'fragment' && node.isStorageTextureNode === true && node.access === NodeAccess.READ_WRITE )`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • + 34 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×40
  • Duplicated predicate src/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.js:90 — `! this.trackTimestamp || this.isDisposed` appears character-identically in 2 files — src/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.js, src/renderers/webgpu/utils/WebGPUTimestampQueryPool.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate docs/scripts/page.js:1 — `! window.frameElement && window.location.protocol !== 'file:'` appears character-identically in 3 files — docs/scripts/page.js, manual/resources/lesson.js, utils/docs/template/static/scripts/page.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/extras/ImageUtils.js:75 — `( typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement ) || ( typeof HTMLCanvasElement !== 'undefined' && image inst…` appears character-identically in 2 files — src/extras/ImageUtils.js, src/textures/TextureSource.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/renderers/common/Geometries.js:272 — `attribute.isStorageBufferAttribute || attribute.isStorageInstancedBufferAttribute` appears character-identically in 4 files — src/renderers/common/Geometries.js, src/renderers/webgl-fallback/WebGLBackend.js, src/renderers/webgl-fallback/utils/WebGLAttributeUtils.js, src/renderers/webgpu/WebGPUBackend.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/math/Box2.js:375 — `box.min.equals( this.min ) && box.max.equals( this.max )` appears character-identically in 2 files — src/math/Box2.js, src/math/Box3.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/nodes/accessors/BufferAttributeNode.js:284 — `builder.shaderStage === 'vertex' || builder.shaderStage === 'compute'` appears character-identically in 2 files — src/nodes/accessors/BufferAttributeNode.js, src/nodes/core/IndexNode.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/nodes/accessors/Bitangent.js:56 — `builder.subBuildFn === 'VERTEX' || builder.geometry.hasAttribute( 'tangent' )` appears character-identically in 2 files — src/nodes/accessors/Bitangent.js, src/nodes/accessors/Tangent.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/nodes/accessors/Camera.js:89 — `camera.isArrayCamera && camera.cameras.length > 0` appears character-identically in 3 files — src/nodes/accessors/Camera.js, src/nodes/accessors/Lights.js, src/nodes/accessors/ModelNode.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/renderers/WebGLRenderer.js:1671 — `camera.parent === null && camera.matrixWorldAutoUpdate === true` appears character-identically in 2 files — src/renderers/WebGLRenderer.js, src/renderers/common/Renderer.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/renderers/webgl-fallback/WebGLBackend.js:1334 — `cameraData.indexesGPU === undefined || cameraData.indexesGPU.length !== cameras.length` appears character-identically in 2 files — src/renderers/webgl-fallback/WebGLBackend.js, src/renderers/webgpu/WebGPUBackend.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate manual/resources/threejs-align-html-elements-to-3d.js:138 — `canvas.width !== width || canvas.height !== height` appears character-identically in 2 files — manual/resources/threejs-align-html-elements-to-3d.js, manual/resources/threejs-lesson-utils.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:2357 — `currentIcon && currentIcon.getAttribute( 'data-icon' ) === iconName` appears character-identically in 2 files — REDACTED, tsl/js/managers/LayoutManager.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/renderers/common/RenderList.js:403 — `customTransparentSort || reversePainterSortStable` appears character-identically in 2 files — src/renderers/common/RenderList.js, src/renderers/webgl/WebGLRenderLists.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/objects/Line.js:343 — `distance < raycaster.near || distance > raycaster.far` appears character-identically in 4 files — src/objects/Line.js, src/objects/Mesh.js, src/objects/Points.js, src/objects/Sprite.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/renderers/WebGLRenderer.js:3596 — `dstLevel === 0 && dstTexture.generateMipmaps === true && dstTexture.mipmapsAutoUpdate === true` appears character-identically in 3 files — src/renderers/WebGLRenderer.js, src/renderers/webgl-fallback/utils/WebGLTextureUtils.js, src/renderers/webgpu/WebGPUBackend.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/nodes/accessors/Morph.js:103 — `entry === undefined || entry.count !== morphTargetsCount` appears character-identically in 2 files — src/nodes/accessors/Morph.js, src/renderers/webgl/WebGLMorphtargets.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/nodes/lighting/EnvironmentNode.js:65 — `envNode.isTextureNode || envNode.isMaterialReferenceNode` appears character-identically in 2 files — src/nodes/lighting/EnvironmentNode.js, src/nodes/utils/CubeMapNode.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/materials/nodes/NodeMaterial.js:779 — `geometry.morphAttributes.position || geometry.morphAttributes.normal || geometry.morphAttributes.color` appears character-identically in 5 files — src/materials/nodes/NodeMaterial.js, src/nodes/accessors/Morph.js, src/renderers/WebGLRenderer.js, src/renderers/webgl/WebGLMorphtargets.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:900 — `hash.startsWith( 'playground=' ) || hash.startsWith( 'playground/' )` appears character-identically in 2 files — REDACTED, REDACTED. 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 editor/js/Selector.js:265 — `helper !== undefined && helper.isSkeletonHelper !== true` appears character-identically in 2 files — editor/js/Selector.js, editor/js/Viewport.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate docs/scripts/page.js:63 — `href.startsWith( '#' ) || ( target.hostname === window.location.hostname && target.pathname === window.location.pathname )` appears character-identically in 2 files — docs/scripts/page.js, utils/docs/template/static/scripts/page.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/materials/nodes/manager/NodeMaterialObserver.js:1058 — `index !== null && attributes.has( index ) === false` appears character-identically in 2 files — src/materials/nodes/manager/NodeMaterialObserver.js, src/renderers/common/Renderer.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/renderers/common/XRManager.js:1908 — `inputSource !== null && controller !== undefined` appears character-identically in 2 files — src/renderers/common/XRManager.js, src/renderers/webxr/WebXRManager.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/renderers/webgl-fallback/WebGLBackend.js:1259 — `lastObject !== null && lastObject.occlusionTest === true` appears character-identically in 2 files — src/renderers/webgl-fallback/WebGLBackend.js, src/renderers/webgpu/WebGPUBackend.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/renderers/webgl-fallback/WebGLBackend.js:646 — `lastOcclusionObject && lastOcclusionObject.occlusionTest === true` appears character-identically in 2 files — src/renderers/webgl-fallback/WebGLBackend.js, src/renderers/webgpu/WebGPUBackend.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • + 15 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED · ×21
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D34 · Knowledge Freshness · Orphaned file · ×12
  • Orphaned file manual/resources/tools/geo-picking/shapefile.js: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 manual/resources/threejs-materials.js: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 manual/resources/threejs-lesson-utils.js: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 manual/resources/threejs-textures.js: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 manual/resources/threejs-align-html-elements-to-3d.js: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 manual/resources/tools/geo-picking/ogc-parser.js: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 manual/resources/tools/geo-picking/make-geo-picking-texture.js: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/geometries/CapsuleGeometry.js: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 manual/resources/threejs-fog.js: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 manual/resources/threejs-lots-of-objects.js: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 manual/resources/threejs-lights.js: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 manual/resources/threejs-post-processing-3dlut.js: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.
IC1 · Incompleteness & stubs · Empty method body · ×6
  • Empty method body build/three.core.js:4823 — `_onChangeCallback` has an empty body — confirm it's an intentional no-op and not an unfinished method.
  • Empty method body build/three.core.js:11822 — `_onChangeCallback` has an empty body — confirm it's an intentional no-op and not an unfinished method.
  • Empty method body build/three.core.js:54038 — `_setValue_unavailable` has an empty body — confirm it's an intentional no-op and not an unfinished method.
  • Empty method body REDACTED:328 — `_setValue_unavailable` has an empty body — confirm it's an intentional no-op and not an unfinished method.
  • Empty method body src/math/Euler.js:427 — `_onChangeCallback` has an empty body — confirm it's an intentional no-op and not an unfinished method.
  • Empty method body src/math/Quaternion.js:895 — `_onChangeCallback` has an empty body — confirm it's an intentional no-op and not an unfinished method.
D16 · Bus Factor · Off-boarding risk · ×4
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 16 significant file(s) lose their only recent owner: editor/js/Animation.js, editor/js/Sidebar.Material.MapProperty.js, editor/js/libs/tern-threejs/build-defs.js, editor/js/Sidebar.Settings.Shortcuts.js, manual/resources/threejs-material-table.js, src/geometries/SphereGeometry.js, src/scenes/Scene.js, src/cameras/StereoCamera.js (+8 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 9 significant file(s) lose their only recent owner: utils/llms/build.js, src/renderers/webgl/WebGLLights.js, src/renderers/webgl/WebGLUniformsGroups.js, devtools/preview.js, utils/generateDFGLUT.js, src/renderers/shaders/DFGLUTData.js, src/renderers/shaders/ShaderChunk/lightprobes_pars_fragment.glsl.js, src/core/UniformsGroup.js (+1 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 7 significant file(s) lose their only recent owner: REDACTED, tsl/js/managers/ConsoleManager.js, src/nodes/core/OverrideContextNode.js, src/materials/nodes/NodeMaterialInstance.js, src/nodes/code/FunctionCallNode.js, src/nodes/core/StructNode.js, src/nodes/utils/JoinNode.js. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 3 significant file(s) lose their only recent owner: editor/js/libs/ternjs/infer.js, editor/js/libs/ternjs/tern.js, editor/js/libs/ternjs/def.js. Pair on, review, or document these before any departure.
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×4
  • Hand-rolled JSON/XML parsing via regex utils/llms/build.js:549 — 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 JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex tsl/js/utils/MarkdownUtils.js:35 — 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 JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex tsl/js/managers/ConsoleManager.js:167 — 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 JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex REDACTED:1210 — 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 JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
IC1 · Incompleteness & stubs · Blanket warning suppression · ×2
  • Blanket warning suppression build/three.core.js:34744 — A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead.
  • Blanket warning suppression src/extras/lib/earcut.js:1 — A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead.
S1 · Web-Security Posture · No app-layer HTTPS enforcement detected · ×2
  • No app-layer HTTPS enforcement detected REDACTED:197 — `server.listen(…)` serves plain HTTP on a network address, and nothing in its package enforces HTTPS: no TLS served (`https.createServer`, Fastify `https`, Nest `httpsOptions`), no redirect of plain requests to `https://`, no `Strict-Transport-Security` (helmet sends it by default), and no TLS-terminating proxy configuration committed beside it — so a browser may talk to it in clear text. (−2.0 on this card.)
  • No app-layer HTTPS enforcement detected REDACTED:216 — `server.listen(…)` serves plain HTTP on a network address, and nothing in its package enforces HTTPS: no TLS served (`https.createServer`, Fastify `https`, Nest `httpsOptions`), no redirect of plain requests to `https://`, no `Strict-Transport-Security` (helmet sends it by default), and no TLS-terminating proxy configuration committed beside it — so a browser may talk to it in clear text. (−2.0 on this card.)
X7 · Silent fallback defaults · Silent fallback default in catch · ×2
  • Silent fallback default in catch editor/js/libs/codemirror/codemirror.js:7657 — `gutterEvent` swallows every exception into `return false` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch utils/changelog.js:76 — `exec` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 on the handler or in the docstring, and the row stops firing.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 11 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 (46 single-owned of 492 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 492 of the 910 production source files in this repository met that bar). They are anonymized user #5 (1 file(s)), anonymized user #6 (1 file(s)), anonymized user #7 (1 file(s)), anonymized user #8 (1 file(s)), anonymized user #9 (1 file(s)), anonymized user #10 (1 file(s)) (+5 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/animation/AnimationObjectGroup.js, src/geometries/PolyhedronGeometry.js, src/extras/curves/CatmullRomCurve3.js, src/extras/core/CurvePath.js, utils/generateMaterialXNodeInterfaceRegistry.js, src/geometries/EdgesGeometry.js, src/renderers/shaders/ShaderChunk/iridescence_fragment.glsl.js, editor/js/Storage.js (+3 more).
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found package.json:45 — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `package.json` makes this repository a deployable product (line 45).
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 1 of 2 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. The most over is `(repository root)` (546161 LoC, 2394 module-visible types across 140 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.
D30 · Dependency Vulnerabilities · Low CVE · ×1
  • REDACTED
D34 · Knowledge Freshness · Orphaned files with no living knowledge · ×1
  • Orphaned files with no living knowledge — 12 of 492 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 492 of the 910 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: manual/resources/tools/geo-picking/shapefile.js, manual/resources/threejs-materials.js, manual/resources/threejs-lesson-utils.js, manual/resources/threejs-textures.js, manual/resources/threejs-align-html-elements-to-3d.js, manual/resources/tools/geo-picking/ogc-parser.js, manual/resources/tools/geo-picking/make-geo-picking-texture.js, src/geometries/CapsuleGeometry.js (and 4 more). 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.
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.
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: `.`.
P6 · Release Hygiene · No changelog · ×1
  • No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
X2 · Cancellation propagation · Not all async functions that make a request accept an AbortSignal · ×1
  • Not all async functions that make a request accept an AbortSignal — Only 0/4 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
Minor — 2 finding(s)
D12 · Dependency Hygiene · Dependency hygiene PARTLY measured · ×1
  • Dependency hygiene PARTLY measured — npm pinning read, dependency currency not (the committed lockfile resolved no direct production dependency) — This repository's npm dependencies were read for PINNING discipline: 0 production declaration(s) plus 16 development one(s) across 1 package.json (1 of them the product — the rest are example, documentation or fixture manifests, which are read and counted but screened off the rules below, because both prescribe a MOVE and "align your example apps" is not a remedy), against 1 committed lockfile(s). No pinning defect was found. That is only PART of dependency hygiene, so this dimension is NOT SCORED: whether any of these packages has a newer, deprecated or abandoned release is the dependency-CURRENCY question, and answering it needs concrete resolved versions. This repository's committed lockfile WAS read and it resolves no direct production dependency to grade — a package.json states version RANGES, which name no particular release to be behind. That is a fact about this repository, not a reader we are missing. A clean pinning pass is NOT an all-clear for these dependencies, and it is not a finding that they are all USED. Note also what is deliberately NOT charged here: a workspace legitimately carries ONE lockfile for many manifests, so no row is raised off the lockfile count, only reported. Known CVEs in the same dependency graph are a separate question again, reported under D30 wherever the manifest is OSV-readable.
D24 · Comment Value · doc comments repeat the names · ×1
  • doc comments repeat the names src/animation/AnimationAction.js:15 — 1027 of 5972 documented parameters and 178 of 4950 summaries in `three` only repeat the member or parameter name (e.g. "The blend mode." for `blendMode`). Delete the restating tags, or add what the name does not say.

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-46697cd075ca495780d55206982f0f83/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-46697cd075ca495780d55206982f0f83/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt --exclude manual/3rdparty .59artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .2artifacts/raw/trivy-fs.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 8 file(s) — `editor/js/libs/codemirror/codemirror.js`, `src/math/Matrix2.js`, `src/math/Matrix3.js`, `src/math/Matrix4.js`, `src/math/Vector2.js`, … (+3 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 Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .0artifacts/raw/trivy-fs.json

Run 01a1d5ab-d327-7808-8ef2-a849663c0b37 · 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