Skip to main content

Rules

Rules define code quality standards and patterns that Artemis checks across your codebase. Each rule represents a guideline, best practice, or constraint designed to improve consistency, security, and maintainability within your project.

Every rule in Artemis includes the following attributes:

  • Rule Name A descriptive title (e.g., Error and Exception Handling, Input Validation).

  • Description Explains the purpose of the rule, what it enforces, and why it matters. Example: Ensures all user inputs are validated and sanitized to prevent vulnerabilities and maintain data integrity.

  • Importance Level Defines how critical the rule is for your project:

    • Mandatory → Must always be followed.
    • Essential → Strongly recommended for correctness and stability.
    • Preferred → Encouraged for maintainability and best practices.
    • Advisory → Optional recommendation.
  • Enabled / Disabled You can toggle each rule on or off based on project needs.

Creating a Rule

Step 1: Access rule panel

Navigate to Scan → Rules

Step 2: Choose or Add a Rule.

rule 1

Click Add Rule to open the creation form. Provide:

  • Rule Name
  • Description
  • Importance Level
  • Enable / Disable toggle

rule 2

Step 3: Run Analysis

rule 3

Step 4: Configure and Start the Analysis

After clicking Run Analysis, set up your configuration and start the scan. rule 4

Step 5: View Issues

Once the analysis is complete, you'll see the detected issues listed in the Issues panel. rule 5


Example Rule: Error and Exception Handling

  • Importance: Essential

  • Description: Ensures that the application properly handles errors and exceptional conditions.

  • Why it matters:

    • Prevents unexpected crashes
    • Ensures meaningful error logs
    • Improves stability and user experience

When this rule is enabled, Artemis scans the codebase for improper error-handling patterns.

By defining rules, you can:

  • Enforce consistent coding standards across teams
  • Detect risky or non-compliant patterns early
  • Provide actionable feedback to developers
  • Improve reliability, security, and maintainability

Next Step

Proceed to analyze and fix issues.