{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/qodana/latest.json",
  "title": "Qodana",
  "description": "A configuration file for Qodana (https://jetbrains.com/qodana), named qodana.yaml or qodana.yml",
  "x-lintel": {
    "source": "https://www.schemastore.org/qodana-1.0.json",
    "sourceSha256": "92138007a03eb96c68d255195a08f1036a978a3d548aeaa903d33783dcd1f428",
    "fileMatch": [
      "qodana.yaml",
      "qodana.yml"
    ],
    "parsers": [
      "yaml"
    ]
  },
  "type": "object",
  "properties": {
    "version": {
      "description": "The version of the file format",
      "enum": [
        "1.0"
      ]
    },
    "profile": {
      "$ref": "#/$defs/profile",
      "description": "The profile configuration for Qodana analysis"
    },
    "failThreshold": {
      "description": "Deprecated: Use failureConditions#anySeverity",
      "type": "integer",
      "minimum": 0,
      "deprecated": true
    },
    "script": {
      "$ref": "#/$defs/script",
      "description": "The run scenario. 'default' by default"
    },
    "exclude": {
      "description": "The inspections and paths that are excluded from analysis",
      "type": "array",
      "minItems": 0,
      "items": {
        "$ref": "#/$defs/exclude"
      }
    },
    "include": {
      "description": "The inspections and paths that are added to those from the profile",
      "type": "array",
      "minItems": 0,
      "items": {
        "$ref": "#/$defs/include"
      }
    },
    "linter": {
      "description": "The linter (Docker image) to run for Qodana CLI / any CI extensions",
      "type": "string"
    },
    "ide": {
      "description": "The local path to an IDE or a product code to use for Qodana analysis. Incompatible with 'linter'",
      "type": "string"
    },
    "bootstrap": {
      "type": "string",
      "description": "The command to run inside Docker before the analysis starts"
    },
    "properties": {
      "type": "object",
      "description": "Set JVM properties to be used while running Qodana",
      "additionalProperties": {
        "type": "string"
      }
    },
    "licenseRules": {
      "description": "A list of license rules to apply for license checks",
      "type": "array",
      "minItems": 0,
      "items": {
        "$ref": "#/$defs/licenseRule"
      }
    },
    "dependencyIgnores": {
      "description": "",
      "type": "array",
      "minItems": 0,
      "items": {
        "$ref": "#/$defs/dependencyIgnore"
      }
    },
    "dependencyOverrides": {
      "description": "",
      "type": "array",
      "minItems": 0,
      "items": {
        "$ref": "#/$defs/dependencyOverride"
      }
    },
    "projectLicenses": {
      "description": "Overrides the licenses attached to the project",
      "type": "array",
      "minItems": 0,
      "items": {
        "$ref": "#/$defs/licenseOverride"
      }
    },
    "customDependencies": {
      "description": "",
      "type": "array",
      "minItems": 0,
      "items": {
        "$ref": "#/$defs/customDependency"
      }
    },
    "plugins": {
      "description": "A list of plugins to install for Qodana analysis",
      "type": "array",
      "minItems": 0,
      "items": {
        "$ref": "#/$defs/plugin"
      }
    },
    "dot-net": {
      "$ref": "#/$defs/dot-net",
      "description": "The configuration for .NET solutions and projects"
    },
    "dotnet": {
      "$ref": "#/$defs/dotnet",
      "description": "The configuration for .NET solutions and projects"
    },
    "cpp": {
      "$ref": "#/$defs/cpp",
      "description": "Configuration for Qodana for C/C++"
    },
    "projectJDK": {
      "description": "The JDK to use for the project",
      "type": "string"
    },
    "php": {
      "$ref": "#/$defs/php",
      "description": "The configuration for PHP projects"
    },
    "disableSanityInspections": {
      "description": "Disable sanity checks for the project",
      "type": "boolean",
      "default": false
    },
    "fixesStrategy": {
      "description": "The strategy to apply fixes",
      "enum": [
        "none",
        "cleanup",
        "apply"
      ],
      "default": "none"
    },
    "runPromoInspections": {
      "description": "Whether to run a curated set of promo inspections",
      "type": "boolean",
      "default": false
    },
    "includeAbsent": {
      "description": "Whether to include absent issues in the baseline calculation",
      "type": "boolean",
      "default": false
    },
    "maxRuntimeNotifications": {
      "description": "Maximum amount of internal errors to collect in the report",
      "type": "integer",
      "default": 100
    },
    "failOnErrorNotification": {
      "description": "Whether to fail the run when any internal error was encountered. In that case, the program returns exit code 70",
      "type": "boolean",
      "default": false
    },
    "failureConditions": {
      "$ref": "#/$defs/failureConditions",
      "description": "Configures individual failure conditions. Absent properties will not be checked"
    },
    "dependencySbomExclude": {
      "type": "array",
      "description": "Which dependencies to exclude from the generated SBOM report",
      "items": {
        "$ref": "#/$defs/dependencyIgnore"
      }
    },
    "modulesToAnalyze": {
      "description": "Which submodules to include. Omitting this key will include all submodules",
      "type": "array",
      "minItems": 0,
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          }
        }
      }
    },
    "analyzeDevDependencies": {
      "description": "Whether to include dev dependencies in the analysis",
      "type": "boolean",
      "default": false
    },
    "enablePackageSearch": {
      "description": "Using package-search service for fetching license data for dependencies (only for jvm libraries)",
      "type": "boolean",
      "default": false
    },
    "raiseLicenseProblems": {
      "description": "Show license problems like other inspections",
      "type": "boolean",
      "default": false
    }
  },
  "required": [
    "version"
  ],
  "additionalProperties": true,
  "$comment": "https://www.jetbrains.com/help/qodana/qodana-yaml.html",
  "$defs": {
    "profile": {
      "description": "A profile is some template set of checks to run with Qodana analysis",
      "type": "object",
      "anyOf": [
        {
          "properties": {
            "name": {
              "description": "The profile name (embedded or located in the project)",
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false,
          "type": "object"
        },
        {
          "properties": {
            "path": {
              "description": "The path to the profile file relative to the project root",
              "type": "string"
            }
          },
          "required": [
            "path"
          ],
          "additionalProperties": false,
          "type": "object"
        }
      ]
    },
    "include": {
      "description": "The inspections to run in addition to those from the profile",
      "type": "object",
      "properties": {
        "name": {
          "description": "The ID of the inspection to be added",
          "type": "string"
        },
        "paths": {
          "description": "The path in which to enable the inspection, relative to the project root. Omitting the paths enables the inspection everywhere",
          "type": "array",
          "minItems": 0,
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "exclude": {
      "description": "The inspections or paths to exclude from analysis",
      "type": "object",
      "properties": {
        "name": {
          "description": "The ID of the inspection to exclude, or 'All'",
          "type": "string"
        },
        "paths": {
          "description": "The path in which to disable the inspection, relative to the project root. Omitting the paths disables the inspection everywhere",
          "type": "array",
          "minItems": 0,
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "script": {
      "description": "The default running scenario",
      "type": "object",
      "properties": {
        "name": {
          "description": "The name of the script",
          "enum": [
            "default",
            "php-migration",
            "local-changes",
            "teamcity-changes",
            "migrate-classes"
          ]
        },
        "parameters": {
          "description": "The parameters to pass to the script",
          "type": "object",
          "additionalProperties": true
        }
      },
      "additionalProperties": false
    },
    "licenseRule": {
      "description": "A license rule to apply for license compatibility checks in Qodana",
      "type": "object",
      "properties": {
        "keys": {
          "description": "The list of project license SPDX IDs",
          "type": "array",
          "minItems": 0,
          "items": {
            "type": "string"
          }
        },
        "allowed": {
          "description": "The list of allowed dependency licenses for the project",
          "type": "array",
          "minItems": 0,
          "items": {
            "type": "string"
          }
        },
        "prohibited": {
          "description": "The list of prohibited dependency licenses for the project",
          "type": "array",
          "minItems": 0,
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "dependencyIgnore": {
      "description": "A dependency to ignore for license checks in Qodana",
      "type": "object",
      "properties": {
        "name": {
          "description": "The name of a dependency to ignore",
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "dependencyOverride": {
      "description": "A dependency metadata to override for license checks in Qodana",
      "type": "object",
      "required": [
        "name",
        "version",
        "licenses"
      ],
      "properties": {
        "name": {
          "description": "The dependency name",
          "type": "string"
        },
        "version": {
          "description": "The dependency version",
          "type": "string"
        },
        "url": {
          "description": "The dependency homepage",
          "type": "string"
        },
        "licenses": {
          "description": "The dependency licenses",
          "type": "array",
          "minItems": 0,
          "items": {
            "$ref": "#/$defs/license"
          }
        }
      },
      "additionalProperties": false
    },
    "customDependency": {
      "description": "A dependency to add to license checks to Qodana",
      "type": "object",
      "required": [
        "name",
        "version",
        "licenses"
      ],
      "properties": {
        "name": {
          "description": "The dependency name",
          "type": "string"
        },
        "version": {
          "description": "The dependency version",
          "type": "string"
        },
        "url": {
          "description": "The dependency homepage",
          "type": "string"
        },
        "licenses": {
          "description": "The dependency licenses",
          "type": "array",
          "minItems": 0,
          "items": {
            "$ref": "#/$defs/license"
          }
        }
      },
      "additionalProperties": false
    },
    "license": {
      "description": "A license to apply for license compatibility checks in Qodana",
      "type": "object",
      "properties": {
        "key": {
          "description": "The SPDX ID of the license",
          "type": "string"
        },
        "url": {
          "description": "The license homepage",
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "dotnet": {
      "description": "Configuration for .NET solutions and projects",
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "solution": {
              "description": "The name of a .NET solution inside the Qodana project",
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "project": {
              "description": "The name of a .NET project inside the Qodana project",
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "configuration": {
              "description": "The name of a configuration to be used for .NET solution or project",
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "platform": {
              "description": "The name of a platform to be used for .NET solution or project",
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "frameworks": {
              "description": "Semicolon-separated list of target framework monikers (TFM) to be analyzed (https://learn.microsoft.com/en-us/dotnet/standard/frameworks)",
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "dot-net": {
      "description": "Configuration for .NET solutions and projects",
      "deprecated": true,
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "solution": {
              "description": "The name of a .NET solution inside the Qodana project",
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "project": {
              "description": "The name of a .NET project inside the Qodana project",
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "cpp": {
      "description": "Configuration for Qodana for C/C++",
      "type": "object",
      "properties": {
        "cmakePreset": {
          "description": "Name of a specific CMake preset to use during analysis",
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "licenseOverride": {
      "type": "object",
      "description": "Specifies the license of a dependency or project ",
      "properties": {
        "key": {
          "type": "string",
          "description": "SPDX id of this license"
        },
        "url": {
          "type": "string",
          "description": "Homepage of this license",
          "format": "uri"
        }
      }
    },
    "php": {
      "description": "Configuration for PHP projects",
      "type": "object",
      "properties": {
        "version": {
          "description": "The PHP version to use for the code analysis",
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "plugin": {
      "description": "A plugin to install for Qodana analysis",
      "type": "object",
      "properties": {
        "id": {
          "description": "The plugin ID to install (can be copied from the plugin page on the JetBrains Marketplace)",
          "type": "string",
          "minLength": 1
        }
      }
    },
    "severityThresholds": {
      "type": "object",
      "description": "Configures maximum thresholds for different problem severities. Absent properties are not checked. If a baseline is given, only new results are counted",
      "properties": {
        "any": {
          "type": "integer",
          "default": null,
          "description": "The run fails if the total amount of results exceeds this number."
        },
        "critical": {
          "type": "integer",
          "default": null,
          "description": "The run fails if the amount results with severity CRITICAL exceeds this number."
        },
        "high": {
          "type": "integer",
          "default": null,
          "description": "The run fails if the amount results with severity HIGH exceeds this number."
        },
        "moderate": {
          "type": "integer",
          "default": null,
          "description": "The run fails if the amount results with severity MODERATE exceeds this number."
        },
        "low": {
          "type": "integer",
          "default": null,
          "description": "The run fails if the amount results with severity LOW exceeds this number."
        },
        "info": {
          "type": "integer",
          "default": null,
          "description": "The run fails if the amount results with severity INFO exceeds this number."
        }
      }
    },
    "coverageThresholds": {
      "type": "object",
      "description": "Configures minimum thresholds for test coverage metrics. Absent properties are not checked",
      "properties": {
        "total": {
          "type": "integer",
          "default": null,
          "description": "The run fails if the percentage of total lines covered is lower than this number."
        },
        "fresh": {
          "type": "integer",
          "default": null,
          "description": "The run fails if the percentage of fresh lines covered is lower than this number"
        }
      }
    },
    "failureConditions": {
      "type": "object",
      "properties": {
        "severityThresholds": {
          "$ref": "#/$defs/severityThresholds",
          "default": null
        },
        "testCoverageThresholds": {
          "$ref": "#/$defs/coverageThresholds",
          "default": null
        }
      }
    }
  }
}
