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

New rule: If expressions should not be too complex

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

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Quiet
Tech stack
java
Domain
tooling

Research direction

Start by reading the existing RoutineNestingDepth and TooManyNestedRoutines rules to understand how similar complexity checks are defined. Decide which measure or combination best identifies overly complex if expressions, then define the rule's scope and acceptance criteria so it is generally useful and distinguishable from existing rules.

Written by the indexing model from the issue text.

Description

feature rule
Prerequisites
  • This rule has not already been suggested.
  • This should be a new rule, not an improvement to an existing rule.
  • This rule would be generally useful, not specific to my code or setup.
Suggested rule title

If expressions should not be too complex

Rule description

Similar to the existing RoutineNestingDepth and TooManyNestedRoutines rules, this rule would catch if expressions that are unclear due to their size. This could be measured in a few ways, e.g.:

  • Sum length of the guard, then, or else expressions
  • Number of lines the entire expression covers
  • Number of nested if expressions
  • Whether anonymous methods are present
  • etc.
Rationale

Keeping ternary use limited makes code more readable and less prone to errors.

Dominant language
Java
Stars
160
Forks
36
Avg merge
22d 7h
Merged PRs (30d)
2

Getting set up

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 integrated-application-development/sonar-delphi

All issues in integrated-application-development/sonar-delphi

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.