Skip to content

Sonarqube cleanup#2738

Merged
jmthomas merged 6 commits intomainfrom
sonar
Jan 21, 2026
Merged

Sonarqube cleanup#2738
jmthomas merged 6 commits intomainfrom
sonar

Conversation

@jmthomas
Copy link
Copy Markdown
Member

@jmthomas jmthomas commented Jan 16, 2026

Read the commit messages to know what I did and why

jmthomas and others added 3 commits January 15, 2026 17:49
The '[[' construct is safer and more feature-rich, preventing word
splitting and pathname expansion issues. Scripts that run in Docker
containers with /bin/sh (Alpine/busybox) remain unchanged to maintain
POSIX compliance.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- logger.py: Rename DEBUG/INFO/WARN/ERROR/FATAL to DEBUG_VALUE/INFO_VALUE/
  WARN_VALUE/ERROR_VALUE/FATAL_VALUE to avoid clash with method names.
  Keep old names as backwards compatibility aliases.
- packet_item.py: Rename STATE_COLORS to VALID_STATE_COLORS to avoid
  clash with state_colors instance attribute.
- packet_config.py: Rename COMMAND/TELEMETRY to COMMAND_STRING/
  TELEMETRY_STRING to avoid clash with commands/telemetry attributes.
- Openc3Screen.vue: Add "falls through" comments for intentional switch
  case fallthrough in SUBSETTING and GLOBAL_SUBSETTING cases.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Thread-local storage is used intentionally for:
- Pipeline context tracking in Redis operations
- Topic offset tracking per-thread for stream reading

These are well-established Ruby patterns with proper cleanup.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 16, 2026

Codecov Report

❌ Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.18%. Comparing base (8112540) to head (c83e94d).
⚠️ Report is 50 commits behind head on main.

Files with missing lines Patch % Lines
openc3/lib/openc3/utilities/cli_generator.rb 71.42% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2738      +/-   ##
==========================================
- Coverage   79.22%   79.18%   -0.05%     
==========================================
  Files         670      670              
  Lines       54178    54269      +91     
  Branches      734      734              
==========================================
+ Hits        42924    42972      +48     
- Misses      11174    11217      +43     
  Partials       80       80              
Flag Coverage Δ
python 80.98% <ø> (-0.01%) ⬇️
ruby-api 83.65% <ø> (-0.49%) ⬇️
ruby-backend 82.20% <71.42%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we still use INFO and WARN to set the log level or do we need to use INFO_VALUE and WARN_VALUE?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sonar didn't like the constant INFO shadowing the method info. So I created aliases for INFO but yeah you would now use INFO_VALUE ... I don't really like that though. The INFO_LEVEL constant was already declared to be the string "INFO" ... that actually makes more sense as setting level = Logger.INFO_LEVEL. I don't like level = Logger.INFO_VALUE.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could this be clearer and avoid the shadowing problem by implementing the log levels as an enum, rather than as 5 separate variables?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would something like this work?

@socket-security
Copy link
Copy Markdown

@socket-security
Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm safer-buffer is 94.0% likely obfuscated

Confidence: 0.94

Location: Package overview

From: ?npm/[email protected]npm/@angular-devkit/[email protected]npm/@angular/[email protected]npm/[email protected]

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at [email protected].

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/[email protected]. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@jmthomas jmthomas merged commit 54f02a2 into main Jan 21, 2026
45 of 47 checks passed
@jmthomas jmthomas deleted the sonar branch January 21, 2026 16:30
jmthomas added a commit that referenced this pull request Mar 21, 2026
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.

3 participants