secureCodeBox/secureCodeBox

View on GitHub

Showing 515 of 515 total issues

File hook.test.js has 2560 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// SPDX-FileCopyrightText: the secureCodeBox authors
//
// SPDX-License-Identifier: Apache-2.0

const {getCascadingScans} = require("./hook");
Severity: Major
Found in hooks/cascading-scans/hook/hook.test.js - About 1 wk to fix

    File parser.test.js has 1226 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // SPDX-FileCopyrightText: the secureCodeBox authors
    //
    // SPDX-License-Identifier: Apache-2.0
    
    const { readFile } = require("fs/promises");
    Severity: Major
    Found in scanners/nmap/parser/parser.test.js - About 3 days to fix

      File scope-limiter.test.js has 942 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      // SPDX-FileCopyrightText: the secureCodeBox authors
      //
      // SPDX-License-Identifier: Apache-2.0
      
      const {isInScope: isInScopeInternal} = require("./scope-limiter");
      Severity: Major
      Found in hooks/cascading-scans/hook/scope-limiter.test.js - About 2 days to fix

        File parser.test.js has 872 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        // SPDX-FileCopyrightText: the secureCodeBox authors
        //
        // SPDX-License-Identifier: Apache-2.0
        
        const fs = require("fs");
        Severity: Major
        Found in scanners/ssh-audit/parser/parser.test.js - About 2 days to fix

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

          test("should not merge hookSelector into cascaded scan if inheritHookSelector is disabled", () => {
            parentScan.spec.cascades.inheritHookSelector = false;
            const findings = [
              {
                name: "Port 443 is open",
          Severity: Major
          Found in hooks/cascading-scans/hook/hook.test.js and 1 other location - About 1 day to fix
          hooks/cascading-scans/hook/hook.test.js on lines 1671..1744

          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 324.

          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 2 locations. Consider refactoring.
          Open

          test("should merge hookSelector into cascaded scan if inheritHookSelector is enabled", () => {
            parentScan.spec.cascades.inheritHookSelector = true;
            const findings = [
              {
                name: "Port 443 is open",
          Severity: Major
          Found in hooks/cascading-scans/hook/hook.test.js and 1 other location - About 1 day to fix
          hooks/cascading-scans/hook/hook.test.js on lines 1746..1812

          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 324.

          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

          File parser.test.js has 722 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          // SPDX-FileCopyrightText: the secureCodeBox authors
          //
          // SPDX-License-Identifier: Apache-2.0
          
          const { readFile } = require("fs/promises");
          Severity: Major
          Found in scanners/sslyze/parser/parser.test.js - About 1 day to fix

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

            test("Templating should apply to initContainer commands", () => {
              const findings = [
                {
                  name: "Port 443 is open",
                  category: "Open Port",
            Severity: Major
            Found in hooks/cascading-scans/hook/hook.test.js and 1 other location - About 1 day to fix
            hooks/cascading-scans/hook/hook.test.js on lines 1533..1669

            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 286.

            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 2 locations. Consider refactoring.
            Open

            test("Templating should not break special encoding (http://...) when using triple-mustache {{{}}}", () => {
              const findings = [
                {
                  name: "Port 443 is open",
                  category: "Open Port",
            Severity: Major
            Found in hooks/cascading-scans/hook/hook.test.js and 1 other location - About 1 day to fix
            hooks/cascading-scans/hook/hook.test.js on lines 1253..1389

            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 286.

            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

            File zz_generated.deepcopy.go has 844 lines of code (exceeds 500 allowed). Consider refactoring.
            Open

            //go:build !ignore_autogenerated
            // +build !ignore_autogenerated
            
            // SPDX-FileCopyrightText: the secureCodeBox authors
            //
            Severity: Major
            Found in operator/apis/execution/v1/zz_generated.deepcopy.go - About 1 day to fix

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

              test("Should Send Message With Findings And Severities", async () => {
              
                const scan: Scan = {
                  metadata: {
                    uid: "09988cdf-1fc7-4f85-95ee-1b1d65dbc7cc",
              Severity: Major
              Found in hooks/notification/hook/Notifiers/SlackNotifier.test.ts and 1 other location - About 1 day to fix
              hooks/notification/hook/Notifiers/MSTeamsNotifier.test.ts on lines 25..71

              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 234.

              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 2 locations. Consider refactoring.
              Open

              test("Should Send Message With Findings And Severities", async () => {
              
                const scan: Scan = {
                  metadata: {
                    uid: "09988cdf-1fc7-4f85-95ee-1b1d65dbc7cc",
              Severity: Major
              Found in hooks/notification/hook/Notifiers/MSTeamsNotifier.test.ts and 1 other location - About 1 day to fix
              hooks/notification/hook/Notifiers/SlackNotifier.test.ts on lines 25..71

              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 234.

              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

              File parser.test.js has 570 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              // SPDX-FileCopyrightText: the secureCodeBox authors
              //
              // SPDX-License-Identifier: Apache-2.0
              
              const { readFile } = require("fs/promises");
              Severity: Major
              Found in scanners/git-repo-scanner/parser/parser.test.js - About 1 day to fix

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

                var BrokenConfig = configv1.AutoDiscoveryConfig{
                    Cluster: configv1.ClusterConfig{
                        Name: "test-cluster",
                    },
                    ServiceAutoDiscoveryConfig: configv1.ServiceAutoDiscoveryConfig{
                Severity: Major
                Found in auto-discovery/kubernetes/controllers/suite_test_util.go and 1 other location - About 1 day to fix
                auto-discovery/kubernetes/controllers/suite_test_util.go on lines 14..99

                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 645.

                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 2 locations. Consider refactoring.
                Open

                var Config = configv1.AutoDiscoveryConfig{
                    Cluster: configv1.ClusterConfig{
                        Name: "test-cluster",
                    },
                    ServiceAutoDiscoveryConfig: configv1.ServiceAutoDiscoveryConfig{
                Severity: Major
                Found in auto-discovery/kubernetes/controllers/suite_test_util.go and 1 other location - About 1 day to fix
                auto-discovery/kubernetes/controllers/suite_test_util.go on lines 102..187

                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 645.

                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 2 locations. Consider refactoring.
                Open

                test("should not copy labels if inheritLabels is set to false", () => {
                  parentScan.metadata.labels = {
                    organization: "OWASP",
                    location: "barcelona",
                    vlan: "lan",
                Severity: Major
                Found in hooks/cascading-scans/hook/hook.test.js and 1 other location - About 1 day to fix
                hooks/cascading-scans/hook/hook.test.js on lines 507..544

                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 199.

                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 2 locations. Consider refactoring.
                Open

                test("should copy labels if inheritLabels is set to true", () => {
                  parentScan.metadata.labels = {
                    organization: "OWASP",
                    location: "barcelona",
                    vlan: "lan",
                Severity: Major
                Found in hooks/cascading-scans/hook/hook.test.js and 1 other location - About 1 day to fix
                hooks/cascading-scans/hook/hook.test.js on lines 432..468

                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 199.

                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 2 locations. Consider refactoring.
                Open

                test("should not copy annotations if inheritAnnotations is set to false", () => {
                  parentScan.metadata.annotations = {
                    "defectdojo.securecodebox.io/product-name": "barcelona-network-sca",
                    "defectdojo.securecodebox.io/engagement-name": "scb-automated-scan",
                  };
                Severity: Major
                Found in hooks/cascading-scans/hook/hook.test.js and 1 other location - About 7 hrs to fix
                hooks/cascading-scans/hook/hook.test.js on lines 619..654

                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 194.

                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 2 locations. Consider refactoring.
                Open

                test("should copy annotations if inheritAnnotations is set to true", () => {
                  parentScan.metadata.annotations = {
                    "defectdojo.securecodebox.io/product-name": "barcelona-network-sca",
                    "defectdojo.securecodebox.io/engagement-name": "scb-automated-scan",
                  };
                Severity: Major
                Found in hooks/cascading-scans/hook/hook.test.js and 1 other location - About 7 hrs to fix
                hooks/cascading-scans/hook/hook.test.js on lines 546..581

                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 194.

                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 2 locations. Consider refactoring.
                Open

                  del: {
                    critical: {
                      kex: {
                        name: "Insecure SSH KEX Algorithms",
                        description: "Discouraged SSH key exchange algorithms in use",
                Severity: Major
                Found in scanners/ssh-audit/parser/parser.js and 1 other location - About 7 hrs to fix
                scanners/ssh-audit/parser/parser.js on lines 54..99

                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 186.

                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

                Severity
                Category
                Status
                Source
                Language