Repository navigation
refactor(internal): clear the Sonar findings outside the runtime - #1610
Merged
Merged
Conversation
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Split checkTypeTarget, evaluateProject, packageEdges and FeatureTypeSetWithImplied into named helpers, name each edge kind from one table sized by the kinds (with a test that every kind is named), name the repeated construct and arrowhead literals, group flattenAsciiDoc's parameters, and rename two shadowing test variables. Co-Authored-By: jason.han <hanhuijun@gmail.com>
devin-ai-integration
Bot
force-pushed
the
fix/sonar-internal
branch
from
October 28, 2026 03:07
27471e4 to
87b96c3
Compare
Co-Authored-By: jason.han <hanhuijun@gmail.com>
6 tasks done
This was referenced Oct 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Clears 14 of the 15 open SonarCloud findings on
developin Go packages underinternal/outside the runtime, at the root; one is deferred because two open PRs rewrite the same function. Behaviour is unchanged: each edit is a split into named helpers, a named constant, a table that replaces a switch (with a new test that it names every kind), or a renamed test variable.internal/check/passes/typecheck.go:389checkTypeTargettypeTargetSymbol; the kind-message diagnostic isreportTargetKind.internal/doc/queryexec/operations.go:604evaluateProjectprojectionholds the operation's columns and what reading rows learnt;newProjectionreads the arguments,cellsreads one row,checkPropertiesreports unknown/missing properties. Argument and error order unchanged.internal/ir/view/general.go:588packageEdgesaliasEdgesandimportEdges.internal/semantic/semantics/model.go:982FeatureTypeSetWithImpliedwithUsageBases.internal/workspace/project/discovery.go:286usedfix/usage-version-ranges) and #1561 (fix/usage-elimination-named-forms) both rewrite the body ofused(their hunks span lines 302–380). Refactoring it under them would conflict with both; it should be split once they land, against the function they leave behind.internal/ir/view/view.go:289EdgeKind.String(34 branches)edgeKindNamestable sized by a newedgeKindCountsentinel. The switch had no exhaustiveness check (Go has none forswitch;make lintruns noexhaustive), so nothing relied on one; the table adds one —TestEdgeKindNamesEveryKindfails on a kind added without a name, and a name out of range still answers"edge".internal/exec/smt/encode.go:257"attribute "×3attributeConstructconstant.internal/ir/view/dot.go:545"arrowhead=vee"×3dotArrowheadVeeconstant.internal/ir/docplan/markup/asciidoc.go:135flat, nodes []asciiDocBlock.internal/doc/queryexec/named_test.go:143Actualname is now reported in the failure message.internal/frontend/grpc/query_operators_test.go:170anyany→listed.internal/workspace/libs/loader_copies_test.go:19copycopy→replica.internal/workspace/libs/loader_copies_test.go:84copyNo dispositions.
How it was verified
go build ./...,go veton every touched package,gofmt -lempty.go test -count=1 -timeout 60m ./internal/check/... ./internal/doc/... ./internal/exec/smt/... ./internal/frontend/grpc/... ./internal/ir/... ./internal/semantic/... ./internal/workspace/...: all 37 packages ok.gocognit -over 30on the four refactored files: none of the four functions remains over 30.analyze_code_snippeton each changed file: thedevelopcopies report exactly the findings above; the branch copies report none of them (the remaining hits are findings already resolved ondevelop).godre:*rules are not reported by the snippet analyser; checked by eye.Overlap with open PRs
internal/workspace/project/discovery.go; this PR leaves that file untouched (see the deferred row), so there is no conflict.origin/develop(12e4fc3): this head (2dc10e4), then refactor(symbols): drop the unexported duplicate of UsageSymbolKind #1613 (refactor/usage-symbol-kind-dedup, 50db66b, the only open PR touchinginternal/semantic) — merges clean;go build ./...,go vetandgo test ./internal/semantic/... ./internal/check/passes ./internal/ir/viewpass on the merged tree.perf/*PR touchesinternal/exec/runtime,internal/semanticorinternal/frontend/lspat this time (open PRs re-listed before leaving draft).go build ./...,go vet ./...andgofmt -lclean on the combined tree.Checklist
make testandmake lintpass locallychanges/unreleased/<slug>.<section>.md, not as an edit toCHANGELOG.md— not needed: refactor onlymake docs-countsrun if a gate count moved (compliance rows need nothing: the census is counted at docs build) — no count movedF4,K5) in the body, docs, or changelogRequested by: @HuiJun