Skip to content
CAI
Software that uses CAICheck a score

SaintZet/HeuristicsForCleanCode

37.3

Weak · 3 August 2026

1.6k

lines of production code

C#

with Java

3

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a code quality reference library that provides concrete C\# and Java examples of common code smells and refactoring patterns. It illustrates both problematic practices and their improved alternatives across categories such as function design, naming conventions, and general code structure. The collection serves as a practical guide for developers to identify and fix issues like inappropriate comments, excessive parameters, and poor abstraction levels.

Features

Add general and naming convention examples

Added a series of new C\# example files in the \[G\]eneral and \[N\]ames directories. These include \[G02\] Obvious Behavior Is Unimplemented.cs, \[G04\] Overridden Safeties.cs, \[G05\] Duplication.cs, \[G06\] Code at Wrong Level of Abstraction.cs, \[G07\] Base Classes Depending on Their Derivatives.cs, \[G11\] Inconsistency.cs, \[G14\] Feature Envy.cs, \[G15\] Selector Arguments.cs, \[G16\] Obscured Intent.cs, \[G18\] Inappropriate Static.cs, \[G19\] Use Explanatory Variables.cs, \[G20\] Function Names Should Say What They Do.cs, \[G22\] Make Logical Dependencies Physical.cs, \[G23\] Prefer Polymorphism to IfElse or SwitchCase.cs, \[G25\] Replace Magic Numbers with Named Constants 1.cs, \[G25\] Replace Magic Numbers with Named Constants 2.cs, \[G28\] Encapsulate Conditionals.cs, \[G29\] Avoid Negative Conditionals.cs, \[G30\] Functions Should Do One Thing.cs, \[G31\] Hidden Temporal Couplings.cs, \[G32\] Don\`t Be Arbitrary.cs, \[G33\] Encapsulate Boundary Conditions.cs, \[G34\] Functions Should Descend Only One Level of Abstraction.cs, \[G35\] Keep Configurable Data at High Levels.cs, \[N01\] Choose Descriptive Names.cs, \[N02\] Choose Names at the Appropriate Level of Abstraction.cs, \[N04\] Unambiguous Names.cs, \[N05\] Use Long Names for Long Scopes.cs, and \[N07\] Names Should Describe Side-Effects.cs.

C\#/\[G\]eneral · high confidence

Added C\# code examples for refactoring anti-patterns

New C\# examples were added to the Functions directory, illustrating refactoring techniques for common code smells. The '\[F01\] Too Many Arguments' file demonstrates replacing a method with six boolean and string parameters with a single Message object. The '\[F02\] Output Arguments' file shows how to avoid ambiguous output parameters by using a StringBuilder or similar object. The '\[F03\] Flag Arguments' file illustrates splitting a method with multiple boolean flags into smaller, specialized methods within a Message class.

C\#/\[F\]unctions · high confidence

Added Java code examples for code smell rules

Added new Java source files across the codebase to serve as examples for various code smell rules. These include examples for inappropriate comments, obsolete comments, redundant comments, poorly written comments, and commented-out code. Additionally, new examples were added for function-related issues such as too many arguments, output arguments, and flag arguments. General code smell examples were also added, covering topics like unimplemented behavior, overridden safeties, duplication, code at the wrong level of abstraction, base classes depending on derivatives, inconsistency, feature envy, selector arguments, obscured intent, inappropriate static usage, use of explanatory variables, function naming, logical dependencies, polymorphism vs. conditionals, magic numbers, encapsulation of conditionals and boundary conditions, temporal couplings, arbitrary scoping, and naming conventions. These files provide concrete illustrations of both problematic code and improved alternatives.

Java · high confidence

Introduce examples for C\#/Java refactoring patterns

Added two new C\# example files demonstrating refactoring techniques: one showing how to avoid using inheritance to share constants by using static usings, and another illustrating the use of enums with extension methods for pay grades. These serve as practical references for developers looking to improve code structure and readability.

C\#/\[J\]ava and \[C\]sharp · medium confidence

Behavioural changes

Added C\# comment violation examples

Added five new C\# files demonstrating common comment-related code quality issues: inappropriate information in headers, obsolete comments, redundant XML documentation, poorly written comments, and commented-out code.

C\#/\[C\]omments · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 37 → 37 (+0.0)
  • Rubric changed (rubric-2026.08.18 → rubric-2026.08.19) — scores are not directly comparable.

Lenses

  • Maturity 43 → 43 (+0.0)
  • Readiness 15 → 15 (+0.0)
  • Security 100 → 100 (+0.0)

Findings

  • No change — the same findings as the prior survey.

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

SaintZet/HeuristicsForCleanCode was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 3 August 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit c8e9f56aa21662c9a9f1b8e8ee828e47dfa6bef7 — the exact code this score is about.
  • Scored under rubric-2026.08.19 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer latest.