Zum Inhalt

ruleset.json

Die ruleset.json ist eine Konfigurationsdatei für Code Analyzer Richtlinien. Damit kann gesteuert werden, welche Richtlinien unterdrückt oder auch herab- bzw. hochgestuft werden. Zusätzlich kann dort auch eine Begründung hinterlegt werden, warum eine Richtlinie so konfiguriert wird. Um die Handhabung der Richtlinien besser zu gestalten, verwenden wir die ruleset.json.

Da es für jedes Projekt nochmal spezielle Konfigurationen für die Richtlinien gibt wurde in dieser Beispieldatei "Project Name" als Platzhalter verwendet. Dort sollte dann der Projektname stehen.

So sieht die aktuelle ruleset.json aus:

ruleset.json
{
    "description": "Ruleset for <Project Name>",
    "name": "Ruleset",
    "rules": [
        {
            "action": "None",
            "id": "AA0205",
            "justification": "Variables in AL always have an initial value, so explicit initialization is not necessary."
        },
        {
            "action": "Hidden",
            "id": "AA0210",
            "justification": "Fields without a key can also be filtered on. This rule is only informational."
        },
        {
            "action": "None",
            "id": "AA0215",
            "justification": "Filename without suffix is allowed and should not trigger this rule. It is disabled as long as this condition is met."
        },
        {
            "action": "None",
            "id": "AA0247",
            "justification": "The added value of namespaces is not yet sufficiently clarified and there are still open questions about it, so this rule is suppressed."
        },
        {
            "action": "None",
            "id": "AS0092",
            "justification": "Telemetry is not used for every AppSource app."
        },
        {
            "action": "None",
            "id": "AC0013",
            "justification": "Field groups are not necessary for most objects. For setup tables, field groups are not meaningful, since setup tables are usually not used in the context of a dropdown."
        },
        {
            "action": "None",
            "id": "AC0015",
            "justification": "ToolTips can also start with other terms. This rule originates from Microsoft's guidelines for the User assistance model."
        },
        {
            "action": "None",
            "id": "AC0026",
            "justification": "The default value is sufficient in most cases and does not need to be set explicitly."
        },
        {
            "action": "None",
            "id": "AC0030",
            "justification": "Calling .Get() without checking the return value is common practice for setup tables. If these tables do not exist, an error should be raised."
        },
        {
            "action": "None",
            "id": "AC0031",
            "justification": "This rule also applies to table and page extensions, which do not have a Permissions property, so the rule cannot be satisfied there. It was decided internally to fully suppress this rule. Note: if indirect permissions are granted and not reflected in code, this can still lead to a permission error."
        },
        {
            "action": "None",
            "id": "DC0007",
            "justification": "XML Documentation on public objects and members is not mandatory."
        },
        {
            "action": "None",
            "id": "PC0030",
            "justification": "This rule does not apply correctly for database write opperations, leading to unwanted JIT-Loads."
        },
        {
            "action": "None",
            "id": "PC0037",
            "justification": "Validate checks are not always necessary and can be safely omitted in certain scenarios."
        },
        {
            "action": "None",
            "id": "PC0038",
            "justification": "Not all code paths need to return a value as there is a default return value in AL code."
        },
        {
            "action": "None",
            "id": "LC0010",
            "justification": "Cyclomatic complexity is not a suitable metric for checking code complexity. This is better covered by rule LC0090."
        },
        {
            "action": "None",
            "id": "LC0098",
            "justification": "Different naming conventions are used in the code base, so this rule is suppressed."
        },
        {
            "action": "None",
            "id": "LC0099",
            "justification": "Unreferenced event subscriber parameters are allowed and do not need to be removed."
        }
    ]
}