secureCodeBox/secureCodeBox

View on GitHub
scanners/zap/parser/parser.test.js

Summary

Maintainability
D
2 days
Test Coverage

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

test("Parsing an empty result.", async () => {
  const fileContent = await readFile(
    __dirname + "/__testFiles__/not-found.xml",
    {
      encoding: "utf8",
Severity: Major
Found in scanners/zap/parser/parser.test.js and 12 other locations - About 2 hrs to fix
scanners/cmseek/parser/parser.test.js on lines 55..65
scanners/kube-hunter/parser/parser.test.js on lines 26..36
scanners/kubeaudit/parser/parser.test.js on lines 25..35
scanners/nmap/parser/parser.test.js on lines 143..169
scanners/nmap/parser/parser.test.js on lines 171..179
scanners/nmap/parser/parser.test.js on lines 181..235
scanners/ssh-audit/parser/parser.test.js on lines 347..357
scanners/ssh-scan/parser/parser.test.js on lines 288..298
scanners/sslyze/parser/parser.test.js on lines 743..753
scanners/trivy/parser/parser.test.js on lines 103..113
scanners/typo3scan/parser/parser.test.js on lines 40..50
scanners/wpscan/parser/parser.test.js on lines 331..341

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

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("Parsing the docs.securecodebox.io results.", async () => {
  const fileContent = await readFile(
    __dirname + "/__testFiles__/docs.securecodebox.io.xml",
    {
      encoding: "utf8",
Severity: Major
Found in scanners/zap/parser/parser.test.js and 8 other locations - About 2 hrs to fix
scanners/kubeaudit/parser/parser.test.js on lines 12..23
scanners/nuclei/parser/parser.test.js on lines 12..24
scanners/nuclei/parser/parser.test.js on lines 26..38
scanners/nuclei/parser/parser.test.js on lines 54..66
scanners/zap/parser/parser.test.js on lines 12..23
scanners/zap/parser/parser.test.js on lines 25..36
scanners/zap/parser/parser.test.js on lines 64..72
scanners/zap/parser/parser.test.js on lines 74..82

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

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("Parsing the example.com results.", async () => {
  const fileContent = await readFile(
    __dirname + "/__testFiles__/example.com.xml",
    {
      encoding: "utf8",
Severity: Major
Found in scanners/zap/parser/parser.test.js and 8 other locations - About 2 hrs to fix
scanners/kubeaudit/parser/parser.test.js on lines 12..23
scanners/nuclei/parser/parser.test.js on lines 12..24
scanners/nuclei/parser/parser.test.js on lines 26..38
scanners/nuclei/parser/parser.test.js on lines 54..66
scanners/zap/parser/parser.test.js on lines 12..23
scanners/zap/parser/parser.test.js on lines 38..49
scanners/zap/parser/parser.test.js on lines 64..72
scanners/zap/parser/parser.test.js on lines 74..82

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

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("Parsing a nginx result.", async () => {
  const fileContent = await readFile(__dirname + "/__testFiles__/nginx.xml", {
    encoding: "utf8",
  });

Severity: Major
Found in scanners/zap/parser/parser.test.js and 8 other locations - About 2 hrs to fix
scanners/kubeaudit/parser/parser.test.js on lines 12..23
scanners/nuclei/parser/parser.test.js on lines 12..24
scanners/nuclei/parser/parser.test.js on lines 26..38
scanners/nuclei/parser/parser.test.js on lines 54..66
scanners/zap/parser/parser.test.js on lines 12..23
scanners/zap/parser/parser.test.js on lines 25..36
scanners/zap/parser/parser.test.js on lines 38..49
scanners/zap/parser/parser.test.js on lines 74..82

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

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("Parsing a bodgeit result.", async () => {
  const fileContent = await readFile(__dirname + "/__testFiles__/bodgeit.xml", {
    encoding: "utf8",
  });

Severity: Major
Found in scanners/zap/parser/parser.test.js and 8 other locations - About 2 hrs to fix
scanners/kubeaudit/parser/parser.test.js on lines 12..23
scanners/nuclei/parser/parser.test.js on lines 12..24
scanners/nuclei/parser/parser.test.js on lines 26..38
scanners/nuclei/parser/parser.test.js on lines 54..66
scanners/zap/parser/parser.test.js on lines 12..23
scanners/zap/parser/parser.test.js on lines 25..36
scanners/zap/parser/parser.test.js on lines 38..49
scanners/zap/parser/parser.test.js on lines 64..72

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

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("Parsing the juice-shop results.", async () => {
  const fileContent = await readFile(
    __dirname + "/__testFiles__/juice-shop.xml",
    {
      encoding: "utf8",
Severity: Major
Found in scanners/zap/parser/parser.test.js and 8 other locations - About 2 hrs to fix
scanners/kubeaudit/parser/parser.test.js on lines 12..23
scanners/nuclei/parser/parser.test.js on lines 12..24
scanners/nuclei/parser/parser.test.js on lines 26..38
scanners/nuclei/parser/parser.test.js on lines 54..66
scanners/zap/parser/parser.test.js on lines 25..36
scanners/zap/parser/parser.test.js on lines 38..49
scanners/zap/parser/parser.test.js on lines 64..72
scanners/zap/parser/parser.test.js on lines 74..82

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

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

There are no issues that match your filters.

Category
Status