Skip to content

sfdx-scanner

sfdx-scanner is a sfdx plugin scanning apex and triggers using Apex PMD, and javascript using eslint

If your root folder is not force-app, please set variable SALESFORCE_SFDX_SCANNER_DIRECTORY

You can select categories and single rules by defining custom arguments (example: SALESFORCE_SFDX_SCANNER_ARGUMENTS: -c "Best Practices,Security")

See more details in Help

sfdx-scanner documentation

sfdx-scanner - GitHub

Configuration in Mega-Linter

Variable Description Default value
SALESFORCE_SFDX_SCANNER_ARGUMENTS User custom arguments to add in linter CLI call
Ex: -s --foo "bar"
SALESFORCE_SFDX_SCANNER_FILTER_REGEX_INCLUDE Custom regex including filter
Ex: (src|lib)
Include every file
SALESFORCE_SFDX_SCANNER_FILTER_REGEX_EXCLUDE Custom regex excluding filter
Ex: (test|examples)
Exclude no file
SALESFORCE_SFDX_SCANNER_FILE_EXTENSIONS Allowed file extensions. "*" matches any extension, "" matches empty extension. Empty list excludes all files
Ex: [".py", ""]
Exclude every file
SALESFORCE_SFDX_SCANNER_FILE_NAMES_REGEX File name regex filters. Regular expression list for filtering files by their base names using regex full match. Empty list includes all files
Ex: ["Dockerfile(-.+)?", "Jenkinsfile"]
Include every file
SALESFORCE_SFDX_SCANNER_DISABLE_ERRORS Run linter but consider errors as warnings false
SALESFORCE_DIRECTORY Directory containing SALESFORCE files force-app

IDE Integration

Use sfdx-scanner in your favorite IDE to catch errors before Mega-Linter !

IDE Extension Name Install
Eclipse pmd-eclipse-plugin Visit Web Site
Emacs pmd-emacs Visit Web Site
IDEA PMD IntelliJ
Visual Studio Code Salesforce Extension Pack Install in VsCode

Mega-Linter Flavours

This linter is available in the following flavours

Flavor Description Embedded linters Info
all Default Mega-Linter Flavor 83 Docker Image Size (tag) Docker Pulls
salesforce Optimized for Salesforce based projects 37 Docker Image Size (tag) Docker Pulls

Behind the scenes

How are identified applicable files

  • Activated only if sub-directory force-app is found. (directory name can be overridden with SALESFORCE_DIRECTORY)
  • If this linter is active, all files will always be linted

Example calls

sfdx scanner:run

Help content

evaluate a selection of rules against a codebase

USAGE
  $ sfdx scanner:run -t <array> [-c <array>] [-r <array>] [-e <array>] [-f
  csv|html|json|junit|table|xml] [-o <string>] [--tsconfig <string>]
  [--eslintconfig <string>] [--pmdconfig <string>] [--env <string>] [-v |
  --json] [--verbose] [--loglevel
  trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS
  -c, --category=category
      categor(ies) of rules to run

  -e, --engine=engine
      engine(s) to run

  -f, --format=(csv|html|json|junit|table|xml)
      format of results

  -o, --outfile=outfile
      location of output file

  -r, --ruleset=ruleset
      [deprecated] ruleset(s) of rules to run

  -t, --target=target
      (required) location of source code

  -v, --violations-cause-error
      throws an error when violations are detected

  --env=env
      JSON-formatted string, overrides ESLint's default environment variables

  --eslintconfig=eslintconfig
      location of eslintrc config to customize eslint engine

  --json
      format output as json

  --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATA
  L)
      [default: warn] logging level for this command invocation

  --pmdconfig=pmdconfig
      location of PMD rule reference XML file to customize rule selection

  --tsconfig=tsconfig
      location of tsconfig.json file

  --verbose
      emit additional command output to stdout

EXAMPLE
  Invoking without specifying any rules causes all rules to be run.
    E.g., $ sfdx scanner:run --format xml --target "somefile.js"
      Evaluates all rules against somefile.js.

    Specifying multiple categories is treated as a logical OR.
      E.g., $ sfdx scanner:run --format xml --target "somefile.js" --category
  "Design,Best Practices"
        Evaluates all rules in the Design or Best Practices categories.

    Categories can be excluded by specifying the negation operator, the values
  must be enclosed in single quotes.
      E.g., $ sfdx scanner:run --format xml --target "somefile.js" --category
  '!Design,!Best Practices'
        Evaluates all rules except those in the Design or Best Practices categories.

    Wrap globs in quotes.
      Unix example:    $ sfdx scanner:run --target './**/*.js,!./**/IgnoreMe.js' ...
      Windows example: > sfdx scanner:run --target ".\**\*.js,!.\**\IgnoreMe.js" ...
        Evaluate rules against all .js files below the current directory, except for
  IgnoreMe.js.

    Specify tsconfig.json if the current working directory does not contain the
  tsconfig.json that corresponds to the TypeScript files being scanned.
      E.g., sfdx scanner:run --target "/my-project/**/*.ts" --tsconfig
  "/my-project/tsconfig.json"
        Scans the project contained in '/my-project' if the current working directory
  is another directory.

    Use --env to override the default ESLint environment variables to add
  frameworks.
      E.g., $ sfdx scanner:run --target "somefile.js" --env '{"jasmine": true}'
        Evaluates rules against somefile.js, including Jasmine in the environment
  variables.

    Use --violations-cause-error to throw exit with a non-zero code when
  violations are found.
      E.g., $ sfdx scanner:run --target "somefile.js" --violations-cause-error
        Evaluates rules against somefile.js. If any rules are violated, the exit code
  will be the severity of the most severe violation.

    Use --engine to include or exclude engines. Any engine listed will be run,
  regardless of its current 'disabled' attribute.
      E.g., $ sfdx scanner:run --target "somefile.js" --engine "eslint-lwc,pmd"
        Evaluates rules against somefile.js, using eslint-lwc and pmd engines.

    To use PMD with your own rule reference file, use --pmdconfig. Note that rule
  filters are not applied.
      E.g, $ sfdx scanner:run --target "src" --pmdconfig "pmd_rule_ref.xml"

    To use Eslint with your own .eslintrc.json file, use --eslintconfig. Make sure
  that the directory you run the command from has all the NPM dependencies
  installed.
      E.g., $ sfdx scanner:run --target "src" --eslintconfig
  "/home/my/setup/.eslintrc.json"


 ›   Error: EEXIT: 0
 ›   Code: EEXIT
NAME                                               LANGUAGES    CATEGORIES        RULESETS [DEP]                                    ENGINE
─────────────────────────────────────────────────  ───────────  ────────────────  ────────────────────────────────────────────────  ─────────────────
VfCsrf                                             visualforce  Security          Basic VF                                          pmd
VfUnescapeEl                                       visualforce  Security          Basic VF                                          pmd
ApexAssertionsShouldIncludeMessage                 apex         Best Practices                                                      pmd
ApexUnitTestClassShouldHaveAsserts                 apex         Best Practices    Default ruleset...,quickstart,ApexUnit            pmd
ApexUnitTestMethodShouldHaveIsTestAnnotation       apex         Best Practices                                                      pmd
ApexUnitTestShouldNotUseSeeAllDataTrue             apex         Best Practices    Default ruleset...,quickstart,ApexUnit            pmd
AvoidGlobalModifier                                apex         Best Practices    Default ruleset...,Style,quickstart               pmd
AvoidLogicInTrigger                                apex         Best Practices    Default ruleset...,Style,quickstart               pmd
DebugsShouldUseLoggingLevel                        apex         Best Practices    quickstart                                        pmd
UnusedLocalVariable                                apex         Best Practices                                                      pmd
AvoidDmlStatementsInLoops                          apex         Performance       Performance,Default ruleset...                    pmd
AvoidSoqlInLoops                                   apex         Performance       Performance,Default ruleset...                    pmd
AvoidSoslInLoops                                   apex         Performance       Performance,Default ruleset...                    pmd
OperationWithLimitsInLoop                          apex         Performance       quickstart                                        pmd
ApexBadCrypto                                      apex         Security          Default ruleset...,quickstart,Security            pmd
ApexCRUDViolation                                  apex         Security          Default ruleset...,quickstart,Security            pmd
ApexCSRF                                           apex         Security          Security                                          pmd
ApexDangerousMethods                               apex         Security          Default ruleset...,quickstart,Security            pmd
ApexInsecureEndpoint                               apex         Security          Default ruleset...,quickstart,Security            pmd
ApexOpenRedirect                                   apex         Security          Default ruleset...,quickstart,Security            pmd
ApexSharingViolations                              apex         Security          Default ruleset...,quickstart,Security            pmd
ApexSOQLInjection                                  apex         Security          Default ruleset...,quickstart,Security            pmd
ApexSuggestUsingNamedCred                          apex         Security          Default ruleset...,quickstart,Security            pmd
ApexXSSFromEscapeFalse                             apex         Security          Default ruleset...,quickstart,Security            pmd
ApexXSSFromURLParam                                apex         Security          Default ruleset...,quickstart,Security            pmd
ClassNamingConventions                             apex         Code Style        Default ruleset...,Style,quickstart               pmd
IfElseStmtsMustUseBraces                           apex         Code Style        Default ruleset...,Braces,quickstart              pmd
IfStmtsMustUseBraces                               apex         Code Style        Default ruleset...,Braces,quickstart              pmd
FieldDeclarationsShouldBeAtStart                   apex         Code Style                                                          pmd
FieldNamingConventions                             apex         Code Style        quickstart                                        pmd
ForLoopsMustUseBraces                              apex         Code Style        Default ruleset...,Braces,quickstart              pmd
FormalParameterNamingConventions                   apex         Code Style        quickstart                                        pmd
LocalVariableNamingConventions                     apex         Code Style        quickstart                                        pmd
MethodNamingConventions                            apex         Code Style        Default ruleset...,Style,quickstart               pmd
OneDeclarationPerLine                              apex         Code Style        Default ruleset...,quickstart                     pmd
PropertyNamingConventions                          apex         Code Style        quickstart                                        pmd
VariableNamingConventions                          apex         Code Style        Default ruleset...,Style                          pmd
WhileLoopsMustUseBraces                            apex         Code Style        Default ruleset...,Braces,quickstart              pmd
AvoidDeeplyNestedIfStmts                           apex         Design            Default ruleset...,quickstart,Complexity          pmd
CyclomaticComplexity                               apex         Design            Default ruleset...,quickstart,Metrics tempora...  pmd
CognitiveComplexity                                apex         Design                                                              pmd
ExcessiveClassLength                               apex         Design            Default ruleset...,quickstart,Complexity          pmd
ExcessiveParameterList                             apex         Design            Default ruleset...,quickstart,Complexity          pmd
ExcessivePublicCount                               apex         Design            Default ruleset...,quickstart,Complexity          pmd
NcssConstructorCount                               apex         Design            Default ruleset...,quickstart,Complexity          pmd
NcssMethodCount                                    apex         Design            Default ruleset...,quickstart,Complexity          pmd
NcssTypeCount                                      apex         Design            Default ruleset...,quickstart,Complexity          pmd
StdCyclomaticComplexity                            apex         Design            Default ruleset...,quickstart,Complexity          pmd
TooManyFields                                      apex         Design            Default ruleset...,quickstart,Complexity          pmd
ApexDoc                                            apex         Documentation     Default ruleset...,quickstart                     pmd
ApexCSRF                                           apex         Error Prone       Default ruleset...,quickstart                     pmd
AvoidDirectAccessTriggerMap                        apex         Error Prone       Default ruleset...,Style,quickstart               pmd
AvoidHardcodingId                                  apex         Error Prone       Default ruleset...,Style,quickstart               pmd
EmptyCatchBlock                                    apex         Error Prone       Default ruleset...,quickstart,Empty Code          pmd
EmptyIfStmt                                        apex         Error Prone       Default ruleset...,quickstart,Empty Code          pmd
EmptyStatementBlock                                apex         Error Prone       Default ruleset...,quickstart,Empty Code          pmd
EmptyTryOrFinallyBlock                             apex         Error Prone       Default ruleset...,quickstart,Empty Code          pmd
EmptyWhileStmt                                     apex         Error Prone       Default ruleset...,quickstart,Empty Code          pmd
MethodWithSameNameAsEnclosingClass                 apex         Error Prone       Default ruleset...,Style,quickstart               pmd
AvoidNonExistentAnnotations                        apex         Error Prone       Default ruleset...,quickstart                     pmd
TestMethodsMustBeInTestClasses                     apex         Error Prone                                                         pmd
constructor-super                                  javascript   ECMAScript 6      ECMAScript 6                                      eslint
for-direction                                      javascript   Possible Errors   Possible Errors                                   eslint
getter-return                                      javascript   Possible Errors   Possible Errors                                   eslint
no-async-promise-executor                          javascript   Possible Errors   Possible Errors                                   eslint
no-case-declarations                               javascript   Best Practices    Best Practices                                    eslint
no-class-assign                                    javascript   ECMAScript 6      ECMAScript 6                                      eslint
no-compare-neg-zero                                javascript   Possible Errors   Possible Errors                                   eslint
no-cond-assign                                     javascript   Possible Errors   Possible Errors                                   eslint
no-const-assign                                    javascript   ECMAScript 6      ECMAScript 6                                      eslint
no-constant-condition                              javascript   Possible Errors   Possible Errors                                   eslint
no-control-regex                                   javascript   Possible Errors   Possible Errors                                   eslint
no-debugger                                        javascript   Possible Errors   Possible Errors                                   eslint
no-delete-var                                      javascript   Variables         Variables                                         eslint
no-dupe-args                                       javascript   Possible Errors   Possible Errors                                   eslint
no-dupe-class-members                              javascript   ECMAScript 6      ECMAScript 6                                      eslint
no-dupe-keys                                       javascript   Possible Errors   Possible Errors                                   eslint
no-duplicate-case                                  javascript   Possible Errors   Possible Errors                                   eslint
no-empty                                           javascript   Possible Errors   Possible Errors                                   eslint
no-empty-character-class                           javascript   Possible Errors   Possible Errors                                   eslint
no-empty-pattern                                   javascript   Best Practices    Best Practices                                    eslint
no-ex-assign                                       javascript   Possible Errors   Possible Errors                                   eslint
no-extra-boolean-cast                              javascript   Possible Errors   Possible Errors                                   eslint
no-extra-semi                                      javascript   Possible Errors   Possible Errors                                   eslint
no-fallthrough                                     javascript   Best Practices    Best Practices                                    eslint
no-func-assign                                     javascript   Possible Errors   Possible Errors                                   eslint
no-global-assign                                   javascript   Best Practices    Best Practices                                    eslint
no-inner-declarations                              javascript   Possible Errors   Possible Errors                                   eslint
no-invalid-regexp                                  javascript   Possible Errors   Possible Errors                                   eslint
no-irregular-whitespace                            javascript   Possible Errors   Possible Errors                                   eslint
no-misleading-character-class                      javascript   Possible Errors   Possible Errors                                   eslint
no-mixed-spaces-and-tabs                           javascript   Stylistic Issues  Stylistic Issues                                  eslint
no-new-symbol                                      javascript   ECMAScript 6      ECMAScript 6                                      eslint
no-obj-calls                                       javascript   Possible Errors   Possible Errors                                   eslint
no-octal                                           javascript   Best Practices    Best Practices                                    eslint
no-prototype-builtins                              javascript   Possible Errors   Possible Errors                                   eslint
no-redeclare                                       javascript   Best Practices    Best Practices                                    eslint
no-regex-spaces                                    javascript   Possible Errors   Possible Errors                                   eslint
no-self-assign                                     javascript   Best Practices    Best Practices                                    eslint
no-shadow-restricted-names                         javascript   Variables         Variables                                         eslint
no-sparse-arrays                                   javascript   Possible Errors   Possible Errors                                   eslint
no-this-before-super                               javascript   ECMAScript 6      ECMAScript 6                                      eslint
no-undef                                           javascript   Variables         Variables                                         eslint
no-unexpected-multiline                            javascript   Possible Errors   Possible Errors                                   eslint
no-unreachable                                     javascript   Possible Errors   Possible Errors                                   eslint
no-unsafe-finally                                  javascript   Possible Errors   Possible Errors                                   eslint
no-unsafe-negation                                 javascript   Possible Errors   Possible Errors                                   eslint
no-unused-labels                                   javascript   Best Practices    Best Practices                                    eslint
no-unused-vars                                     javascript   Variables         Variables                                         eslint
no-useless-catch                                   javascript   Best Practices    Best Practices                                    eslint
no-useless-escape                                  javascript   Best Practices    Best Practices                                    eslint
no-with                                            javascript   Best Practices    Best Practices                                    eslint
require-yield                                      javascript   ECMAScript 6      ECMAScript 6                                      eslint
use-isnan                                          javascript   Possible Errors   Possible Errors                                   eslint
valid-typeof                                       javascript   Possible Errors   Possible Errors                                   eslint
constructor-super                                  typescript   ECMAScript 6      ECMAScript 6                                      eslint-typescript
for-direction                                      typescript   Possible Errors   Possible Errors                                   eslint-typescript
no-async-promise-executor                          typescript   Possible Errors   Possible Errors                                   eslint-typescript
no-case-declarations                               typescript   Best Practices    Best Practices                                    eslint-typescript
no-class-assign                                    typescript   ECMAScript 6      ECMAScript 6                                      eslint-typescript
no-compare-neg-zero                                typescript   Possible Errors   Possible Errors                                   eslint-typescript
no-cond-assign                                     typescript   Possible Errors   Possible Errors                                   eslint-typescript
no-constant-condition                              typescript   Possible Errors   Possible Errors                                   eslint-typescript
no-control-regex                                   typescript   Possible Errors   Possible Errors                                   eslint-typescript
no-debugger                                        typescript   Possible Errors   Possible Errors                                   eslint-typescript
no-delete-var                                      typescript   Variables         Variables                                         eslint-typescript
no-duplicate-case                                  typescript   Possible Errors   Possible Errors                                   eslint-typescript
no-empty                                           typescript   Possible Errors   Possible Errors                                   eslint-typescript
no-empty-character-class                           typescript   Possible Errors   Possible Errors                                   eslint-typescript
no-empty-pattern                                   typescript   Best Practices    Best Practices                                    eslint-typescript
no-ex-assign                                       typescript   Possible Errors   Possible Errors                                   eslint-typescript
no-extra-boolean-cast                              typescript   Possible Errors   Possible Errors                                   eslint-typescript
no-fallthrough                                     typescript   Best Practices    Best Practices                                    eslint-typescript
no-func-assign                                     typescript   Possible Errors   Possible Errors                                   eslint-typescript
no-global-assign                                   typescript   Best Practices    Best Practices                                    eslint-typescript
no-inner-declarations                              typescript   Possible Errors   Possible Errors                                   eslint-typescript
no-invalid-regexp                                  typescript   Possible Errors   Possible Errors                                   eslint-typescript
no-irregular-whitespace                            typescript   Possible Errors   Possible Errors                                   eslint-typescript
no-misleading-character-class                      typescript   Possible Errors   Possible Errors                                   eslint-typescript
no-mixed-spaces-and-tabs                           typescript   Stylistic Issues  Stylistic Issues                                  eslint-typescript
no-obj-calls                                       typescript   Possible Errors   Possible Errors                                   eslint-typescript
no-octal                                           typescript   Best Practices    Best Practices                                    eslint-typescript
no-prototype-builtins                              typescript   Possible Errors   Possible Errors                                   eslint-typescript
no-regex-spaces                                    typescript   Possible Errors   Possible Errors                                   eslint-typescript
no-self-assign                                     typescript   Best Practices    Best Practices                                    eslint-typescript
no-shadow-restricted-names                         typescript   Variables         Variables                                         eslint-typescript
no-sparse-arrays                                   typescript   Possible Errors   Possible Errors                                   eslint-typescript
no-unexpected-multiline                            typescript   Possible Errors   Possible Errors                                   eslint-typescript
no-unsafe-finally                                  typescript   Possible Errors   Possible Errors                                   eslint-typescript
no-unsafe-negation                                 typescript   Possible Errors   Possible Errors                                   eslint-typescript
no-unused-labels                                   typescript   Best Practices    Best Practices                                    eslint-typescript
no-useless-catch                                   typescript   Best Practices    Best Practices                                    eslint-typescript
no-useless-escape                                  typescript   Best Practices    Best Practices                                    eslint-typescript
no-var                                             typescript   ECMAScript 6      ECMAScript 6                                      eslint-typescript
no-with                                            typescript   Best Practices    Best Practices                                    eslint-typescript
prefer-const                                       typescript   ECMAScript 6      ECMAScript 6                                      eslint-typescript
prefer-rest-params                                 typescript   ECMAScript 6      ECMAScript 6                                      eslint-typescript
prefer-spread                                      typescript   ECMAScript 6      ECMAScript 6                                      eslint-typescript
require-yield                                      typescript   ECMAScript 6      ECMAScript 6                                      eslint-typescript
use-isnan                                          typescript   Possible Errors   Possible Errors                                   eslint-typescript
@typescript-eslint/adjacent-overload-signatures    typescript   Best Practices    Best Practices                                    eslint-typescript
@typescript-eslint/await-thenable                  typescript   Best Practices    Best Practices                                    eslint-typescript
@typescript-eslint/ban-types                       typescript   Best Practices    Best Practices                                    eslint-typescript
@typescript-eslint/consistent-type-assertions      typescript   Best Practices    Best Practices                                    eslint-typescript
@typescript-eslint/explicit-function-return-type   typescript   Stylistic Issues  Stylistic Issues                                  eslint-typescript
@typescript-eslint/member-delimiter-style          typescript   Stylistic Issues  Stylistic Issues                                  eslint-typescript
@typescript-eslint/no-array-constructor            typescript   Stylistic Issues  Stylistic Issues                                  eslint-typescript
@typescript-eslint/no-empty-function               typescript   Best Practices    Best Practices                                    eslint-typescript
@typescript-eslint/no-empty-interface              typescript   Best Practices    Best Practices                                    eslint-typescript
@typescript-eslint/no-explicit-any                 typescript   Best Practices    Best Practices                                    eslint-typescript
@typescript-eslint/no-for-in-array                 typescript   Best Practices    Best Practices                                    eslint-typescript
@typescript-eslint/no-inferrable-types             typescript   Best Practices    Best Practices                                    eslint-typescript
@typescript-eslint/no-misused-new                  typescript   Best Practices    Best Practices                                    eslint-typescript
@typescript-eslint/no-misused-promises             typescript   Best Practices    Best Practices                                    eslint-typescript
@typescript-eslint/no-namespace                    typescript   Best Practices    Best Practices                                    eslint-typescript
@typescript-eslint/no-non-null-assertion           typescript   Stylistic Issues  Stylistic Issues                                  eslint-typescript
@typescript-eslint/no-this-alias                   typescript   Best Practices    Best Practices                                    eslint-typescript
@typescript-eslint/no-unnecessary-type-assertion   typescript   Best Practices    Best Practices                                    eslint-typescript
@typescript-eslint/no-unused-vars                  typescript   Variables         Variables                                         eslint-typescript
@typescript-eslint/no-use-before-define            typescript   Variables         Variables                                         eslint-typescript
@typescript-eslint/no-var-requires                 typescript   Best Practices    Best Practices                                    eslint-typescript
@typescript-eslint/prefer-includes                 typescript   Best Practices    Best Practices                                    eslint-typescript
@typescript-eslint/prefer-namespace-keyword        typescript   Best Practices    Best Practices                                    eslint-typescript
@typescript-eslint/prefer-regexp-exec              typescript   Best Practices    Best Practices                                    eslint-typescript
@typescript-eslint/prefer-string-starts-ends-with  typescript   Best Practices    Best Practices                                    eslint-typescript
@typescript-eslint/require-await                   typescript   Best Practices    Best Practices                                    eslint-typescript
@typescript-eslint/triple-slash-reference          typescript   Best Practices    Best Practices                                    eslint-typescript
@typescript-eslint/type-annotation-spacing         typescript   Stylistic Issues  Stylistic Issues                                  eslint-typescript
@typescript-eslint/unbound-method                  typescript   Best Practices    Best Practices                                    eslint-typescript

Installation on mega-linter Docker image

  • Dockerfile commands :
RUN sfdx plugins:install @salesforce/sfdx-scanner

Example success log

Results of sfdx-scanner linter (version 2.4.0)
See documentation on https://nvuillam.github.io/mega-linter/descriptors/salesforce_sfdx_scanner/
-----------------------------------------------

[SUCCESS] /tmp/098844eb-9b85-4505-b6b6-8c6bcd96050f
    No rule violations found.

Example error log

Results of sfdx-scanner linter (version 2.4.0)
See documentation on https://nvuillam.github.io/mega-linter/descriptors/salesforce_sfdx_scanner/
-----------------------------------------------

[ERROR] /tmp/a62282d7-5f53-42be-9816-03d1c2da8715
    LOCATION                                                   DESCRIPTION                                            CATEGORY        U R L
    ─────────────────────────────────────────────────────────  ─────────────────────────────────────────────────────  ──────────────  ─────────────────────────────────────────────────────────────────────────────────────────────
    force-app/main/default/classes/SoqlInLoop.cls:1              Apex classes should declare a sharing model if DML   Security        https://pmd.github.io/pmd-6.29.0/pmd_rules_apex_security.html#apexsharingviolations
                                                                 or SOQL/SOSL is used
    force-app/main/default/classes/SoqlInLoop.cls:1              Missing ApexDoc comment                              Documentation   https://pmd.github.io/pmd-6.29.0/pmd_rules_apex_documentation.html#apexdoc
    force-app/main/default/classes/SoqlInLoop.cls:2              Missing ApexDoc comment                              Documentation   https://pmd.github.io/pmd-6.29.0/pmd_rules_apex_documentation.html#apexdoc
    force-app/main/default/classes/SoqlInLoop.cls:4              Avoid Soql queries inside loops                      Performance     https://pmd.github.io/pmd-6.29.0/pmd_rules_apex_performance.html#avoidsoqlinloops
    force-app/main/default/classes/SoqlInLoop.cls:4              Avoid operations in loops that may hit governor      Performance     https://pmd.github.io/pmd-6.29.0/pmd_rules_apex_performance.html#operationwithlimitsinloop
                                                                 limits
    force-app/main/default/classes/SoqlInLoop.cls:4              Validate CRUD permission before SOQL/DML operation   Security        https://pmd.github.io/pmd-6.29.0/pmd_rules_apex_security.html#apexcrudviolation
    force-app/main/default/classes/SoqlInLoop.cls:4              Variable 'accounts' defined but not used             Best Practices  https://pmd.github.io/pmd-6.29.0/pmd_rules_apex_bestpractices.html#unusedlocalvariable
    force-app/main/default/triggers/trgUser.trigger:1            Avoid logic in triggers                              Best Practices  https://pmd.github.io/pmd-6.29.0/pmd_rules_apex_bestpractices.html#avoidlogicintrigger
    force-app/main/default/triggers/trgUser.trigger:4            The static field name 'BaseURI' doesn't match        Code Style      https://pmd.github.io/pmd-6.29.0/pmd_rules_apex_codestyle.html#fieldnamingconventions
                                                                 '[a-z][a-zA-Z0-9]*'
    force-app/main/default/triggers/trgUser.trigger:4            Variables should start with a lowercase character,   Code Style      https://pmd.github.io/pmd-6.29.0/pmd_rules_apex_codestyle.html#variablenamingconventions
                                                                 'BaseURI' starts with uppercase character.
    force-app/main/default/triggers/trgUser.trigger:7            The local variable name 'URI' doesn't match          Code Style      https://pmd.github.io/pmd-6.29.0/pmd_rules_apex_codestyle.html#localvariablenamingconventions
                                                                 '[a-z][a-zA-Z0-9]*'
    force-app/main/default/triggers/trgUser.trigger:7            Variables should start with a lowercase character,   Code Style      https://pmd.github.io/pmd-6.29.0/pmd_rules_apex_codestyle.html#variablenamingconventions
                                                                 'URI' starts with uppercase character.
    force-app/main/default/aura/auraIf/auraIfController.js:49    'event' is defined but never used.                   Variables       https://eslint.org/docs/rules/no-unused-vars
    force-app/main/default/aura/auraIf/auraIfController.js:49    'helper' is defined but never used.                  Variables       https://eslint.org/docs/rules/no-unused-vars
    ERROR running scanner:run:  Detected rule violations of severity 1 or lower. Please see the logs above.