Decouple the rule implementation from the NodeVisitor
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
Research direction
Start with scan-command/src/main/java/io/ballerina/scan/internal/StaticCodeAnalyzer.java and review how its NodeVisitor visit methods currently contain rule logic. Then study how SyntaxNodeAnalysisTasks are executed in compiler plugins, as suggested by the issue. Done means rules are logically separated from the visitor while preserving the analyzer's behavior.
Written by the indexing model from the issue text.
Description
Current Limitation
Currently https://github.com/ballerina-platform/static-code-analysis-tool/blob/main/scan-command/src/main/java/io/ballerina/scan/internal/StaticCodeAnalyzer.java is a node visitor. When implementing a new rule, we have to add the relevant new logic to each of the visit methods of different nodes.
While this allows the visitor only to run once, there is no proper logical separation between rules and might be hard to maintain as the list of internal rules grow.
Suggested Improvement
Decouple the rules from the visitor. We can copy how SyntaxNodeAnalysisTasks in compiler plugins are executed.
Version
0.5.0
- Dominant language
- Java
- Stars
- 15
- Forks
- 12
- Avg merge
- 12h 17m
- Merged PRs (30d)
- 13
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ballerina-platform/static-code-analysis-tool
-
Type/Improvement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ballerina-platform/static-code-analysis-tool#140 ·
Maintainers usually reply within 1 day
-
Type/Improvement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ballerina-platform/static-code-analysis-tool#139 ·
Maintainers usually reply within 1 day
-
Type/Improvement
Difficulty 5/5 Over a week Newbie friendliness 35/100
ballerina-platform/static-code-analysis-tool#142 ·
Maintainers usually reply within 1 day
-
Type/Improvement
Difficulty 4/5 3-5 days Newbie friendliness 48/100
ballerina-platform/static-code-analysis-tool#141 ·
Maintainers usually reply within 1 day
-
Type/Improvement
Difficulty 3/5 1-2 days Newbie friendliness 62/100
ballerina-platform/static-code-analysis-tool#138 ·
Maintainers usually reply within 1 day
All issues in ballerina-platform/static-code-analysis-tool
Similar issues
-
priority: medium Review effort [1-5]: 3 status: needs-triage type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
carlos-emr/carlos#5431 ·
Maintainers usually reply within 1 day
-
Integration tests: jetty:run fails with WELD-001408 for CountryJpaServicePossibly taken @viniciusmachak claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
primefaces/primefaces#15431 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
OpenAPITools/openapi-generator#25454 ·
Maintainers usually reply within 1 day
-
Component - Build
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100