Skip to content

chore: resolve static-analysis code smells (duplicated literals, naming, parameter grouping) - #567

Merged
HuiJun merged 1 commit into
developfrom
chore/sonar-smell-cleanup
Sep 25, 2026
Merged

HuiJun merged 1 commit into
developfrom
chore/sonar-smell-cleanup

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Clears the open, non-gating SonarCloud code smells on develop that need no real refactor. No behaviour changes; every message/attribute string is byte-identical, only factored.

  • go:S1192 duplicated literals (29): unexported consts in the owning package (scalarValues* in record.go, dotPenWidthOne/dotFillBlack/dotArrowheadNone in dot.go, message fragments in migrate/*, fuml/emit.go, cmd/sysml/usage.go); two sites reuse existing consts (sysmlPrefix, theValue).
  • godre:S8209 (5): el, parent *element parameter grouping in rdf_in_normative.go, docgen.go.
  • godre:S8193 (4): single-use if x := f(); x != "" initialisers inlined.
  • go:S1871 (3): three identical case bodies in deriveNormativeGraph merged into one case list.
  • go:S1186 (2): the two intentionally empty closures in montecarlo.go state why.
  • go:S117 / go:S978 (7, tests): out_path→outPath, go_→goT, real→realValue/realURI, max→maxF.
  • typescript:S7747 (2): for…of routes instead of for…of [...routes] in autolayout.ts (the loops only mutate the key being visited).
  • java:S1130/S5785/S5778 in BinaryStagerTest: drop the unthrowable throws, assertEquals, one throwing call per assertThrows lambda.

Deliberately left open: go:S3776 cognitive complexity, go:S107, godre:S8242, java:S107/S135/S6539 — those need real refactors of migrator/export code and are out of scope here. The four go:S5332 XMI namespace findings stay as marked false positives (semantic namespace IRIs, not endpoints).

How it was verified

gofmt -l . empty, go build ./..., go vet ./..., make lint, go test ./... (83 packages ok); npm run typecheck in editors/vscode; mvn test in editors/cameo/tools.

Checklist

  • make test and make lint pass locally
  • Tests added or updated for the change (none needed: no behaviour change)
  • Documentation extended where it already covers the surface (n/a)
  • Changelog entry added (n/a: internal cleanup, no user-visible change)
  • baselines regenerated (n/a)
  • No internal work-item labels in the body, docs, or changelog

Link to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/bb80cf5ab72a4155979b6b455ff3b1f8
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/bb80cf5ab72a4155979b6b455ff3b1f8?variant=devin
Requested by: @HuiJun

…ng, parameter grouping)

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration
devin-ai-integration Bot marked this pull request as ready for review September 24, 2026 23:04

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@HuiJun
HuiJun merged commit 60b03b6 into develop Sep 25, 2026
15 checks passed
@HuiJun
HuiJun deleted the chore/sonar-smell-cleanup branch September 25, 2026 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant