From 794ff872df3453f17a0cc281dd1d42df2eb3059c Mon Sep 17 00:00:00 2001 From: ad-shreya <159111757+ad-shreya@users.noreply.github.com> Date: Thu, 20 Mar 2025 13:16:29 +0530 Subject: [PATCH 1/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index afcda4a66..61069a4f3 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Salesforce DX Project: Next Steps - +test Now that you’ve created a Salesforce DX project, what’s next? Here are some documentation resources to get you started. ## How Do You Plan to Deploy Your Changes? From 93594e262d0a6d2699e7b5a498896cd75a554ecc Mon Sep 17 00:00:00 2001 From: ad-shreya <159111757+ad-shreya@users.noreply.github.com> Date: Thu, 20 Mar 2025 13:34:56 +0530 Subject: [PATCH 2/7] Create code-analyser-v5.yml --- .github/workflows/code-analyser-v5.yml | 54 ++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/code-analyser-v5.yml diff --git a/.github/workflows/code-analyser-v5.yml b/.github/workflows/code-analyser-v5.yml new file mode 100644 index 000000000..d5be6332a --- /dev/null +++ b/.github/workflows/code-analyser-v5.yml @@ -0,0 +1,54 @@ +name: Run Code Analyzer 5 Workflow +on: + workflow_dispatch: + inputs: + config_branch: + description: 'Config branch' + required: false + default: '' + + +jobs: + salesforce-code-analyzer-workflow: + runs-on: ubuntu-latest + steps: + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: '>=20' + + + - name: Check out files + uses: actions/checkout@v4 + + + - name: Checkout config file from target branch + if: ${{ inputs.config_branch != '' }} + run: | + cd $GITHUB_WORKSPACE + git fetch + git checkout origin/${{inputs.config_branch}} .github/workflows/config/code-analyzer-config.yml + + - name: Install Salesforce CLI + run: npm install -g @salesforce/cli@latest + + + - name: Setup Code Analyzer 5 + run: sf plugins install code-analyzer@latest + + - name: Run Code analyzer + id: run-code-analyzer + uses: forcedotcom/run-code-analyzer@v2 + with: + run-arguments: --workspace . --config-file .github/workflows/config/code-analyzer-config.yml --output-file results.html + results-artifact-name: salesforce-code-analyzer-v5-results + + + + + - name: Check the outputs to determine whether to fail + if: | + steps.run-code-analyzer.outputs.exit-code > 0 || + steps.run-code-analyzer.outputs.num-sev1-violations > 0 || + steps.run-code-analyzer.outputs.num-violations > 10 + run: exit 1 From 2e26ee9b484807791e6b73f0efe37af577a3e99b Mon Sep 17 00:00:00 2001 From: ad-shreya <159111757+ad-shreya@users.noreply.github.com> Date: Thu, 20 Mar 2025 13:37:43 +0530 Subject: [PATCH 3/7] Create sync-code-analyser-tests.yml --- .../workflows/sync-code-analyser-tests.yml | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/sync-code-analyser-tests.yml diff --git a/.github/workflows/sync-code-analyser-tests.yml b/.github/workflows/sync-code-analyser-tests.yml new file mode 100644 index 000000000..634bf8746 --- /dev/null +++ b/.github/workflows/sync-code-analyser-tests.yml @@ -0,0 +1,26 @@ +name: Sync Code Analyzer Tests Workflow +on: workflow_dispatch +jobs: + salesforce-code-analyzer-workflow: + runs-on: ubuntu-latest + steps: + - name: Check out files + uses: actions/checkout@v4 + + + - name: Install Salesforce CLI + run: npm install -g @salesforce/cli@latest + + + - name: Setup Code Analyzer 5 + run: sf plugins install code-analyzer + + + - name: Get Code Analyzer V5 rules + run: sf code-analyzer rules --config-file .github/workflows/config/code-analyzer-config.yml --rule-selector=all -v table > ca-v5-rules.txt + + + - uses: actions/upload-artifact@v4 + with: + name: code-analyser5-tests + path: ./ca-v5-rules.txt From d211e86add2a2df50c1259ff8b71751de63799ca Mon Sep 17 00:00:00 2001 From: ad-shreya <159111757+ad-shreya@users.noreply.github.com> Date: Thu, 20 Mar 2025 13:38:10 +0530 Subject: [PATCH 4/7] Create code-analyser.yml --- .github/workflows/code-analyser.yml | 1615 +++++++++++++++++++++++++++ 1 file changed, 1615 insertions(+) create mode 100644 .github/workflows/code-analyser.yml diff --git a/.github/workflows/code-analyser.yml b/.github/workflows/code-analyser.yml new file mode 100644 index 000000000..f93a05ffc --- /dev/null +++ b/.github/workflows/code-analyser.yml @@ -0,0 +1,1615 @@ +# ====================================================================== +# CODE ANALYZER CONFIGURATION +# To learn more about this configuration, visit: +# https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/config-custom.html +# ====================================================================== + +# The absolute folder path to which all other path values in this configuration may be relative to. +# If unspecified, or if specified as null, then the value is automatically chosen to be the parent folder of your Code Analyzer +# configuration file if it exists, or the current working directory otherwise. +config_root: null # Last calculated by the config command as: "/Users/ashreya/Project2" + +# Folder where to store log files. May be an absolute path or a path relative to config_root. +# If unspecified, or if specified as null, then the value is automatically chosen to be your machine's default temporary directory. +log_folder: null # Last calculated by the config command as: "/var/folders/by/d7c9tw_j0w7b3r4h4thf62zc0000gn/T" + +# Rule override settings of the format rules.{engine_name}.{rule_name}.{property_name} = {override_value} where: +# {engine_name} is the name of the engine containing the rule that you want to override. +# {rule_name} is the name of the rule that you want to override. +# {property_name} can either be: +# 'severity' - [Optional] The severity level value that you want to use to override the default severity level for the rule +# Possible values: 1 or 'Critical', 2 or 'High', 3 or 'Moderate', 4 or 'Low', 5 or 'Info' +# 'tags' - [Optional] The string array of tag values that you want to use to override the default tags for the rule +# ---- [Example usage]: --------------------- +# rules: +# eslint: +# sort-vars: +# severity: "Info" +# tags: ["Recommended", "Suggestion"] +# ------------------------------------------- +rules: + + # ====================================================================== + # ESLINT ENGINE RULE OVERRIDES + # ====================================================================== + eslint: + "@lwc/lwc-platform/no-aura": + severity: 3 + tags: + - Recommended + - LWC + - ErrorProne + - Javascript + "@lwc/lwc-platform/no-aura-libs": + severity: 3 + tags: + - Recommended + - LWC + - ErrorProne + - Javascript + "@lwc/lwc-platform/no-community-import": + severity: 3 + tags: + - Recommended + - LWC + - ErrorProne + - Javascript + "@lwc/lwc-platform/no-create-context-provider": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-deprecated-module-import": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-dynamic-import-identifier": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-forcegen-namespace": + severity: 3 + tags: + - Recommended + - LWC + - ErrorProne + - Javascript + "@lwc/lwc-platform/no-inline-disable": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-interop": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-interop-create": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-interop-dispatch": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-interop-execute": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-interop-execute-privileged": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-interop-execute-raw-response": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-interop-get-event": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-interop-get-module": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-interop-is-external-definition": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-interop-load-definitions": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-interop-module-instrumentation": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-interop-module-storage": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-interop-register": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-interop-render": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-interop-sanitize": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-process-env": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-site-import": + severity: 3 + tags: + - Recommended + - LWC + - ErrorProne + - Javascript + "@lwc/lwc-platform/no-wire-service": + severity: 3 + tags: + - Recommended + - LWC + - ErrorProne + - Javascript + "@lwc/lwc-platform/valid-dynamic-import-hint": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc/no-api-reassignments": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc/no-async-operation": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc/no-attributes-during-construction": + severity: 3 + tags: + - Recommended + - LWC + - ErrorProne + - Javascript + "@lwc/lwc/no-deprecated": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc/no-disallowed-lwc-imports": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc/no-document-query": + severity: 3 + tags: + - Recommended + - LWC + - ErrorProne + - Javascript + "@lwc/lwc/no-inner-html": + severity: 2 + tags: + - Recommended + - LWC + - Security + - Javascript + "@lwc/lwc/no-leading-uppercase-api-name": + severity: 3 + tags: + - Recommended + - LWC + - ErrorProne + - Javascript + "@lwc/lwc/no-template-children": + severity: 3 + tags: + - Recommended + - LWC + - ErrorProne + - Javascript + "@lwc/lwc/no-unexpected-wire-adapter-usages": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc/no-unknown-wire-adapters": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc/prefer-custom-event": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc/valid-api": + severity: 3 + tags: + - Recommended + - LWC + - ErrorProne + - Javascript + "@lwc/lwc/valid-graphql-wire-adapter-callback-parameters": + severity: 3 + tags: + - Recommended + - LWC + - ErrorProne + - Javascript + "@lwc/lwc/valid-track": + severity: 3 + tags: + - Recommended + - LWC + - ErrorProne + - Javascript + "@lwc/lwc/valid-wire": + severity: 3 + tags: + - Recommended + - LWC + - ErrorProne + - Javascript + "@salesforce/lightning/valid-apex-method-invocation": + severity: 3 + tags: + - Recommended + - LWC + - ErrorProne + - Javascript + "@typescript-eslint/ban-ts-comment": + severity: 2 + tags: + - Recommended + - ErrorProne + - Typescript + "@typescript-eslint/no-array-constructor": + severity: 3 + tags: + - Recommended + - BestPractices + - Typescript + "@typescript-eslint/no-duplicate-enum-values": + severity: 2 + tags: + - Recommended + - ErrorProne + - Typescript + "@typescript-eslint/no-empty-object-type": + severity: 3 + tags: + - Recommended + - BestPractices + - Typescript + "@typescript-eslint/no-explicit-any": + severity: 3 + tags: + - Recommended + - BestPractices + - Typescript + "@typescript-eslint/no-extra-non-null-assertion": + severity: 2 + tags: + - Recommended + - ErrorProne + - Typescript + "@typescript-eslint/no-misused-new": + severity: 2 + tags: + - Recommended + - ErrorProne + - Typescript + "@typescript-eslint/no-namespace": + severity: 3 + tags: + - Recommended + - BestPractices + - Typescript + "@typescript-eslint/no-non-null-asserted-optional-chain": + severity: 2 + tags: + - Recommended + - ErrorProne + - Typescript + "@typescript-eslint/no-require-imports": + severity: 2 + tags: + - Recommended + - ErrorProne + - Typescript + "@typescript-eslint/no-this-alias": + severity: 3 + tags: + - Recommended + - BestPractices + - Typescript + "@typescript-eslint/no-unnecessary-type-constraint": + severity: 3 + tags: + - Recommended + - BestPractices + - Typescript + "@typescript-eslint/no-unsafe-declaration-merging": + severity: 2 + tags: + - Recommended + - ErrorProne + - Typescript + "@typescript-eslint/no-unsafe-function-type": + severity: 2 + tags: + - Recommended + - ErrorProne + - Typescript + "@typescript-eslint/no-unused-expressions": + severity: 3 + tags: + - Recommended + - BestPractices + - Typescript + "@typescript-eslint/no-unused-vars": + severity: 2 + tags: + - Recommended + - ErrorProne + - Typescript + "@typescript-eslint/no-wrapper-object-types": + severity: 2 + tags: + - Recommended + - ErrorProne + - Typescript + "@typescript-eslint/prefer-as-const": + severity: 3 + tags: + - Recommended + - BestPractices + - Typescript + "@typescript-eslint/prefer-namespace-keyword": + severity: 3 + tags: + - Recommended + - BestPractices + - Typescript + "@typescript-eslint/triple-slash-reference": + severity: 3 + tags: + - Recommended + - BestPractices + - Typescript + "constructor-super": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + "for-direction": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "getter-return": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + "no-async-promise-executor": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-case-declarations": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + - Typescript + "no-class-assign": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + "no-compare-neg-zero": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-cond-assign": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-const-assign": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + "no-constant-condition": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-control-regex": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-debugger": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-delete-var": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + - Typescript + "no-dupe-args": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + "no-dupe-class-members": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + "no-dupe-else-if": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-dupe-keys": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + "no-duplicate-case": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-empty": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + - Typescript + "no-empty-character-class": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-empty-pattern": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-ex-assign": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-extra-boolean-cast": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + - Typescript + "no-fallthrough": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-func-assign": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + "no-global-assign": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + - Typescript + "no-import-assign": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + "no-inner-declarations": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-invalid-regexp": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-irregular-whitespace": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-loss-of-precision": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-misleading-character-class": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-new-symbol": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + "no-nonoctal-decimal-escape": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + - Typescript + "no-obj-calls": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + "no-octal": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-prototype-builtins": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-redeclare": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + "no-regex-spaces": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + - Typescript + "no-self-assign": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-setter-return": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + "no-shadow-restricted-names": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + - Typescript + "no-sparse-arrays": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-this-before-super": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + "no-undef": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + "no-unexpected-multiline": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-unreachable": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + "no-unsafe-finally": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-unsafe-negation": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + "no-unsafe-optional-chaining": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-unused-labels": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + - Typescript + "no-unused-vars": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + "no-useless-backreference": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-useless-catch": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + - Typescript + "no-useless-escape": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + - Typescript + "no-var": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + - Typescript + "no-with": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + - Typescript + "prefer-const": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + - Typescript + "prefer-rest-params": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + - Typescript + "prefer-spread": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + - Typescript + "require-yield": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + - Typescript + "use-isnan": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "valid-typeof": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + + # ====================================================================== + # RETIRE-JS ENGINE RULE OVERRIDES + # ====================================================================== + retire-js: + "LibraryWithKnownCriticalSeverityVulnerability": + severity: 1 + tags: + - Recommended + - Security + - Javascript + "LibraryWithKnownHighSeverityVulnerability": + severity: 2 + tags: + - Recommended + - Security + - Javascript + "LibraryWithKnownMediumSeverityVulnerability": + severity: 3 + tags: + - Recommended + - Security + - Javascript + "LibraryWithKnownLowSeverityVulnerability": + severity: 4 + tags: + - Recommended + - Security + - Javascript + + # ====================================================================== + # REGEX ENGINE RULE OVERRIDES + # ====================================================================== + regex: + "NoTrailingWhitespace": + severity: 5 + tags: + - Recommended + - CodeStyle + - Apex + "AvoidTermsWithImplicitBias": + severity: 5 + tags: + - Recommended + - BestPractices + "AvoidOldSalesforceApiVersions": + severity: 2 + tags: + - Recommended + - Security + - Xml + "AvoidGetHeapSizeInLoop": + severity: 2 + tags: + - Recommended + - Performance + - Apex + "MinVersionForAbstractVirtualClassesWithPrivateMethod": + severity: 2 + tags: + - Recommended + - BestPractices + - Apex + + # ====================================================================== + # PMD ENGINE RULE OVERRIDES + # ====================================================================== + pmd: + "ApexBadCrypto": + severity: 2 + tags: + - Recommended + - Security + - Apex + "ApexCRUDViolation": + severity: 2 + tags: + - Recommended + - Security + - Apex + "ApexCSRF": + severity: 1 + tags: + - Recommended + - Security + - Apex + "ApexDangerousMethods": + severity: 3 + tags: + - Recommended + - Security + - Apex + "ApexDoc": + severity: 4 + tags: + - Recommended + - Documentation + - Apex + "ApexInsecureEndpoint": + severity: 2 + tags: + - Recommended + - Security + - Apex + "ApexOpenRedirect": + severity: 2 + tags: + - Recommended + - Security + - Apex + "ApexSharingViolations": + severity: 3 + tags: + - Recommended + - Security + - Apex + "ApexSOQLInjection": + severity: 2 + tags: + - Recommended + - Security + - Apex + "ApexSuggestUsingNamedCred": + severity: 2 + tags: + - Recommended + - Security + - Apex + "ApexUnitTestClassShouldHaveAsserts": + severity: 3 + tags: + - Recommended + - BestPractices + - Apex + "ApexUnitTestClassShouldHaveRunAs": + severity: 4 + tags: + - Recommended + - BestPractices + - Apex + "ApexUnitTestMethodShouldHaveIsTestAnnotation": + severity: 2 + tags: + - Recommended + - BestPractices + - Apex + "ApexUnitTestShouldNotUseSeeAllDataTrue": + severity: 2 + tags: + - Recommended + - BestPractices + - Apex + "ApexXSSFromEscapeFalse": + severity: 2 + tags: + - Recommended + - Security + - Apex + "ApexXSSFromURLParam": + severity: 2 + tags: + - Recommended + - Security + - Apex + "AvoidDebugStatements": + severity: 4 + tags: + - Recommended + - Performance + - Apex + "AvoidDeeplyNestedIfStmts": + severity: 3 + tags: + - Recommended + - Design + - Apex + "AvoidDirectAccessTriggerMap": + severity: 3 + tags: + - Recommended + - ErrorProne + - Apex + "AvoidGlobalModifier": + severity: 3 + tags: + - Recommended + - BestPractices + - Apex + "AvoidHardcodingId": + severity: 3 + tags: + - Recommended + - ErrorProne + - Apex + "AvoidLogicInTrigger": + severity: 3 + tags: + - Recommended + - BestPractices + - Apex + "AvoidNonExistentAnnotations": + severity: 4 + tags: + - Recommended + - ErrorProne + - Apex + "AvoidNonRestrictiveQueries": + severity: 4 + tags: + - Recommended + - Performance + - Apex + "ClassNamingConventions": + severity: 3 + tags: + - Recommended + - CodeStyle + - Apex + "CognitiveComplexity": + severity: 3 + tags: + - Recommended + - Design + - Apex + "CyclomaticComplexity": + severity: 3 + tags: + - Recommended + - Design + - Apex + "DebugsShouldUseLoggingLevel": + severity: 4 + tags: + - Recommended + - BestPractices + - Apex + "EagerlyLoadedDescribeSObjectResult": + severity: 2 + tags: + - Recommended + - Performance + - Apex + "EmptyCatchBlock": + severity: 2 + tags: + - Recommended + - ErrorProne + - Apex + "EmptyIfStmt": + severity: 3 + tags: + - Recommended + - ErrorProne + - Apex + "EmptyStatementBlock": + severity: 3 + tags: + - Recommended + - ErrorProne + - Apex + "EmptyTryOrFinallyBlock": + severity: 3 + tags: + - Recommended + - ErrorProne + - Apex + "EmptyWhileStmt": + severity: 3 + tags: + - Recommended + - ErrorProne + - Apex + "ExcessiveClassLength": + severity: 3 + tags: + - Recommended + - Design + - Apex + "ExcessiveParameterList": + severity: 3 + tags: + - Recommended + - Design + - Apex + "ExcessivePublicCount": + severity: 3 + tags: + - Recommended + - Design + - Apex + "FieldDeclarationsShouldBeAtStart": + severity: 3 + tags: + - Recommended + - CodeStyle + - Apex + "FieldNamingConventions": + severity: 3 + tags: + - Recommended + - CodeStyle + - Apex + "ForLoopsMustUseBraces": + severity: 3 + tags: + - Recommended + - CodeStyle + - Apex + "FormalParameterNamingConventions": + severity: 3 + tags: + - Recommended + - CodeStyle + - Apex + "IfElseStmtsMustUseBraces": + severity: 3 + tags: + - Recommended + - CodeStyle + - Apex + "IfStmtsMustUseBraces": + severity: 3 + tags: + - Recommended + - CodeStyle + - Apex + "InaccessibleAuraEnabledGetter": + severity: 3 + tags: + - Recommended + - ErrorProne + - Apex + "LocalVariableNamingConventions": + severity: 3 + tags: + - Recommended + - CodeStyle + - Apex + "MethodNamingConventions": + severity: 3 + tags: + - Recommended + - CodeStyle + - Apex + "MethodWithSameNameAsEnclosingClass": + severity: 3 + tags: + - Recommended + - ErrorProne + - Apex + "NcssConstructorCount": + severity: 4 + tags: + - Recommended + - Design + - Apex + "NcssMethodCount": + severity: 4 + tags: + - Recommended + - Design + - Apex + "OneDeclarationPerLine": + severity: 3 + tags: + - Recommended + - CodeStyle + - Apex + "OperationWithHighCostInLoop": + severity: 3 + tags: + - Recommended + - Performance + - Apex + "OperationWithLimitsInLoop": + severity: 3 + tags: + - Recommended + - Performance + - Apex + "OverrideBothEqualsAndHashcode": + severity: 2 + tags: + - Recommended + - ErrorProne + - Apex + "PropertyNamingConventions": + severity: 3 + tags: + - Recommended + - CodeStyle + - Apex + "QueueableWithoutFinalizer": + severity: 4 + tags: + - Recommended + - BestPractices + - Apex + "TestMethodsMustBeInTestClasses": + severity: 3 + tags: + - Recommended + - ErrorProne + - Apex + "TooManyFields": + severity: 3 + tags: + - Recommended + - Design + - Apex + "UnusedLocalVariable": + severity: 3 + tags: + - Recommended + - BestPractices + - Apex + "UnusedMethod": + severity: 3 + tags: + - Recommended + - Design + - Apex + "VfCsrf": + severity: 2 + tags: + - Recommended + - Security + - Visualforce + "VfHtmlStyleTagXss": + severity: 2 + tags: + - Recommended + - Security + - Visualforce + "VfUnescapeEl": + severity: 2 + tags: + - Recommended + - Security + - Visualforce + "WhileLoopsMustUseBraces": + severity: 3 + tags: + - Recommended + - CodeStyle + - Apex + + # ====================================================================== + # CPD ENGINE RULE OVERRIDES + # ====================================================================== + cpd: + "DetectCopyPasteForApex": + severity: 5 + tags: + - Recommended + - Design + - Apex + "DetectCopyPasteForJavascript": + severity: 5 + tags: + - Recommended + - Design + - Javascript + "DetectCopyPasteForTypescript": + severity: 5 + tags: + - Recommended + - Design + - Typescript + "DetectCopyPasteForVisualforce": + severity: 5 + tags: + - Recommended + - Design + - Visualforce + + # ====================================================================== + # FLOWTEST ENGINE RULE OVERRIDES + # ====================================================================== + flowtest: + "PreventPassingUserDataIntoElementWithoutSharing": + severity: 2 + tags: + - Recommended + - Security + - Xml + "PreventPassingUserDataIntoElementWithSharing": + severity: 4 + tags: + - Recommended + - Security + - Xml + +# Engine specific custom configuration settings of the format engines.{engine_name}.{property_name} = {value} where: +# {engine_name} is the name of the engine containing the setting that you want to override. +# {property_name} is the name of a property that you would like to override. +# Each engine may have its own set of properties available to help customize that particular engine's behavior. +engines: + + # ====================================================================== + # ESLINT ENGINE CONFIGURATION + # To learn more about this configuration, visit: + # https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/engine-eslint.html#eslint-configuration-reference + # ====================================================================== + eslint: + + # Whether to turn off the 'eslint' engine so that it is not included when running Code Analyzer commands. + disable_engine: false + + # Your project's main ESLint configuration file. May be an absolute path or a path relative to the config_root. + # If null and auto_discover_eslint_config is true, then Code Analyzer will attempt to discover/apply it automatically. + # Currently only legacy ESLInt config files are supported. + # See https://eslint.org/docs/v8.x/use/configure/configuration-files to learn more. + eslint_config_file: null + + # Your project's ".eslintignore" file. May be an absolute path or a path relative to the config_root. + # If null and auto_discover_eslint_config is true, then Code Analyzer will attempt to discover/apply it automatically. + # See https://eslint.org/docs/v8.x/use/configure/ignore#the-eslintignore-file to learn more. + eslint_ignore_file: null + + # Whether to have Code Analyzer automatically discover/apply any ESLint configuration and ignore files from your workspace. + auto_discover_eslint_config: false + + # Whether to turn off the default base configuration that supplies the standard ESLint rules for JavaScript files. + disable_javascript_base_config: false + + # Whether to turn off the default base configuration that supplies the LWC rules for JavaScript files. + disable_lwc_base_config: false + + # Whether to turn off the default base configuration that supplies the standard rules for TypeScript files. + disable_typescript_base_config: false + + # Extensions of the files in your workspace that will be used to discover rules. + # To associate file extensions to the standard ESLint JavaScript rules, LWC rules, or custom JavaScript-based + # rules, add them under the 'javascript' language. To associate file extensions to the standard TypeScript + # rules or custom TypeScript-based rules, add them under the 'typescript' language. To allow for the + # discovery of custom rules that are associated with any other language, then add the associated file + # extensions under the 'other' language. + file_extensions: + javascript: + - .js + - .cjs + - .mjs + typescript: + - .ts + other: [] + + # ====================================================================== + # RETIRE-JS ENGINE CONFIGURATION + # To learn more about this configuration, visit: + # https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/engine-retire-js.html#retirejs-configuration-reference + # ====================================================================== + retire-js: + + # Whether to turn off the 'retire-js' engine so that it is not included when running Code Analyzer commands. + disable_engine: false + + # ====================================================================== + # REGEX ENGINE CONFIGURATION + # To learn more about this configuration, visit: + # https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/engine-regex.html#regex-configuration-reference + # ====================================================================== + regex: + + # Whether to turn off the 'regex' engine so that it is not included when running Code Analyzer commands. + disable_engine: false + + # Custom rules to be added to the 'regex' engine of the format custom_rules.{rule_name}.{rule_property_name} = {value} where: + # {rule_name} is the name you would like to give to your custom rule + # {rule_property_name} is the name of one of the rule properties. You may specify the following rule properties: + # 'regex' - The regular expression that triggers a violation when matched against the contents of a file. + # 'file_extensions' - The extensions of the files that you would like to test the regular expression against. + # 'description' - A description of the rule's purpose + # 'violation_message' - [Optional] The message emitted when a rule violation occurs. + # This message is intended to help the user understand the violation. + # Default: 'A match of the regular expression {regex} was found for rule {rule_name}: {description}' + # 'severity' - [Optional] The severity level to apply to this rule by default. + # Possible values: 1 or 'Critical', 2 or 'High', 3 or 'Moderate', 4 or 'Low', 5 or 'Info' + # Default: 3 + # 'tags' - [Optional] The string array of tag values to apply to this rule by default. + # Default: ['Recommended'] + # ---- [Example usage]: --------------------- + # engines: + # regex: + # custom_rules: + # "NoTodoComments": + # regex: /\/\/[ \t]*TODO/gi + # file_extensions: [".apex", ".cls", ".trigger"] + # description: "Prevents TODO comments from being in apex code." + # violation_message: "A comment with a TODO statement was found. Please remove TODO statements from your apex code." + # severity: "Info" + # tags: ["TechDebt"] + # ------------------------------------------- + custom_rules: {} + + # ====================================================================== + # PMD ENGINE CONFIGURATION + # To learn more about this configuration, visit: + # https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/engine-pmd.html#pmd-configuration-reference + # ====================================================================== + pmd: + + # Whether to turn off the 'pmd' engine so that it is not included when running Code Analyzer commands. + disable_engine: false + + # Indicates the specific 'java' command associated with the JRE or JDK to use for the 'pmd' engine. + # May be provided as the name of a command that exists on the path, or an absolute file path location. + # If unspecified, or specified as null, then an attempt will be made to automatically discover a 'java' command from your environment. + java_command: null # Last calculated by the config command as: "java" + + # Specifies the list of file extensions to associate to each rule language. + # The rule(s) associated with a given language will run against all the files in your workspace containing one of + # the specified file extensions. Each file extension can only be associated to one language. If a specific language + # is not specified, then a set of default file extensions for that language will be used. + file_extensions: + apex: + - .cls + - .trigger + html: + - .html + - .htm + - .xhtml + - .xht + - .shtml + - .cmp + javascript: + - .js + - .cjs + - .mjs + typescript: + - .ts + visualforce: + - .page + - .component + xml: + - .xml + + # List of jar files and/or folders to add the Java classpath when running PMD. + # Each entry may be given as an absolute path or a relative path to 'config_root'. + # This field is primarily used to supply custom Java based rule definitions to PMD. + # See https://pmd.github.io/pmd/pmd_userdocs_extending_writing_java_rules.html + java_classpath_entries: [] + + # List of xml ruleset files containing custom PMD rules to be made available for rule selection. + # Each ruleset must be an xml file that is either: + # - on disk (provided as an absolute path or a relative path to 'config_root') + # - or a relative resource found on the Java classpath. + # Not all custom rules can be fully defined within an xml ruleset file. For example, Java based rules may be defined in jar files. + # In these cases, you will need to also add your additional files to the Java classpath using the 'java_classpath_entries' field. + # See https://pmd.github.io/pmd/pmd_userdocs_making_rulesets.html to learn more about PMD rulesets. + custom_rulesets: [] + + # ====================================================================== + # CPD ENGINE CONFIGURATION + # To learn more about this configuration, visit: + # https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/engine-cpd.html#cpd-configuration-reference + # ====================================================================== + cpd: + + # Whether to turn off the 'cpd' engine so that it is not included when running Code Analyzer commands. + disable_engine: false + + # Indicates the specific 'java' command associated with the JRE or JDK to use for the 'cpd' engine. + # May be provided as the name of a command that exists on the path, or an absolute file path location. + # If unspecified, or specified as null, then an attempt will be made to automatically discover a 'java' command from your environment. + java_command: null # Last calculated by the config command as: "java" + + # Specifies the list of file extensions to associate to each rule language. + # The rule(s) associated with a given language will run against all the files in your workspace containing one of + # the specified file extensions. Each file extension can only be associated to one language. If a specific language + # is not specified, then a set of default file extensions for that language will be used. + file_extensions: + apex: + - .cls + - .trigger + html: + - .html + - .htm + - .xhtml + - .xht + - .shtml + - .cmp + javascript: + - .js + - .cjs + - .mjs + typescript: + - .ts + visualforce: + - .page + - .component + xml: + - .xml + + # Specifies the minimum tokens threshold for each rule language. + # The minimum tokens threshold is the number of tokens required to be in a duplicate block of code in order to be + # reported as a violation. The concept of a token may be defined differently per language, but in general it is a + # distinct basic element of source code. For example, this could be language specific keywords, identifiers, + # operators, literals, and more. See https://docs.pmd-code.org/latest/pmd_userdocs_cpd.html to learn more. + # If a value for a language is unspecified, then the default value of 100 will be used for that language. + minimum_tokens: + apex: 100 + html: 100 + javascript: 100 + typescript: 100 + visualforce: 100 + xml: 100 + + # Indicates whether to ignore multiple copies of files of the same name and length. + skip_duplicate_files: false + + # ====================================================================== + # FLOWTEST ENGINE CONFIGURATION + # To learn more about this configuration, visit: + # https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/engine-flowtest.html#flowtest-configuration-reference + # ====================================================================== + flowtest: + + # Whether to turn off the 'flowtest' engine so that it is not included when running Code Analyzer commands. + disable_engine: false + + # Indicates the specific Python command to use for the 'flowtest' engine. + # May be provided as the name of a command that exists on the path, or an absolute file path location. + # If unspecified, or specified as null, then an attempt will be made to automatically discover a Python command from your environment. + python_command: null # Last calculated by the config command as: "python3" + +# ====================================================================== +# END OF CODE ANALYZER CONFIGURATION +# ====================================================================== From a69e6c48fc19e6eb07cde006704d7173f99910a2 Mon Sep 17 00:00:00 2001 From: ad-shreya <159111757+ad-shreya@users.noreply.github.com> Date: Thu, 20 Mar 2025 13:46:44 +0530 Subject: [PATCH 5/7] Create code-analyzer-config.yml --- .github/workflows/code-analyzer-config.yml | 1615 ++++++++++++++++++++ 1 file changed, 1615 insertions(+) create mode 100644 .github/workflows/code-analyzer-config.yml diff --git a/.github/workflows/code-analyzer-config.yml b/.github/workflows/code-analyzer-config.yml new file mode 100644 index 000000000..b459fc3c7 --- /dev/null +++ b/.github/workflows/code-analyzer-config.yml @@ -0,0 +1,1615 @@ +# ====================================================================== +# CODE ANALYZER CONFIGURATION +# To learn more about this configuration, visit: +# https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/config-custom.html +# ====================================================================== + +# The absolute folder path to which all other path values in this configuration may be relative to. +# If unspecified, or if specified as null, then the value is automatically chosen to be the parent folder of your Code Analyzer +# configuration file if it exists, or the current working directory otherwise. +config_root: null # Last calculated by the config command as: "/Users/ashreya/Project2" + +# Folder where to store log files. May be an absolute path or a path relative to config_root. +# If unspecified, or if specified as null, then the value is automatically chosen to be your machine's default temporary directory. +log_folder: null # Last calculated by the config command as: "/var/folders/by/d7c9tw_j0w7b3r4h4thf62zc0000gn/T" + +# Rule override settings of the format rules.{engine_name}.{rule_name}.{property_name} = {override_value} where: +# {engine_name} is the name of the engine containing the rule that you want to override. +# {rule_name} is the name of the rule that you want to override. +# {property_name} can either be: +# 'severity' - [Optional] The severity level value that you want to use to override the default severity level for the rule +# Possible values: 1 or 'Critical', 2 or 'High', 3 or 'Moderate', 4 or 'Low', 5 or 'Info' +# 'tags' - [Optional] The string array of tag values that you want to use to override the default tags for the rule +# ---- [Example usage]: --------------------- +# rules: +# eslint: +# sort-vars: +# severity: "Info" +# tags: ["Recommended", "Suggestion"] +# ------------------------------------------- +rules: + + # ====================================================================== + # ESLINT ENGINE RULE OVERRIDES + # ====================================================================== + eslint: + "@lwc/lwc-platform/no-aura": + severity: 3 + tags: + - Recommended + - LWC + - ErrorProne + - Javascript + "@lwc/lwc-platform/no-aura-libs": + severity: 3 + tags: + - Recommended + - LWC + - ErrorProne + - Javascript + "@lwc/lwc-platform/no-community-import": + severity: 3 + tags: + - Recommended + - LWC + - ErrorProne + - Javascript + "@lwc/lwc-platform/no-create-context-provider": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-deprecated-module-import": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-dynamic-import-identifier": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-forcegen-namespace": + severity: 3 + tags: + - Recommended + - LWC + - ErrorProne + - Javascript + "@lwc/lwc-platform/no-inline-disable": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-interop": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-interop-create": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-interop-dispatch": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-interop-execute": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-interop-execute-privileged": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-interop-execute-raw-response": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-interop-get-event": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-interop-get-module": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-interop-is-external-definition": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-interop-load-definitions": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-interop-module-instrumentation": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-interop-module-storage": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-interop-register": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-interop-render": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-interop-sanitize": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-process-env": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc-platform/no-site-import": + severity: 3 + tags: + - Recommended + - LWC + - ErrorProne + - Javascript + "@lwc/lwc-platform/no-wire-service": + severity: 3 + tags: + - Recommended + - LWC + - ErrorProne + - Javascript + "@lwc/lwc-platform/valid-dynamic-import-hint": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc/no-api-reassignments": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc/no-async-operation": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc/no-attributes-during-construction": + severity: 3 + tags: + - Recommended + - LWC + - ErrorProne + - Javascript + "@lwc/lwc/no-deprecated": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc/no-disallowed-lwc-imports": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc/no-document-query": + severity: 3 + tags: + - Recommended + - LWC + - ErrorProne + - Javascript + "@lwc/lwc/no-inner-html": + severity: 2 + tags: + - Recommended + - LWC + - Security + - Javascript + "@lwc/lwc/no-leading-uppercase-api-name": + severity: 3 + tags: + - Recommended + - LWC + - ErrorProne + - Javascript + "@lwc/lwc/no-template-children": + severity: 3 + tags: + - Recommended + - LWC + - ErrorProne + - Javascript + "@lwc/lwc/no-unexpected-wire-adapter-usages": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc/no-unknown-wire-adapters": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc/prefer-custom-event": + severity: 3 + tags: + - Recommended + - LWC + - BestPractices + - Javascript + "@lwc/lwc/valid-api": + severity: 3 + tags: + - Recommended + - LWC + - ErrorProne + - Javascript + "@lwc/lwc/valid-graphql-wire-adapter-callback-parameters": + severity: 3 + tags: + - Recommended + - LWC + - ErrorProne + - Javascript + "@lwc/lwc/valid-track": + severity: 3 + tags: + - Recommended + - LWC + - ErrorProne + - Javascript + "@lwc/lwc/valid-wire": + severity: 3 + tags: + - Recommended + - LWC + - ErrorProne + - Javascript + "@salesforce/lightning/valid-apex-method-invocation": + severity: 3 + tags: + - Recommended + - LWC + - ErrorProne + - Javascript + "@typescript-eslint/ban-ts-comment": + severity: 2 + tags: + - Recommended + - ErrorProne + - Typescript + "@typescript-eslint/no-array-constructor": + severity: 3 + tags: + - Recommended + - BestPractices + - Typescript + "@typescript-eslint/no-duplicate-enum-values": + severity: 2 + tags: + - Recommended + - ErrorProne + - Typescript + "@typescript-eslint/no-empty-object-type": + severity: 3 + tags: + - Recommended + - BestPractices + - Typescript + "@typescript-eslint/no-explicit-any": + severity: 3 + tags: + - Recommended + - BestPractices + - Typescript + "@typescript-eslint/no-extra-non-null-assertion": + severity: 2 + tags: + - Recommended + - ErrorProne + - Typescript + "@typescript-eslint/no-misused-new": + severity: 2 + tags: + - Recommended + - ErrorProne + - Typescript + "@typescript-eslint/no-namespace": + severity: 3 + tags: + - Recommended + - BestPractices + - Typescript + "@typescript-eslint/no-non-null-asserted-optional-chain": + severity: 2 + tags: + - Recommended + - ErrorProne + - Typescript + "@typescript-eslint/no-require-imports": + severity: 2 + tags: + - Recommended + - ErrorProne + - Typescript + "@typescript-eslint/no-this-alias": + severity: 3 + tags: + - Recommended + - BestPractices + - Typescript + "@typescript-eslint/no-unnecessary-type-constraint": + severity: 3 + tags: + - Recommended + - BestPractices + - Typescript + "@typescript-eslint/no-unsafe-declaration-merging": + severity: 2 + tags: + - Recommended + - ErrorProne + - Typescript + "@typescript-eslint/no-unsafe-function-type": + severity: 2 + tags: + - Recommended + - ErrorProne + - Typescript + "@typescript-eslint/no-unused-expressions": + severity: 3 + tags: + - Recommended + - BestPractices + - Typescript + "@typescript-eslint/no-unused-vars": + severity: 2 + tags: + - Recommended + - ErrorProne + - Typescript + "@typescript-eslint/no-wrapper-object-types": + severity: 2 + tags: + - Recommended + - ErrorProne + - Typescript + "@typescript-eslint/prefer-as-const": + severity: 3 + tags: + - Recommended + - BestPractices + - Typescript + "@typescript-eslint/prefer-namespace-keyword": + severity: 3 + tags: + - Recommended + - BestPractices + - Typescript + "@typescript-eslint/triple-slash-reference": + severity: 3 + tags: + - Recommended + - BestPractices + - Typescript + "constructor-super": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + "for-direction": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "getter-return": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + "no-async-promise-executor": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-case-declarations": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + - Typescript + "no-class-assign": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + "no-compare-neg-zero": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-cond-assign": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-const-assign": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + "no-constant-condition": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-control-regex": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-debugger": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-delete-var": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + - Typescript + "no-dupe-args": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + "no-dupe-class-members": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + "no-dupe-else-if": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-dupe-keys": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + "no-duplicate-case": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-empty": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + - Typescript + "no-empty-character-class": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-empty-pattern": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-ex-assign": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-extra-boolean-cast": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + - Typescript + "no-fallthrough": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-func-assign": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + "no-global-assign": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + - Typescript + "no-import-assign": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + "no-inner-declarations": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-invalid-regexp": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-irregular-whitespace": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-loss-of-precision": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-misleading-character-class": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-new-symbol": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + "no-nonoctal-decimal-escape": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + - Typescript + "no-obj-calls": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + "no-octal": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-prototype-builtins": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-redeclare": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + "no-regex-spaces": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + - Typescript + "no-self-assign": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-setter-return": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + "no-shadow-restricted-names": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + - Typescript + "no-sparse-arrays": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-this-before-super": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + "no-undef": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + "no-unexpected-multiline": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-unreachable": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + "no-unsafe-finally": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-unsafe-negation": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + "no-unsafe-optional-chaining": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-unused-labels": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + - Typescript + "no-unused-vars": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + "no-useless-backreference": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "no-useless-catch": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + - Typescript + "no-useless-escape": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + - Typescript + "no-var": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + - Typescript + "no-with": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + - Typescript + "prefer-const": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + - Typescript + "prefer-rest-params": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + - Typescript + "prefer-spread": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + - Typescript + "require-yield": + severity: 3 + tags: + - Recommended + - BestPractices + - Javascript + - Typescript + "use-isnan": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + "valid-typeof": + severity: 2 + tags: + - Recommended + - ErrorProne + - Javascript + - Typescript + + # ====================================================================== + # RETIRE-JS ENGINE RULE OVERRIDES + # ====================================================================== + retire-js: + "LibraryWithKnownCriticalSeverityVulnerability": + severity: 1 + tags: + - Recommended + - Security + - Javascript + "LibraryWithKnownHighSeverityVulnerability": + severity: 2 + tags: + - Recommended + - Security + - Javascript + "LibraryWithKnownMediumSeverityVulnerability": + severity: 3 + tags: + - Recommended + - Security + - Javascript + "LibraryWithKnownLowSeverityVulnerability": + severity: 4 + tags: + - Recommended + - Security + - Javascript + + # ====================================================================== + # REGEX ENGINE RULE OVERRIDES + # ====================================================================== + regex: + "NoTrailingWhitespace": + severity: 5 + tags: + - Recommended + - CodeStyle + - Apex + "AvoidTermsWithImplicitBias": + severity: 5 + tags: + - Recommended + - BestPractices + "AvoidOldSalesforceApiVersions": + severity: 2 + tags: + - Recommended + - Security + - Xml + "AvoidGetHeapSizeInLoop": + severity: 2 + tags: + - Recommended + - Performance + - Apex + "MinVersionForAbstractVirtualClassesWithPrivateMethod": + severity: 2 + tags: + - Recommended + - BestPractices + - Apex + + # ====================================================================== + # FLOWTEST ENGINE RULE OVERRIDES + # ====================================================================== + flowtest: + "PreventPassingUserDataIntoElementWithoutSharing": + severity: 2 + tags: + - Recommended + - Security + - Xml + "PreventPassingUserDataIntoElementWithSharing": + severity: 4 + tags: + - Recommended + - Security + - Xml + + # ====================================================================== + # PMD ENGINE RULE OVERRIDES + # ====================================================================== + pmd: + "ApexBadCrypto": + severity: 2 + tags: + - Recommended + - Security + - Apex + "ApexCRUDViolation": + severity: 2 + tags: + - Recommended + - Security + - Apex + "ApexCSRF": + severity: 1 + tags: + - Recommended + - Security + - Apex + "ApexDangerousMethods": + severity: 3 + tags: + - Recommended + - Security + - Apex + "ApexDoc": + severity: 4 + tags: + - Recommended + - Documentation + - Apex + "ApexInsecureEndpoint": + severity: 2 + tags: + - Recommended + - Security + - Apex + "ApexOpenRedirect": + severity: 2 + tags: + - Recommended + - Security + - Apex + "ApexSharingViolations": + severity: 3 + tags: + - Recommended + - Security + - Apex + "ApexSOQLInjection": + severity: 2 + tags: + - Recommended + - Security + - Apex + "ApexSuggestUsingNamedCred": + severity: 2 + tags: + - Recommended + - Security + - Apex + "ApexUnitTestClassShouldHaveAsserts": + severity: 3 + tags: + - Recommended + - BestPractices + - Apex + "ApexUnitTestClassShouldHaveRunAs": + severity: 4 + tags: + - Recommended + - BestPractices + - Apex + "ApexUnitTestMethodShouldHaveIsTestAnnotation": + severity: 2 + tags: + - Recommended + - BestPractices + - Apex + "ApexUnitTestShouldNotUseSeeAllDataTrue": + severity: 2 + tags: + - Recommended + - BestPractices + - Apex + "ApexXSSFromEscapeFalse": + severity: 2 + tags: + - Recommended + - Security + - Apex + "ApexXSSFromURLParam": + severity: 2 + tags: + - Recommended + - Security + - Apex + "AvoidDebugStatements": + severity: 4 + tags: + - Recommended + - Performance + - Apex + "AvoidDeeplyNestedIfStmts": + severity: 3 + tags: + - Recommended + - Design + - Apex + "AvoidDirectAccessTriggerMap": + severity: 3 + tags: + - Recommended + - ErrorProne + - Apex + "AvoidGlobalModifier": + severity: 3 + tags: + - Recommended + - BestPractices + - Apex + "AvoidHardcodingId": + severity: 3 + tags: + - Recommended + - ErrorProne + - Apex + "AvoidLogicInTrigger": + severity: 3 + tags: + - Recommended + - BestPractices + - Apex + "AvoidNonExistentAnnotations": + severity: 4 + tags: + - Recommended + - ErrorProne + - Apex + "AvoidNonRestrictiveQueries": + severity: 4 + tags: + - Recommended + - Performance + - Apex + "ClassNamingConventions": + severity: 3 + tags: + - Recommended + - CodeStyle + - Apex + "CognitiveComplexity": + severity: 3 + tags: + - Recommended + - Design + - Apex + "CyclomaticComplexity": + severity: 3 + tags: + - Recommended + - Design + - Apex + "DebugsShouldUseLoggingLevel": + severity: 4 + tags: + - Recommended + - BestPractices + - Apex + "EagerlyLoadedDescribeSObjectResult": + severity: 2 + tags: + - Recommended + - Performance + - Apex + "EmptyCatchBlock": + severity: 2 + tags: + - Recommended + - ErrorProne + - Apex + "EmptyIfStmt": + severity: 3 + tags: + - Recommended + - ErrorProne + - Apex + "EmptyStatementBlock": + severity: 3 + tags: + - Recommended + - ErrorProne + - Apex + "EmptyTryOrFinallyBlock": + severity: 3 + tags: + - Recommended + - ErrorProne + - Apex + "EmptyWhileStmt": + severity: 3 + tags: + - Recommended + - ErrorProne + - Apex + "ExcessiveClassLength": + severity: 3 + tags: + - Recommended + - Design + - Apex + "ExcessiveParameterList": + severity: 3 + tags: + - Recommended + - Design + - Apex + "ExcessivePublicCount": + severity: 3 + tags: + - Recommended + - Design + - Apex + "FieldDeclarationsShouldBeAtStart": + severity: 3 + tags: + - Recommended + - CodeStyle + - Apex + "FieldNamingConventions": + severity: 3 + tags: + - Recommended + - CodeStyle + - Apex + "ForLoopsMustUseBraces": + severity: 3 + tags: + - Recommended + - CodeStyle + - Apex + "FormalParameterNamingConventions": + severity: 3 + tags: + - Recommended + - CodeStyle + - Apex + "IfElseStmtsMustUseBraces": + severity: 3 + tags: + - Recommended + - CodeStyle + - Apex + "IfStmtsMustUseBraces": + severity: 3 + tags: + - Recommended + - CodeStyle + - Apex + "InaccessibleAuraEnabledGetter": + severity: 3 + tags: + - Recommended + - ErrorProne + - Apex + "LocalVariableNamingConventions": + severity: 3 + tags: + - Recommended + - CodeStyle + - Apex + "MethodNamingConventions": + severity: 3 + tags: + - Recommended + - CodeStyle + - Apex + "MethodWithSameNameAsEnclosingClass": + severity: 3 + tags: + - Recommended + - ErrorProne + - Apex + "NcssConstructorCount": + severity: 4 + tags: + - Recommended + - Design + - Apex + "NcssMethodCount": + severity: 4 + tags: + - Recommended + - Design + - Apex + "OneDeclarationPerLine": + severity: 3 + tags: + - Recommended + - CodeStyle + - Apex + "OperationWithHighCostInLoop": + severity: 3 + tags: + - Recommended + - Performance + - Apex + "OperationWithLimitsInLoop": + severity: 3 + tags: + - Recommended + - Performance + - Apex + "OverrideBothEqualsAndHashcode": + severity: 2 + tags: + - Recommended + - ErrorProne + - Apex + "PropertyNamingConventions": + severity: 3 + tags: + - Recommended + - CodeStyle + - Apex + "QueueableWithoutFinalizer": + severity: 4 + tags: + - Recommended + - BestPractices + - Apex + "TestMethodsMustBeInTestClasses": + severity: 3 + tags: + - Recommended + - ErrorProne + - Apex + "TooManyFields": + severity: 3 + tags: + - Recommended + - Design + - Apex + "UnusedLocalVariable": + severity: 3 + tags: + - Recommended + - BestPractices + - Apex + "UnusedMethod": + severity: 3 + tags: + - Recommended + - Design + - Apex + "VfCsrf": + severity: 2 + tags: + - Recommended + - Security + - Visualforce + "VfHtmlStyleTagXss": + severity: 2 + tags: + - Recommended + - Security + - Visualforce + "VfUnescapeEl": + severity: 2 + tags: + - Recommended + - Security + - Visualforce + "WhileLoopsMustUseBraces": + severity: 3 + tags: + - Recommended + - CodeStyle + - Apex + + # ====================================================================== + # CPD ENGINE RULE OVERRIDES + # ====================================================================== + cpd: + "DetectCopyPasteForApex": + severity: 5 + tags: + - Recommended + - Design + - Apex + "DetectCopyPasteForJavascript": + severity: 5 + tags: + - Recommended + - Design + - Javascript + "DetectCopyPasteForTypescript": + severity: 5 + tags: + - Recommended + - Design + - Typescript + "DetectCopyPasteForVisualforce": + severity: 5 + tags: + - Recommended + - Design + - Visualforce + +# Engine specific custom configuration settings of the format engines.{engine_name}.{property_name} = {value} where: +# {engine_name} is the name of the engine containing the setting that you want to override. +# {property_name} is the name of a property that you would like to override. +# Each engine may have its own set of properties available to help customize that particular engine's behavior. +engines: + + # ====================================================================== + # ESLINT ENGINE CONFIGURATION + # To learn more about this configuration, visit: + # https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/engine-eslint.html#eslint-configuration-reference + # ====================================================================== + eslint: + + # Whether to turn off the 'eslint' engine so that it is not included when running Code Analyzer commands. + disable_engine: false + + # Your project's main ESLint configuration file. May be an absolute path or a path relative to the config_root. + # If null and auto_discover_eslint_config is true, then Code Analyzer will attempt to discover/apply it automatically. + # Currently only legacy ESLInt config files are supported. + # See https://eslint.org/docs/v8.x/use/configure/configuration-files to learn more. + eslint_config_file: null + + # Your project's ".eslintignore" file. May be an absolute path or a path relative to the config_root. + # If null and auto_discover_eslint_config is true, then Code Analyzer will attempt to discover/apply it automatically. + # See https://eslint.org/docs/v8.x/use/configure/ignore#the-eslintignore-file to learn more. + eslint_ignore_file: null + + # Whether to have Code Analyzer automatically discover/apply any ESLint configuration and ignore files from your workspace. + auto_discover_eslint_config: false + + # Whether to turn off the default base configuration that supplies the standard ESLint rules for JavaScript files. + disable_javascript_base_config: false + + # Whether to turn off the default base configuration that supplies the LWC rules for JavaScript files. + disable_lwc_base_config: false + + # Whether to turn off the default base configuration that supplies the standard rules for TypeScript files. + disable_typescript_base_config: false + + # Extensions of the files in your workspace that will be used to discover rules. + # To associate file extensions to the standard ESLint JavaScript rules, LWC rules, or custom JavaScript-based + # rules, add them under the 'javascript' language. To associate file extensions to the standard TypeScript + # rules or custom TypeScript-based rules, add them under the 'typescript' language. To allow for the + # discovery of custom rules that are associated with any other language, then add the associated file + # extensions under the 'other' language. + file_extensions: + javascript: + - .js + - .cjs + - .mjs + typescript: + - .ts + other: [] + + # ====================================================================== + # RETIRE-JS ENGINE CONFIGURATION + # To learn more about this configuration, visit: + # https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/engine-retire-js.html#retirejs-configuration-reference + # ====================================================================== + retire-js: + + # Whether to turn off the 'retire-js' engine so that it is not included when running Code Analyzer commands. + disable_engine: false + + # ====================================================================== + # REGEX ENGINE CONFIGURATION + # To learn more about this configuration, visit: + # https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/engine-regex.html#regex-configuration-reference + # ====================================================================== + regex: + + # Whether to turn off the 'regex' engine so that it is not included when running Code Analyzer commands. + disable_engine: false + + # Custom rules to be added to the 'regex' engine of the format custom_rules.{rule_name}.{rule_property_name} = {value} where: + # {rule_name} is the name you would like to give to your custom rule + # {rule_property_name} is the name of one of the rule properties. You may specify the following rule properties: + # 'regex' - The regular expression that triggers a violation when matched against the contents of a file. + # 'file_extensions' - The extensions of the files that you would like to test the regular expression against. + # 'description' - A description of the rule's purpose + # 'violation_message' - [Optional] The message emitted when a rule violation occurs. + # This message is intended to help the user understand the violation. + # Default: 'A match of the regular expression {regex} was found for rule {rule_name}: {description}' + # 'severity' - [Optional] The severity level to apply to this rule by default. + # Possible values: 1 or 'Critical', 2 or 'High', 3 or 'Moderate', 4 or 'Low', 5 or 'Info' + # Default: 3 + # 'tags' - [Optional] The string array of tag values to apply to this rule by default. + # Default: ['Recommended'] + # ---- [Example usage]: --------------------- + # engines: + # regex: + # custom_rules: + # "NoTodoComments": + # regex: /\/\/[ \t]*TODO/gi + # file_extensions: [".apex", ".cls", ".trigger"] + # description: "Prevents TODO comments from being in apex code." + # violation_message: "A comment with a TODO statement was found. Please remove TODO statements from your apex code." + # severity: "Info" + # tags: ["TechDebt"] + # ------------------------------------------- + custom_rules: {} + + # ====================================================================== + # FLOWTEST ENGINE CONFIGURATION + # To learn more about this configuration, visit: + # https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/engine-flowtest.html#flowtest-configuration-reference + # ====================================================================== + flowtest: + + # Whether to turn off the 'flowtest' engine so that it is not included when running Code Analyzer commands. + disable_engine: false + + # Indicates the specific Python command to use for the 'flowtest' engine. + # May be provided as the name of a command that exists on the path, or an absolute file path location. + # If unspecified, or specified as null, then an attempt will be made to automatically discover a Python command from your environment. + python_command: null # Last calculated by the config command as: "python3" + + # ====================================================================== + # PMD ENGINE CONFIGURATION + # To learn more about this configuration, visit: + # https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/engine-pmd.html#pmd-configuration-reference + # ====================================================================== + pmd: + + # Whether to turn off the 'pmd' engine so that it is not included when running Code Analyzer commands. + disable_engine: false + + # Indicates the specific 'java' command associated with the JRE or JDK to use for the 'pmd' engine. + # May be provided as the name of a command that exists on the path, or an absolute file path location. + # If unspecified, or specified as null, then an attempt will be made to automatically discover a 'java' command from your environment. + java_command: null # Last calculated by the config command as: "java" + + # Specifies the list of file extensions to associate to each rule language. + # The rule(s) associated with a given language will run against all the files in your workspace containing one of + # the specified file extensions. Each file extension can only be associated to one language. If a specific language + # is not specified, then a set of default file extensions for that language will be used. + file_extensions: + apex: + - .cls + - .trigger + html: + - .html + - .htm + - .xhtml + - .xht + - .shtml + - .cmp + javascript: + - .js + - .cjs + - .mjs + typescript: + - .ts + visualforce: + - .page + - .component + xml: + - .xml + + # List of jar files and/or folders to add the Java classpath when running PMD. + # Each entry may be given as an absolute path or a relative path to 'config_root'. + # This field is primarily used to supply custom Java based rule definitions to PMD. + # See https://pmd.github.io/pmd/pmd_userdocs_extending_writing_java_rules.html + java_classpath_entries: [] + + # List of xml ruleset files containing custom PMD rules to be made available for rule selection. + # Each ruleset must be an xml file that is either: + # - on disk (provided as an absolute path or a relative path to 'config_root') + # - or a relative resource found on the Java classpath. + # Not all custom rules can be fully defined within an xml ruleset file. For example, Java based rules may be defined in jar files. + # In these cases, you will need to also add your additional files to the Java classpath using the 'java_classpath_entries' field. + # See https://pmd.github.io/pmd/pmd_userdocs_making_rulesets.html to learn more about PMD rulesets. + custom_rulesets: [] + + # ====================================================================== + # CPD ENGINE CONFIGURATION + # To learn more about this configuration, visit: + # https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/engine-cpd.html#cpd-configuration-reference + # ====================================================================== + cpd: + + # Whether to turn off the 'cpd' engine so that it is not included when running Code Analyzer commands. + disable_engine: false + + # Indicates the specific 'java' command associated with the JRE or JDK to use for the 'cpd' engine. + # May be provided as the name of a command that exists on the path, or an absolute file path location. + # If unspecified, or specified as null, then an attempt will be made to automatically discover a 'java' command from your environment. + java_command: null # Last calculated by the config command as: "java" + + # Specifies the list of file extensions to associate to each rule language. + # The rule(s) associated with a given language will run against all the files in your workspace containing one of + # the specified file extensions. Each file extension can only be associated to one language. If a specific language + # is not specified, then a set of default file extensions for that language will be used. + file_extensions: + apex: + - .cls + - .trigger + html: + - .html + - .htm + - .xhtml + - .xht + - .shtml + - .cmp + javascript: + - .js + - .cjs + - .mjs + typescript: + - .ts + visualforce: + - .page + - .component + xml: + - .xml + + # Specifies the minimum tokens threshold for each rule language. + # The minimum tokens threshold is the number of tokens required to be in a duplicate block of code in order to be + # reported as a violation. The concept of a token may be defined differently per language, but in general it is a + # distinct basic element of source code. For example, this could be language specific keywords, identifiers, + # operators, literals, and more. See https://docs.pmd-code.org/latest/pmd_userdocs_cpd.html to learn more. + # If a value for a language is unspecified, then the default value of 100 will be used for that language. + minimum_tokens: + apex: 100 + html: 100 + javascript: 100 + typescript: 100 + visualforce: 100 + xml: 100 + + # Indicates whether to ignore multiple copies of files of the same name and length. + skip_duplicate_files: false + +# ====================================================================== +# END OF CODE ANALYZER CONFIGURATION +# ====================================================================== From 076efd19e12499f836cf31b3dd790f73e0058805 Mon Sep 17 00:00:00 2001 From: ad-shreya <159111757+ad-shreya@users.noreply.github.com> Date: Thu, 20 Mar 2025 13:52:50 +0530 Subject: [PATCH 6/7] Rename .github/workflows/code-analyzer-config.yml to .github/workflows/config/code-analyzer-config.yml --- .github/workflows/{ => config}/code-analyzer-config.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{ => config}/code-analyzer-config.yml (100%) diff --git a/.github/workflows/code-analyzer-config.yml b/.github/workflows/config/code-analyzer-config.yml similarity index 100% rename from .github/workflows/code-analyzer-config.yml rename to .github/workflows/config/code-analyzer-config.yml From 2bf3acaea409772f94b2f50f7fd8339a8b8c02c7 Mon Sep 17 00:00:00 2001 From: ad-shreya <159111757+ad-shreya@users.noreply.github.com> Date: Thu, 19 Feb 2026 11:24:21 +0530 Subject: [PATCH 7/7] Create hello.cls --- force-app/main/default/classes/hello.cls | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 force-app/main/default/classes/hello.cls diff --git a/force-app/main/default/classes/hello.cls b/force-app/main/default/classes/hello.cls new file mode 100644 index 000000000..6c1e63475 --- /dev/null +++ b/force-app/main/default/classes/hello.cls @@ -0,0 +1,6 @@ +public with sharing class hello { + public static void sayHello() { + System.debug('Hello from Solar'); + System.debug('Hello from New WI'); + } +}