secureCodeBox/secureCodeBox

View on GitHub

Showing 515 of 515 total issues

Avoid too many return statements within this function.
Open

            return "traditional-html-plus"
Severity: Major
Found in scanners/zap-advanced/scanner/zapclient/zap_automation.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return createMissingNetworkPolicyFinding(finding);
    Severity: Major
    Found in scanners/kubeaudit/parser/parser.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return createNonRootUserNotEnforcedFinding(finding);
      Severity: Major
      Found in scanners/kubeaudit/parser/parser.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

          return ["Nikto Finding", INFORMATIONAL];
        Severity: Major
        Found in scanners/nikto/parser/parser.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                      return "traditional-html"
          Severity: Major
          Found in scanners/zap-advanced/scanner/zapclient/zap_automation.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                        return "traditional-md"
            Severity: Major
            Found in scanners/zap-advanced/scanner/zapclient/zap_automation.py - About 30 mins to fix

              Similar blocks of code found in 5 locations. Consider refactoring.
              Open

                public V1ScanSpec addParametersItem(String parametersItem) {
                  if (this.parameters == null) {
                    this.parameters = new ArrayList<>();
                  }
                  this.parameters.add(parametersItem);
              hooks/persistence-defectdojo/hook/src/main/java/io/securecodebox/models/V1ScanSpecCascades.java on lines 227..233
              hooks/persistence-defectdojo/hook/src/main/java/io/securecodebox/models/V1ScanSpecCascadesMatchExpressions.java on lines 106..112
              hooks/persistence-defectdojo/hook/src/main/java/io/securecodebox/models/V1ScanStatus.java on lines 210..216
              hooks/persistence-defectdojo/hook/src/main/java/io/securecodebox/models/V1ScanStatus.java on lines 338..344

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 40.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Avoid too many return statements within this function.
              Open

                      return None

                Similar blocks of code found in 5 locations. Consider refactoring.
                Open

                  public V1ScanSpecCascadesMatchExpressions addValuesItem(String valuesItem) {
                    if (this.values == null) {
                      this.values = new ArrayList<>();
                    }
                    this.values.add(valuesItem);
                hooks/persistence-defectdojo/hook/src/main/java/io/securecodebox/models/V1ScanSpec.java on lines 78..84
                hooks/persistence-defectdojo/hook/src/main/java/io/securecodebox/models/V1ScanSpecCascades.java on lines 227..233
                hooks/persistence-defectdojo/hook/src/main/java/io/securecodebox/models/V1ScanStatus.java on lines 210..216
                hooks/persistence-defectdojo/hook/src/main/java/io/securecodebox/models/V1ScanStatus.java on lines 338..344

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 40.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 5 locations. Consider refactoring.
                Open

                  public V1ScanSpecCascades addMatchExpressionsItem(V1ScanSpecCascadesMatchExpressions matchExpressionsItem) {
                    if (this.matchExpressions == null) {
                      this.matchExpressions = new ArrayList<>();
                    }
                    this.matchExpressions.add(matchExpressionsItem);
                hooks/persistence-defectdojo/hook/src/main/java/io/securecodebox/models/V1ScanSpec.java on lines 78..84
                hooks/persistence-defectdojo/hook/src/main/java/io/securecodebox/models/V1ScanSpecCascadesMatchExpressions.java on lines 106..112
                hooks/persistence-defectdojo/hook/src/main/java/io/securecodebox/models/V1ScanStatus.java on lines 210..216
                hooks/persistence-defectdojo/hook/src/main/java/io/securecodebox/models/V1ScanStatus.java on lines 338..344

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 40.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 5 locations. Consider refactoring.
                Open

                  public V1ScanStatus addReadAndWriteHookStatusItem(V1ScanStatusReadAndWriteHookStatus readAndWriteHookStatusItem) {
                    if (this.readAndWriteHookStatus == null) {
                      this.readAndWriteHookStatus = new ArrayList<>();
                    }
                    this.readAndWriteHookStatus.add(readAndWriteHookStatusItem);
                hooks/persistence-defectdojo/hook/src/main/java/io/securecodebox/models/V1ScanSpec.java on lines 78..84
                hooks/persistence-defectdojo/hook/src/main/java/io/securecodebox/models/V1ScanSpecCascades.java on lines 227..233
                hooks/persistence-defectdojo/hook/src/main/java/io/securecodebox/models/V1ScanSpecCascadesMatchExpressions.java on lines 106..112
                hooks/persistence-defectdojo/hook/src/main/java/io/securecodebox/models/V1ScanStatus.java on lines 210..216

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 40.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Avoid too many return statements within this function.
                Open

                        return None
                Severity: Major
                Found in scanners/zap-advanced/scanner/zapclient/context/zap_context.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return 3
                  Severity: Major
                  Found in scanners/zap-advanced/scanner/zapclient/context/zap_context.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                        return configuration

                      Similar blocks of code found in 5 locations. Consider refactoring.
                      Open

                        public V1ScanStatus addOrderedHookStatusesItem(List<Object> orderedHookStatusesItem) {
                          if (this.orderedHookStatuses == null) {
                            this.orderedHookStatuses = new ArrayList<>();
                          }
                          this.orderedHookStatuses.add(orderedHookStatusesItem);
                      hooks/persistence-defectdojo/hook/src/main/java/io/securecodebox/models/V1ScanSpec.java on lines 78..84
                      hooks/persistence-defectdojo/hook/src/main/java/io/securecodebox/models/V1ScanSpecCascades.java on lines 227..233
                      hooks/persistence-defectdojo/hook/src/main/java/io/securecodebox/models/V1ScanSpecCascadesMatchExpressions.java on lines 106..112
                      hooks/persistence-defectdojo/hook/src/main/java/io/securecodebox/models/V1ScanStatus.java on lines 338..344

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 40.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Identical blocks of code found in 2 locations. Consider refactoring.
                      Open

                        await handle({
                          getFindings,
                          scan,
                          workspaceId: "123123",
                          sharedKey: "aGVsbG8taS1hbS1hLXRlc3Qta2V5",
                      Severity: Minor
                      Found in hooks/persistence-azure-monitor/hook/hook.test.js and 1 other location - About 30 mins to fix
                      hooks/persistence-azure-monitor/hook/hook.test.js on lines 77..85

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 45.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Identical blocks of code found in 2 locations. Consider refactoring.
                      Open

                        await handle({
                          getFindings,
                          scan,
                          workspaceId: "123123",
                          sharedKey: "aGVsbG8taS1hbS1hLXRlc3Qta2V5",
                      Severity: Minor
                      Found in hooks/persistence-azure-monitor/hook/hook.test.js and 1 other location - About 30 mins to fix
                      hooks/persistence-azure-monitor/hook/hook.test.js on lines 47..55

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 45.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Function parse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      async function parse(scanResults) {
                        if (typeof (scanResults) === "string") // empty file
                          return [];
                      
                        const wpscanVersion = scanResults.banner.version;
                      Severity: Minor
                      Found in scanners/wpscan/parser/parser.js - About 25 mins to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

                      Function main has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      async function main() {
                        console.log("Starting Parser");
                        let scan = await extractScan();
                        let parseDefinition = await extractParseDefinition(scan);
                        const resultFileUrl = process.argv[2];
                      Severity: Minor
                      Found in parser-sdk/nodejs/parser-wrapper.js - About 25 mins to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

                      Function getCategory has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function getCategory(target) {
                          let category = "Image Vulnerability";
                          if (target.endsWith("package-lock.json") || target == "Node.js") {
                            category = "NPM Package Vulnerability";
                          } else if (target.endsWith("Gemfile.lock")) {
                      Severity: Minor
                      Found in scanners/trivy/parser/parser.js - About 25 mins to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

                      Severity
                      Category
                      Status
                      Source
                      Language