IBM/scc-node-sdk

View on GitHub

Showing 159 of 159 total issues

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

  export interface DeleteCustomProfileParams {
    /** The profile ID. */
    profilesId: string;
    /** The supplied or generated value of this header is logged for a request and repeated in a response header for
     *  the corresponding response. The same value is used for downstream requests and retries of those requests. If a
Severity: Major
Found in security-and-compliance-center-api/v3.ts and 12 other locations - About 55 mins to fix
security-and-compliance-center-api/v3.ts on lines 3397..3411
security-and-compliance-center-api/v3.ts on lines 3414..3428
security-and-compliance-center-api/v3.ts on lines 3561..3575
security-and-compliance-center-api/v3.ts on lines 3677..3692
security-and-compliance-center-api/v3.ts on lines 3695..3710
security-and-compliance-center-api/v3.ts on lines 3909..3923
security-and-compliance-center-api/v3.ts on lines 3945..3962
security-and-compliance-center-api/v3.ts on lines 4006..4021
security-and-compliance-center-api/v3.ts on lines 4024..4039
security-and-compliance-center-api/v3.ts on lines 4228..4243
security-and-compliance-center-api/v3.ts on lines 4282..4297
security-and-compliance-center-api/v3.ts on lines 4300..4315

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

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

  export interface GetProfileParams {
    /** The profile ID. */
    profilesId: string;
    /** The supplied or generated value of this header is logged for a request and repeated in a response header for
     *  the corresponding response. The same value is used for downstream requests and retries of those requests. If a
Severity: Major
Found in security-and-compliance-center-api/v3.ts and 12 other locations - About 55 mins to fix
security-and-compliance-center-api/v3.ts on lines 3397..3411
security-and-compliance-center-api/v3.ts on lines 3414..3428
security-and-compliance-center-api/v3.ts on lines 3544..3558
security-and-compliance-center-api/v3.ts on lines 3677..3692
security-and-compliance-center-api/v3.ts on lines 3695..3710
security-and-compliance-center-api/v3.ts on lines 3909..3923
security-and-compliance-center-api/v3.ts on lines 3945..3962
security-and-compliance-center-api/v3.ts on lines 4006..4021
security-and-compliance-center-api/v3.ts on lines 4024..4039
security-and-compliance-center-api/v3.ts on lines 4228..4243
security-and-compliance-center-api/v3.ts on lines 4282..4297
security-and-compliance-center-api/v3.ts on lines 4300..4315

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

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

  export interface GetReportSummaryParams {
    /** The ID of the scan that is associated with a report. */
    reportId: string;
    /** The supplied or generated value of this header is logged for a request and repeated in a response header for
     *  the corresponding response. The same value is used for downstream requests and retries of those requests. If a
Severity: Major
Found in security-and-compliance-center-api/v3.ts and 12 other locations - About 55 mins to fix
security-and-compliance-center-api/v3.ts on lines 3397..3411
security-and-compliance-center-api/v3.ts on lines 3414..3428
security-and-compliance-center-api/v3.ts on lines 3544..3558
security-and-compliance-center-api/v3.ts on lines 3561..3575
security-and-compliance-center-api/v3.ts on lines 3677..3692
security-and-compliance-center-api/v3.ts on lines 3695..3710
security-and-compliance-center-api/v3.ts on lines 3909..3923
security-and-compliance-center-api/v3.ts on lines 3945..3962
security-and-compliance-center-api/v3.ts on lines 4006..4021
security-and-compliance-center-api/v3.ts on lines 4228..4243
security-and-compliance-center-api/v3.ts on lines 4282..4297
security-and-compliance-center-api/v3.ts on lines 4300..4315

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

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

  export interface GetLatestReportsParams {
    /** The supplied or generated value of this header is logged for a request and repeated in a response header for
     *  the corresponding response. The same value is used for downstream requests and retries of those requests. If a
     *  value of this header is not supplied in a request, the service generates a random (version 4) UUID.
     */
Severity: Major
Found in security-and-compliance-center-api/v3.ts and 12 other locations - About 55 mins to fix
security-and-compliance-center-api/v3.ts on lines 3397..3411
security-and-compliance-center-api/v3.ts on lines 3414..3428
security-and-compliance-center-api/v3.ts on lines 3544..3558
security-and-compliance-center-api/v3.ts on lines 3561..3575
security-and-compliance-center-api/v3.ts on lines 3677..3692
security-and-compliance-center-api/v3.ts on lines 3695..3710
security-and-compliance-center-api/v3.ts on lines 3909..3923
security-and-compliance-center-api/v3.ts on lines 4006..4021
security-and-compliance-center-api/v3.ts on lines 4024..4039
security-and-compliance-center-api/v3.ts on lines 4228..4243
security-and-compliance-center-api/v3.ts on lines 4282..4297
security-and-compliance-center-api/v3.ts on lines 4300..4315

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

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

  export interface GetRuleParams {
    /** The ID of the corresponding rule. */
    ruleId: string;
    /** The supplied or generated value of this header is logged for a request and repeated in a response header for
     *  the corresponding response. The same value is used for downstream requests and retries of those requests. If a
Severity: Major
Found in security-and-compliance-center-api/v3.ts and 12 other locations - About 55 mins to fix
security-and-compliance-center-api/v3.ts on lines 3397..3411
security-and-compliance-center-api/v3.ts on lines 3414..3428
security-and-compliance-center-api/v3.ts on lines 3544..3558
security-and-compliance-center-api/v3.ts on lines 3561..3575
security-and-compliance-center-api/v3.ts on lines 3677..3692
security-and-compliance-center-api/v3.ts on lines 3909..3923
security-and-compliance-center-api/v3.ts on lines 3945..3962
security-and-compliance-center-api/v3.ts on lines 4006..4021
security-and-compliance-center-api/v3.ts on lines 4024..4039
security-and-compliance-center-api/v3.ts on lines 4228..4243
security-and-compliance-center-api/v3.ts on lines 4282..4297
security-and-compliance-center-api/v3.ts on lines 4300..4315

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

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

  export interface GetReportParams {
    /** The ID of the scan that is associated with a report. */
    reportId: string;
    /** The supplied or generated value of this header is logged for a request and repeated in a response header for
     *  the corresponding response. The same value is used for downstream requests and retries of those requests. If a
Severity: Major
Found in security-and-compliance-center-api/v3.ts and 12 other locations - About 55 mins to fix
security-and-compliance-center-api/v3.ts on lines 3397..3411
security-and-compliance-center-api/v3.ts on lines 3414..3428
security-and-compliance-center-api/v3.ts on lines 3544..3558
security-and-compliance-center-api/v3.ts on lines 3561..3575
security-and-compliance-center-api/v3.ts on lines 3677..3692
security-and-compliance-center-api/v3.ts on lines 3695..3710
security-and-compliance-center-api/v3.ts on lines 3909..3923
security-and-compliance-center-api/v3.ts on lines 3945..3962
security-and-compliance-center-api/v3.ts on lines 4024..4039
security-and-compliance-center-api/v3.ts on lines 4228..4243
security-and-compliance-center-api/v3.ts on lines 4282..4297
security-and-compliance-center-api/v3.ts on lines 4300..4315

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

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

  export interface DeleteRuleParams {
    /** The ID of the corresponding rule. */
    ruleId: string;
    /** The supplied or generated value of this header is logged for a request and repeated in a response header for
     *  the corresponding response. The same value is used for downstream requests and retries of those requests. If a
Severity: Major
Found in security-and-compliance-center-api/v3.ts and 12 other locations - About 55 mins to fix
security-and-compliance-center-api/v3.ts on lines 3397..3411
security-and-compliance-center-api/v3.ts on lines 3414..3428
security-and-compliance-center-api/v3.ts on lines 3544..3558
security-and-compliance-center-api/v3.ts on lines 3561..3575
security-and-compliance-center-api/v3.ts on lines 3695..3710
security-and-compliance-center-api/v3.ts on lines 3909..3923
security-and-compliance-center-api/v3.ts on lines 3945..3962
security-and-compliance-center-api/v3.ts on lines 4006..4021
security-and-compliance-center-api/v3.ts on lines 4024..4039
security-and-compliance-center-api/v3.ts on lines 4228..4243
security-and-compliance-center-api/v3.ts on lines 4282..4297
security-and-compliance-center-api/v3.ts on lines 4300..4315

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

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

  export interface CreateScanParams {
    /** The attachment ID of a profile. */
    attachmentId: string;
    /** The supplied or generated value of this header is logged for a request and repeated in a response header for
     *  the corresponding response. The same value is used for downstream requests and retries of those requests. If a
Severity: Major
Found in security-and-compliance-center-api/v3.ts and 12 other locations - About 55 mins to fix
security-and-compliance-center-api/v3.ts on lines 3397..3411
security-and-compliance-center-api/v3.ts on lines 3414..3428
security-and-compliance-center-api/v3.ts on lines 3544..3558
security-and-compliance-center-api/v3.ts on lines 3561..3575
security-and-compliance-center-api/v3.ts on lines 3677..3692
security-and-compliance-center-api/v3.ts on lines 3695..3710
security-and-compliance-center-api/v3.ts on lines 3945..3962
security-and-compliance-center-api/v3.ts on lines 4006..4021
security-and-compliance-center-api/v3.ts on lines 4024..4039
security-and-compliance-center-api/v3.ts on lines 4228..4243
security-and-compliance-center-api/v3.ts on lines 4282..4297
security-and-compliance-center-api/v3.ts on lines 4300..4315

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

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

  export interface GetControlLibraryParams {
    /** The control library ID. */
    controlLibrariesId: string;
    /** The supplied or generated value of this header is logged for a request and repeated in a response header for
     *  the corresponding response. The same value is used for downstream requests and retries of those requests. If a
Severity: Major
Found in security-and-compliance-center-api/v3.ts and 12 other locations - About 55 mins to fix
security-and-compliance-center-api/v3.ts on lines 3397..3411
security-and-compliance-center-api/v3.ts on lines 3544..3558
security-and-compliance-center-api/v3.ts on lines 3561..3575
security-and-compliance-center-api/v3.ts on lines 3677..3692
security-and-compliance-center-api/v3.ts on lines 3695..3710
security-and-compliance-center-api/v3.ts on lines 3909..3923
security-and-compliance-center-api/v3.ts on lines 3945..3962
security-and-compliance-center-api/v3.ts on lines 4006..4021
security-and-compliance-center-api/v3.ts on lines 4024..4039
security-and-compliance-center-api/v3.ts on lines 4228..4243
security-and-compliance-center-api/v3.ts on lines 4282..4297
security-and-compliance-center-api/v3.ts on lines 4300..4315

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

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

  export interface GetReportTagsParams {
    /** The ID of the scan that is associated with a report. */
    reportId: string;
    /** The supplied or generated value of this header is logged for a request and repeated in a response header for
     *  the corresponding response. The same value is used for downstream requests and retries of those requests. If a
Severity: Major
Found in security-and-compliance-center-api/v3.ts and 12 other locations - About 55 mins to fix
security-and-compliance-center-api/v3.ts on lines 3397..3411
security-and-compliance-center-api/v3.ts on lines 3414..3428
security-and-compliance-center-api/v3.ts on lines 3544..3558
security-and-compliance-center-api/v3.ts on lines 3561..3575
security-and-compliance-center-api/v3.ts on lines 3677..3692
security-and-compliance-center-api/v3.ts on lines 3695..3710
security-and-compliance-center-api/v3.ts on lines 3909..3923
security-and-compliance-center-api/v3.ts on lines 3945..3962
security-and-compliance-center-api/v3.ts on lines 4006..4021
security-and-compliance-center-api/v3.ts on lines 4024..4039
security-and-compliance-center-api/v3.ts on lines 4282..4297
security-and-compliance-center-api/v3.ts on lines 4300..4315

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

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

    const body = {
      'profile_name': _params.profileName,
      'profile_description': _params.profileDescription,
      'profile_type': _params.profileType,
      'controls': _params.controls,
Severity: Minor
Found in security-and-compliance-center-api/v3.ts and 1 other location - About 55 mins to fix
security-and-compliance-center-api/v3.ts on lines 1025..1031

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

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

    const body = {
      'profile_name': _params.profileName,
      'profile_description': _params.profileDescription,
      'profile_type': _params.profileType,
      'controls': _params.controls,
Severity: Minor
Found in security-and-compliance-center-api/v3.ts and 1 other location - About 55 mins to fix
security-and-compliance-center-api/v3.ts on lines 822..828

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

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

if (errors.test.length > 0) {
  body = `${body}## Possible Test Failures\n${errors.test.join('\n')}\n`;
}
Severity: Minor
Found in scripts/report_integration_test.js and 1 other location - About 50 mins to fix
scripts/report_integration_test.js on lines 44..46

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

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

if (errors.service.length > 0) {
  body = `${body}## Service Failures\n${errors.service.join('\n')}\n`;
}
Severity: Minor
Found in scripts/report_integration_test.js and 1 other location - About 50 mins to fix
scripts/report_integration_test.js on lines 48..50

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

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

  export interface AttachmentScope {
    /** The unique identifier for this scope. */
    id?: string;
    /** The environment that relates to this scope. */
    environment?: string;
Severity: Minor
Found in security-and-compliance-center-api/v3.ts and 1 other location - About 40 mins to fix
security-and-compliance-center-api/v3.ts on lines 5381..5388

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

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

  export interface ReportViolationsDrift {
    /** The ID of the home account. */
    home_account_id?: string;
    /** The ID of the report. */
    report_id?: string;
Severity: Minor
Found in security-and-compliance-center-api/v3.ts and 1 other location - About 40 mins to fix
security-and-compliance-center-api/v3.ts on lines 4560..4567

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

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

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

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

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

Refactorings

Further Reading

Function getNext has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public async getNext(): Promise<SecurityAndComplianceCenterApiV3.Report[]> {
      if (!this.hasNext()) {
        throw new Error('No more results available');
      }

Severity: Minor
Found in security-and-compliance-center-api/v3.ts - About 35 mins to fix

Cognitive Complexity

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

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

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

Further reading

Function getNext has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public async getNext(): Promise<SecurityAndComplianceCenterApiV3.Evaluation[]> {
      if (!this.hasNext()) {
        throw new Error('No more results available');
      }

Severity: Minor
Found in security-and-compliance-center-api/v3.ts - About 35 mins to fix

Cognitive Complexity

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

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

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

Further reading

Function getNext has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public async getNext(): Promise<SecurityAndComplianceCenterApiV3.Resource[]> {
      if (!this.hasNext()) {
        throw new Error('No more results available');
      }

Severity: Minor
Found in security-and-compliance-center-api/v3.ts - About 35 mins to fix

Cognitive Complexity

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

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

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

Further reading

Severity
Category
Status
Source
Language