IBM/scc-node-sdk

View on GitHub
examples/security-and-compliance-center-api.v3.test.js

Summary

Maintainability
F
2 wks
Test Coverage

File security-and-compliance-center-api.v3.test.js has 1230 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * @jest-environment node
 */
/**
 * (C) Copyright IBM Corp. 2023.
Severity: Major
Found in examples/security-and-compliance-center-api.v3.test.js - About 3 days to fix

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

      test('listControlLibraries request example', async () => {
        consoleLogMock.mockImplementation((output) => {
          originalLog(output);
        });
        consoleWarnMock.mockImplementation((output) => {
    Severity: Major
    Found in examples/security-and-compliance-center-api.v3.test.js and 1 other location - About 1 day to fix
    examples/security-and-compliance-center-api.v3.test.js on lines 614..648

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

    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('listProfiles request example', async () => {
        consoleLogMock.mockImplementation((output) => {
          originalLog(output);
        });
        consoleWarnMock.mockImplementation((output) => {
    Severity: Major
    Found in examples/security-and-compliance-center-api.v3.test.js and 1 other location - About 1 day to fix
    examples/security-and-compliance-center-api.v3.test.js on lines 418..452

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

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

      test('getProfileAttachment request example', async () => {
        consoleLogMock.mockImplementation((output) => {
          originalLog(output);
        });
        consoleWarnMock.mockImplementation((output) => {
    Severity: Major
    Found in examples/security-and-compliance-center-api.v3.test.js and 3 other locations - About 7 hrs to fix
    examples/security-and-compliance-center-api.v3.test.js on lines 1557..1584
    examples/security-and-compliance-center-api.v3.test.js on lines 1586..1613
    examples/security-and-compliance-center-api.v3.test.js on lines 1639..1666

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

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

      test('updateProviderTypeInstance request example', async () => {
        consoleLogMock.mockImplementation((output) => {
          originalLog(output);
        });
        consoleWarnMock.mockImplementation((output) => {
    Severity: Major
    Found in examples/security-and-compliance-center-api.v3.test.js and 3 other locations - About 7 hrs to fix
    examples/security-and-compliance-center-api.v3.test.js on lines 953..980
    examples/security-and-compliance-center-api.v3.test.js on lines 1557..1584
    examples/security-and-compliance-center-api.v3.test.js on lines 1639..1666

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

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

      test('deleteProfileAttachment request example', async () => {
        consoleLogMock.mockImplementation((output) => {
          originalLog(output);
        });
        consoleWarnMock.mockImplementation((output) => {
    Severity: Major
    Found in examples/security-and-compliance-center-api.v3.test.js and 3 other locations - About 7 hrs to fix
    examples/security-and-compliance-center-api.v3.test.js on lines 953..980
    examples/security-and-compliance-center-api.v3.test.js on lines 1557..1584
    examples/security-and-compliance-center-api.v3.test.js on lines 1586..1613

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

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

      test('getProviderTypeInstance request example', async () => {
        consoleLogMock.mockImplementation((output) => {
          originalLog(output);
        });
        consoleWarnMock.mockImplementation((output) => {
    Severity: Major
    Found in examples/security-and-compliance-center-api.v3.test.js and 3 other locations - About 7 hrs to fix
    examples/security-and-compliance-center-api.v3.test.js on lines 953..980
    examples/security-and-compliance-center-api.v3.test.js on lines 1586..1613
    examples/security-and-compliance-center-api.v3.test.js on lines 1639..1666

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

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

      test('getProfile request example', async () => {
        consoleLogMock.mockImplementation((output) => {
          originalLog(output);
        });
        consoleWarnMock.mockImplementation((output) => {
    Severity: Major
    Found in examples/security-and-compliance-center-api.v3.test.js and 9 other locations - About 7 hrs to fix
    examples/security-and-compliance-center-api.v3.test.js on lines 454..480
    examples/security-and-compliance-center-api.v3.test.js on lines 1163..1189
    examples/security-and-compliance-center-api.v3.test.js on lines 1191..1217
    examples/security-and-compliance-center-api.v3.test.js on lines 1389..1415
    examples/security-and-compliance-center-api.v3.test.js on lines 1417..1443
    examples/security-and-compliance-center-api.v3.test.js on lines 1471..1497
    examples/security-and-compliance-center-api.v3.test.js on lines 1499..1525
    examples/security-and-compliance-center-api.v3.test.js on lines 1668..1694
    examples/security-and-compliance-center-api.v3.test.js on lines 1696..1722

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

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

      test('getReportSummary request example', async () => {
        consoleLogMock.mockImplementation((output) => {
          originalLog(output);
        });
        consoleWarnMock.mockImplementation((output) => {
    Severity: Major
    Found in examples/security-and-compliance-center-api.v3.test.js and 9 other locations - About 7 hrs to fix
    examples/security-and-compliance-center-api.v3.test.js on lines 454..480
    examples/security-and-compliance-center-api.v3.test.js on lines 650..676
    examples/security-and-compliance-center-api.v3.test.js on lines 1163..1189
    examples/security-and-compliance-center-api.v3.test.js on lines 1389..1415
    examples/security-and-compliance-center-api.v3.test.js on lines 1417..1443
    examples/security-and-compliance-center-api.v3.test.js on lines 1471..1497
    examples/security-and-compliance-center-api.v3.test.js on lines 1499..1525
    examples/security-and-compliance-center-api.v3.test.js on lines 1668..1694
    examples/security-and-compliance-center-api.v3.test.js on lines 1696..1722

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

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

      test('listProviderTypeInstances request example', async () => {
        consoleLogMock.mockImplementation((output) => {
          originalLog(output);
        });
        consoleWarnMock.mockImplementation((output) => {
    Severity: Major
    Found in examples/security-and-compliance-center-api.v3.test.js and 9 other locations - About 7 hrs to fix
    examples/security-and-compliance-center-api.v3.test.js on lines 454..480
    examples/security-and-compliance-center-api.v3.test.js on lines 650..676
    examples/security-and-compliance-center-api.v3.test.js on lines 1163..1189
    examples/security-and-compliance-center-api.v3.test.js on lines 1191..1217
    examples/security-and-compliance-center-api.v3.test.js on lines 1389..1415
    examples/security-and-compliance-center-api.v3.test.js on lines 1417..1443
    examples/security-and-compliance-center-api.v3.test.js on lines 1471..1497
    examples/security-and-compliance-center-api.v3.test.js on lines 1668..1694
    examples/security-and-compliance-center-api.v3.test.js on lines 1696..1722

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

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

      test('getReportTags request example', async () => {
        consoleLogMock.mockImplementation((output) => {
          originalLog(output);
        });
        consoleWarnMock.mockImplementation((output) => {
    Severity: Major
    Found in examples/security-and-compliance-center-api.v3.test.js and 9 other locations - About 7 hrs to fix
    examples/security-and-compliance-center-api.v3.test.js on lines 454..480
    examples/security-and-compliance-center-api.v3.test.js on lines 650..676
    examples/security-and-compliance-center-api.v3.test.js on lines 1163..1189
    examples/security-and-compliance-center-api.v3.test.js on lines 1191..1217
    examples/security-and-compliance-center-api.v3.test.js on lines 1417..1443
    examples/security-and-compliance-center-api.v3.test.js on lines 1471..1497
    examples/security-and-compliance-center-api.v3.test.js on lines 1499..1525
    examples/security-and-compliance-center-api.v3.test.js on lines 1668..1694
    examples/security-and-compliance-center-api.v3.test.js on lines 1696..1722

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

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

      test('deleteCustomProfile request example', async () => {
        consoleLogMock.mockImplementation((output) => {
          originalLog(output);
        });
        consoleWarnMock.mockImplementation((output) => {
    Severity: Major
    Found in examples/security-and-compliance-center-api.v3.test.js and 9 other locations - About 7 hrs to fix
    examples/security-and-compliance-center-api.v3.test.js on lines 454..480
    examples/security-and-compliance-center-api.v3.test.js on lines 650..676
    examples/security-and-compliance-center-api.v3.test.js on lines 1163..1189
    examples/security-and-compliance-center-api.v3.test.js on lines 1191..1217
    examples/security-and-compliance-center-api.v3.test.js on lines 1389..1415
    examples/security-and-compliance-center-api.v3.test.js on lines 1417..1443
    examples/security-and-compliance-center-api.v3.test.js on lines 1471..1497
    examples/security-and-compliance-center-api.v3.test.js on lines 1499..1525
    examples/security-and-compliance-center-api.v3.test.js on lines 1696..1722

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

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

      test('getReport request example', async () => {
        consoleLogMock.mockImplementation((output) => {
          originalLog(output);
        });
        consoleWarnMock.mockImplementation((output) => {
    Severity: Major
    Found in examples/security-and-compliance-center-api.v3.test.js and 9 other locations - About 7 hrs to fix
    examples/security-and-compliance-center-api.v3.test.js on lines 454..480
    examples/security-and-compliance-center-api.v3.test.js on lines 650..676
    examples/security-and-compliance-center-api.v3.test.js on lines 1191..1217
    examples/security-and-compliance-center-api.v3.test.js on lines 1389..1415
    examples/security-and-compliance-center-api.v3.test.js on lines 1417..1443
    examples/security-and-compliance-center-api.v3.test.js on lines 1471..1497
    examples/security-and-compliance-center-api.v3.test.js on lines 1499..1525
    examples/security-and-compliance-center-api.v3.test.js on lines 1668..1694
    examples/security-and-compliance-center-api.v3.test.js on lines 1696..1722

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

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

      test('getProviderTypeById request example', async () => {
        consoleLogMock.mockImplementation((output) => {
          originalLog(output);
        });
        consoleWarnMock.mockImplementation((output) => {
    Severity: Major
    Found in examples/security-and-compliance-center-api.v3.test.js and 9 other locations - About 7 hrs to fix
    examples/security-and-compliance-center-api.v3.test.js on lines 454..480
    examples/security-and-compliance-center-api.v3.test.js on lines 650..676
    examples/security-and-compliance-center-api.v3.test.js on lines 1163..1189
    examples/security-and-compliance-center-api.v3.test.js on lines 1191..1217
    examples/security-and-compliance-center-api.v3.test.js on lines 1389..1415
    examples/security-and-compliance-center-api.v3.test.js on lines 1417..1443
    examples/security-and-compliance-center-api.v3.test.js on lines 1499..1525
    examples/security-and-compliance-center-api.v3.test.js on lines 1668..1694
    examples/security-and-compliance-center-api.v3.test.js on lines 1696..1722

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

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

      test('deleteCustomControlLibrary request example', async () => {
        consoleLogMock.mockImplementation((output) => {
          originalLog(output);
        });
        consoleWarnMock.mockImplementation((output) => {
    Severity: Major
    Found in examples/security-and-compliance-center-api.v3.test.js and 9 other locations - About 7 hrs to fix
    examples/security-and-compliance-center-api.v3.test.js on lines 454..480
    examples/security-and-compliance-center-api.v3.test.js on lines 650..676
    examples/security-and-compliance-center-api.v3.test.js on lines 1163..1189
    examples/security-and-compliance-center-api.v3.test.js on lines 1191..1217
    examples/security-and-compliance-center-api.v3.test.js on lines 1389..1415
    examples/security-and-compliance-center-api.v3.test.js on lines 1417..1443
    examples/security-and-compliance-center-api.v3.test.js on lines 1471..1497
    examples/security-and-compliance-center-api.v3.test.js on lines 1499..1525
    examples/security-and-compliance-center-api.v3.test.js on lines 1668..1694

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

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

      test('getControlLibrary request example', async () => {
        consoleLogMock.mockImplementation((output) => {
          originalLog(output);
        });
        consoleWarnMock.mockImplementation((output) => {
    Severity: Major
    Found in examples/security-and-compliance-center-api.v3.test.js and 9 other locations - About 7 hrs to fix
    examples/security-and-compliance-center-api.v3.test.js on lines 650..676
    examples/security-and-compliance-center-api.v3.test.js on lines 1163..1189
    examples/security-and-compliance-center-api.v3.test.js on lines 1191..1217
    examples/security-and-compliance-center-api.v3.test.js on lines 1389..1415
    examples/security-and-compliance-center-api.v3.test.js on lines 1417..1443
    examples/security-and-compliance-center-api.v3.test.js on lines 1471..1497
    examples/security-and-compliance-center-api.v3.test.js on lines 1499..1525
    examples/security-and-compliance-center-api.v3.test.js on lines 1668..1694
    examples/security-and-compliance-center-api.v3.test.js on lines 1696..1722

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

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

      test('getReportViolationsDrift request example', async () => {
        consoleLogMock.mockImplementation((output) => {
          originalLog(output);
        });
        consoleWarnMock.mockImplementation((output) => {
    Severity: Major
    Found in examples/security-and-compliance-center-api.v3.test.js and 9 other locations - About 7 hrs to fix
    examples/security-and-compliance-center-api.v3.test.js on lines 454..480
    examples/security-and-compliance-center-api.v3.test.js on lines 650..676
    examples/security-and-compliance-center-api.v3.test.js on lines 1163..1189
    examples/security-and-compliance-center-api.v3.test.js on lines 1191..1217
    examples/security-and-compliance-center-api.v3.test.js on lines 1389..1415
    examples/security-and-compliance-center-api.v3.test.js on lines 1471..1497
    examples/security-and-compliance-center-api.v3.test.js on lines 1499..1525
    examples/security-and-compliance-center-api.v3.test.js on lines 1668..1694
    examples/security-and-compliance-center-api.v3.test.js on lines 1696..1722

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

    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

        try {
          res = await securityAndComplianceCenterApiService.getProviderTypesInstances({});
          console.log(JSON.stringify(res.result, null, 2));
        } catch (err) {
          console.warn(err);
    Severity: Major
    Found in examples/security-and-compliance-center-api.v3.test.js and 1 other location - About 1 hr to fix
    examples/security-and-compliance-center-api.v3.test.js on lines 1459..1464

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

    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

        try {
          res = await securityAndComplianceCenterApiService.listProviderTypes({});
          console.log(JSON.stringify(res.result, null, 2));
        } catch (err) {
          console.warn(err);
    Severity: Major
    Found in examples/security-and-compliance-center-api.v3.test.js and 1 other location - About 1 hr to fix
    examples/security-and-compliance-center-api.v3.test.js on lines 1629..1634

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

    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

        const controlsInControlLibModel = {
          control_name: 'SC-7',
          control_id: '1fa45e17-9322-4e6c-bbd6-1c51db08e790',
          control_description: 'Boundary Protection',
          control_category: 'System and Communications Protection',
    Severity: Major
    Found in examples/security-and-compliance-center-api.v3.test.js and 1 other location - About 1 hr to fix
    examples/security-and-compliance-center-api.v3.test.js on lines 530..540

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

    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

        const controlsInControlLibModel = {
          control_name: 'SC-7',
          control_id: '1fa45e17-9322-4e6c-bbd6-1c51db08e790',
          control_description: 'Boundary Protection',
          control_category: 'System and Communications Protection',
    Severity: Major
    Found in examples/security-and-compliance-center-api.v3.test.js and 1 other location - About 1 hr to fix
    examples/security-and-compliance-center-api.v3.test.js on lines 385..395

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

    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