OeditusCredo (OeditusCredo v0.6.2)

View Source

OeditusCredo provides custom Credo checks for detecting common Elixir/Phoenix anti-patterns.

Usage

Add to your .credo.exs:

%{
  configs: [
    %{
      name: "default",
      checks: %{
        enabled: [
          {OeditusCredo.Check.Warning.MissingErrorHandling, []},
          {OeditusCredo.Check.Warning.SilentErrorCase, []},
          {OeditusCredo.Check.Warning.InefficientFilter, []},
          # ... other checks
        ]
      }
    }
  ]
}

False Positives

All these checks are somewhat opinionated and might produce false positives. If a warning does not apply to your specific case, suppress it with # credo:disable-for-next-line or any other Credo config comment directive.

General Parameters

All checks support the standard Credo general parameters:

  • false -- disable the check entirely:

    {OeditusCredo.Check.Warning.NPlusOneQuery, false}
  • exit_status -- override the exit status for issues from this check (default is 16 for the :warning category). Set to 0 to make a check advisory-only (still reports issues but won't affect the exit code):

    {OeditusCredo.Check.Warning.NPlusOneQuery, exit_status: 0}
  • priority -- override the base priority for the check.

  • files -- restrict which files the check runs on.

Available Checks

Error Handling

Query & Data Access

Concurrency & Performance

Readability

Code Organization

LiveView & Templates

Telemetry & Observability

Security Checks (CWE Top 25)

Injection (CWE-89, CWE-78, CWE-94, CWE-79)

Authentication & Authorization (CWE-306, CWE-862, CWE-863, CWE-639)

Data Protection (CWE-200, CWE-798, CWE-502)

Input & File Handling (CWE-20, CWE-22, CWE-434)

Web Security (CWE-352, CWE-918)

Race Conditions (CWE-367)

Summary

Functions

Returns the version of OeditusCredo

Functions

version()

Returns the version of OeditusCredo