fix: resolve all 11 SonarQube blocker issues#507
Open
will-yuponce-db wants to merge 1 commit into
Open
Conversation
Clears every BLOCKER-severity finding on main:
- python:S930 (x8) wrong function-call arguments:
- Remove the dead create_from_odcs() method in data_contracts_manager:
it called create_contract() with a signature that never existed
(missing required owner, six unsupported kwargs) and would raise
TypeError if ever reached. It is orphaned -- the live ODCS path is
create_from_odcs_dict(). Also drops its now-unused private helpers
(_map_odcs_type/_map_odcs_classification/_parse_odcs_date).
- initialize_database() declared a required settings param it never
used; its only caller passed none. Drop the unused param (and the
now-unused Settings import).
- python:S3516 (x2) data_domains tag validators always returned their
input via a redundant 'if v is None' branch. Collapse to a single
pass-through return.
- python:S5807 (x1) common/__init__ __all__ exported get_sql_connection,
which is not defined anywhere. Remove the phantom entry.
No behavior change: removed code was unreachable or a no-op.
Co-authored-by: Isaac
Contributor
Author
SonarQube rescan — blockers verified ✅Re-ran
All 11 blockers (8× |
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 & why
A SonarQube scan of
mainreported 11 BLOCKER-severity issues. All are latent bugs in unreachable or no-op code. This PR clears every one. No runtime behavior changes.Fixes by rule
python:S930— wrong function-call arguments (8)controller/data_contracts_manager.py: removed the deadcreate_from_odcs()method. It calledcreate_contract()with a signature that never existed (omitted the requiredowner, passed six kwargs the method doesn't accept) and would raiseTypeErrorif ever executed. It is orphaned — the live ODCS ingestion path iscreate_from_odcs_dict()(used byself_service_routes). Also removed its now-unused private helpers_map_odcs_type,_map_odcs_classification,_parse_odcs_date.utils/startup_tasks.py:initialize_database(settings: Settings)required asettingsarg it never used (comment said "for future use"); its sole caller invokedinitialize_database()with none. Dropped the unused param and the now-unusedSettingsimport.python:S3516— method always returns the same value (2)models/data_domains.py: thevalidate_tags/validate_update_tagsfield validators returned their input through a redundantif v is None: return vbranch (both paths returnv). Collapsed to a single pass-throughreturn v.python:S5807— name not defined (1)common/__init__.py:__all__exportedget_sql_connection, which is not defined or imported anywhere in the package. Removed the phantom entry.Testing
py_compile).create_from_odcs, the ODCS helpers, orget_sql_connectionanywhere insrc/tests.This pull request and its description were written by Isaac.