Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Decouple the rule implementation from the NodeVisitor

Open
#36 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Stale
Tech stack
java

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

Type/Improvement
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ballerina-platform/static-code-analysis-tool

All issues in ballerina-platform/static-code-analysis-tool

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.