secureCodeBox/secureCodeBox

View on GitHub

Showing 515 of 515 total issues

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

test(
  "ssh-scan should find a couple of findings for a dummy ssh service",
  async () => {
    const {categories, severities, count} = await scan(
      "ssh-scan-dummy-ssh",
Severity: Major
Found in scanners/ssh-scan/integration-tests/ssh-scan.test.js and 1 other location - About 3 hrs to fix
scanners/sslyze/integration-tests/sslyze.test.js on lines 9..35

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

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

test(
  "localhost port scan should only find a host finding",
  async () => {
    const {categories, severities, count} = await scan(
      "nmap-localhost",
Severity: Major
Found in scanners/nmap/integration-tests/nmap.test.js and 2 other locations - About 3 hrs to fix
scanners/ssh-audit/integration-tests/ssh-audit.test.js on lines 9..35
scanners/whatweb/integration-tests/whatweb.test.js on lines 9..32

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

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

test(
  "Whatweb scans example.com",
  async () => {
    const {categories, severities, count} = await scan(
      "whatweb-example",
Severity: Major
Found in scanners/whatweb/integration-tests/whatweb.test.js and 2 other locations - About 3 hrs to fix
scanners/nmap/integration-tests/nmap.test.js on lines 9..32
scanners/ssh-audit/integration-tests/ssh-audit.test.js on lines 9..35

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

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

test(
  "ssh-audit should find a couple of findings for a dummy ssh service",
  async () => {
    const { categories, severities, count } = await scan(
      "ssh-audit-dummy-ssh",
Severity: Major
Found in scanners/ssh-audit/integration-tests/ssh-audit.test.js and 2 other locations - About 3 hrs to fix
scanners/nmap/integration-tests/nmap.test.js on lines 9..32
scanners/whatweb/integration-tests/whatweb.test.js on lines 9..32

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

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

Method ScheduledScanReconciler.Reconcile has a Cognitive Complexity of 41 (exceeds 20 allowed). Consider refactoring.
Open

func (r *ScheduledScanReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
    log := r.Log.WithValues("scheduledscan", req.NamespacedName)

    // get the ScheduledScan
    var scheduledScan executionv1.ScheduledScan
Severity: Minor
Found in operator/controllers/execution/scheduledscan_controller.go - About 3 hrs 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

V1ScanSpecCascades has 30 methods (exceeds 20 allowed). Consider refactoring.
Open

@ApiModel(description = "CascadeSpec describes how and when cascading scans should be generated.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-11-17T10:13:00.848Z[Etc/UTC]")
public class V1ScanSpecCascades {
  public static final String SERIALIZED_NAME_INHERIT_ANNOTATIONS = "inheritAnnotations";
  @SerializedName(SERIALIZED_NAME_INHERIT_ANNOTATIONS)

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

    test("should properly parse whatweb json file", async () => {
      const fileContent = JSON.parse(
        await readFile(__dirname + "/__testFiles__/example.com.json", {
          encoding: "utf8",
        })
    Severity: Major
    Found in scanners/whatweb/parser/parser.test.js and 8 other locations - About 3 hrs to fix
    scanners/ffuf/parser/parser.test.js on lines 12..73
    scanners/ffuf/parser/parser.test.js on lines 75..116
    scanners/ffuf/parser/parser.test.js on lines 118..158
    scanners/ffuf/parser/parser.test.js on lines 160..170
    scanners/ffuf/parser/parser.test.js on lines 172..182
    scanners/whatweb/parser/parser.test.js on lines 44..54
    scanners/whatweb/parser/parser.test.js on lines 56..131
    scanners/whatweb/parser/parser.test.js on lines 133..182

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

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

    test("should properly parse whatweb json file with two domains", async () => {
      const fileContent = JSON.parse(
        await readFile(__dirname + "/__testFiles__/two-domains.json", {
          encoding: "utf8",
        })
    Severity: Major
    Found in scanners/whatweb/parser/parser.test.js and 8 other locations - About 3 hrs to fix
    scanners/ffuf/parser/parser.test.js on lines 12..73
    scanners/ffuf/parser/parser.test.js on lines 75..116
    scanners/ffuf/parser/parser.test.js on lines 118..158
    scanners/ffuf/parser/parser.test.js on lines 160..170
    scanners/ffuf/parser/parser.test.js on lines 172..182
    scanners/whatweb/parser/parser.test.js on lines 12..42
    scanners/whatweb/parser/parser.test.js on lines 44..54
    scanners/whatweb/parser/parser.test.js on lines 56..131

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

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

    test("should properly parse ffuf json file wih multiple fuzz keyword inputs", async () => {
      const fileContent = JSON.parse(
        await readFile(
          __dirname + "/__testFiles__/ffuf-results-multiple-fuzz-keywords.json",
          {
    Severity: Major
    Found in scanners/ffuf/parser/parser.test.js and 8 other locations - About 3 hrs to fix
    scanners/ffuf/parser/parser.test.js on lines 12..73
    scanners/ffuf/parser/parser.test.js on lines 118..158
    scanners/ffuf/parser/parser.test.js on lines 160..170
    scanners/ffuf/parser/parser.test.js on lines 172..182
    scanners/whatweb/parser/parser.test.js on lines 12..42
    scanners/whatweb/parser/parser.test.js on lines 44..54
    scanners/whatweb/parser/parser.test.js on lines 56..131
    scanners/whatweb/parser/parser.test.js on lines 133..182

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

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

    test("should properly parse file from inline semgrep usage", async () => {
      const jsonContent = await readFile(
        __dirname + "/__testFiles__/minimal-metadata.json",
        {
          encoding: "utf8",
    Severity: Major
    Found in scanners/semgrep/parser/parser.test.js and 2 other locations - About 3 hrs to fix
    scanners/semgrep/parser/parser.test.js on lines 41..81
    scanners/semgrep/parser/parser.test.js on lines 83..149

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

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

    test("should properly parse zero findings json file", async () => {
      const fileContent = JSON.parse(
        await readFile(__dirname + "/__testFiles__/zeroFindings.json", {
          encoding: "utf8",
        })
    Severity: Major
    Found in scanners/ffuf/parser/parser.test.js and 8 other locations - About 3 hrs to fix
    scanners/ffuf/parser/parser.test.js on lines 12..73
    scanners/ffuf/parser/parser.test.js on lines 75..116
    scanners/ffuf/parser/parser.test.js on lines 118..158
    scanners/ffuf/parser/parser.test.js on lines 160..170
    scanners/whatweb/parser/parser.test.js on lines 12..42
    scanners/whatweb/parser/parser.test.js on lines 44..54
    scanners/whatweb/parser/parser.test.js on lines 56..131
    scanners/whatweb/parser/parser.test.js on lines 133..182

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

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

    test("should properly parse ffuf json file with postdata", async () => {
      const fileContent = JSON.parse(
        await readFile(__dirname + "/__testFiles__/ffuf-results-postdata.json", {
          encoding: "utf8",
        })
    Severity: Major
    Found in scanners/ffuf/parser/parser.test.js and 8 other locations - About 3 hrs to fix
    scanners/ffuf/parser/parser.test.js on lines 12..73
    scanners/ffuf/parser/parser.test.js on lines 75..116
    scanners/ffuf/parser/parser.test.js on lines 160..170
    scanners/ffuf/parser/parser.test.js on lines 172..182
    scanners/whatweb/parser/parser.test.js on lines 12..42
    scanners/whatweb/parser/parser.test.js on lines 44..54
    scanners/whatweb/parser/parser.test.js on lines 56..131
    scanners/whatweb/parser/parser.test.js on lines 133..182

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

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

    test("should properly parse empty json file", async () => {
      const fileContent = JSON.parse(
        await readFile(__dirname + "/__testFiles__/empty.json", {
          encoding: "utf8",
        })
    Severity: Major
    Found in scanners/ffuf/parser/parser.test.js and 8 other locations - About 3 hrs to fix
    scanners/ffuf/parser/parser.test.js on lines 12..73
    scanners/ffuf/parser/parser.test.js on lines 75..116
    scanners/ffuf/parser/parser.test.js on lines 118..158
    scanners/ffuf/parser/parser.test.js on lines 172..182
    scanners/whatweb/parser/parser.test.js on lines 12..42
    scanners/whatweb/parser/parser.test.js on lines 44..54
    scanners/whatweb/parser/parser.test.js on lines 56..131
    scanners/whatweb/parser/parser.test.js on lines 133..182

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

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

    test("should properly parse securecodebox.io whatweb json file with higher aggression level(3)", async () => {
      const fileContent = JSON.parse(
        await readFile(__dirname + "/__testFiles__/securecodebox.io.json", {
          encoding: "utf8",
        })
    Severity: Major
    Found in scanners/whatweb/parser/parser.test.js and 8 other locations - About 3 hrs to fix
    scanners/ffuf/parser/parser.test.js on lines 12..73
    scanners/ffuf/parser/parser.test.js on lines 75..116
    scanners/ffuf/parser/parser.test.js on lines 118..158
    scanners/ffuf/parser/parser.test.js on lines 160..170
    scanners/ffuf/parser/parser.test.js on lines 172..182
    scanners/whatweb/parser/parser.test.js on lines 12..42
    scanners/whatweb/parser/parser.test.js on lines 44..54
    scanners/whatweb/parser/parser.test.js on lines 133..182

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

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

    test("should properly parse ffuf json file", async () => {
      const fileContent = JSON.parse(
        await readFile(__dirname + "/__testFiles__/ffuf-results.json", {
          encoding: "utf8",
        })
    Severity: Major
    Found in scanners/ffuf/parser/parser.test.js and 8 other locations - About 3 hrs to fix
    scanners/ffuf/parser/parser.test.js on lines 75..116
    scanners/ffuf/parser/parser.test.js on lines 118..158
    scanners/ffuf/parser/parser.test.js on lines 160..170
    scanners/ffuf/parser/parser.test.js on lines 172..182
    scanners/whatweb/parser/parser.test.js on lines 12..42
    scanners/whatweb/parser/parser.test.js on lines 44..54
    scanners/whatweb/parser/parser.test.js on lines 56..131
    scanners/whatweb/parser/parser.test.js on lines 133..182

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

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

    test("should properly parse file with a single result", async () => {
      const jsonContent = await readFile(
        __dirname + "/__testFiles__/python-injection.json",
        {
          encoding: "utf8",
    Severity: Major
    Found in scanners/semgrep/parser/parser.test.js and 2 other locations - About 3 hrs to fix
    scanners/semgrep/parser/parser.test.js on lines 12..39
    scanners/semgrep/parser/parser.test.js on lines 83..149

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

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

    test("should properly parse empty whatweb json file", async () => {
      const fileContent = JSON.parse(
        await readFile(__dirname + "/__testFiles__/no-address.com.json", {
          encoding: "utf8",
        })
    Severity: Major
    Found in scanners/whatweb/parser/parser.test.js and 8 other locations - About 3 hrs to fix
    scanners/ffuf/parser/parser.test.js on lines 12..73
    scanners/ffuf/parser/parser.test.js on lines 75..116
    scanners/ffuf/parser/parser.test.js on lines 118..158
    scanners/ffuf/parser/parser.test.js on lines 160..170
    scanners/ffuf/parser/parser.test.js on lines 172..182
    scanners/whatweb/parser/parser.test.js on lines 12..42
    scanners/whatweb/parser/parser.test.js on lines 56..131
    scanners/whatweb/parser/parser.test.js on lines 133..182

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

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

    test("should properly parse file with multiple results", async () => {
      const jsonContent = await readFile(
        __dirname + "/__testFiles__/python-injection-multiresult.json",
        {
          encoding: "utf8",
    Severity: Major
    Found in scanners/semgrep/parser/parser.test.js and 2 other locations - About 3 hrs to fix
    scanners/semgrep/parser/parser.test.js on lines 12..39
    scanners/semgrep/parser/parser.test.js on lines 41..81

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

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

      if (
        scan.spec.env !== undefined &&
        cascadedRuleUsedForParentScan.spec.scanSpec.env !== undefined
      ) {
        scan.spec.env = scan.spec.env.filter(
    Severity: Major
    Found in hooks/cascading-scans/hook/scan-helpers.ts and 2 other locations - About 3 hrs to fix
    hooks/cascading-scans/hook/scan-helpers.ts on lines 253..263
    hooks/cascading-scans/hook/scan-helpers.ts on lines 265..275

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

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

      if (
        scan.spec.volumes !== undefined &&
        cascadedRuleUsedForParentScan.spec.scanSpec.volumes !== undefined
      ) {
        scan.spec.volumes = scan.spec.volumes.filter(
    Severity: Major
    Found in hooks/cascading-scans/hook/scan-helpers.ts and 2 other locations - About 3 hrs to fix
    hooks/cascading-scans/hook/scan-helpers.ts on lines 241..251
    hooks/cascading-scans/hook/scan-helpers.ts on lines 265..275

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

    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