udondan/iam-floyd

View on GitHub
lib/shared/policy-statement/2-conditions.ts

Summary

Maintainability
F
4 days
Test Coverage

PolicyStatementWithCondition has 46 functions (exceeds 20 allowed). Consider refactoring.
Wontfix

export class PolicyStatementWithCondition extends PolicyStatementBase {
  protected floydConditions: Conditions = {};
  private cdkConditionsApplied = false;

  /**
Severity: Minor
Found in lib/shared/policy-statement/2-conditions.ts - About 6 hrs to fix

    File 2-conditions.ts has 352 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { Operator } from '../operators';
    import { PolicyStatementBase } from './1-base';
    
    /**
     * A Condition
    Severity: Minor
    Found in lib/shared/policy-statement/2-conditions.ts - About 4 hrs to fix

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

        public if(key: string, value: any, operator?: Operator | string) {
          if (this.servicePrefix.length && key.indexOf(':') < 0) {
            key = `${this.servicePrefix}:${key}`;
          }
      
      
      Severity: Minor
      Found in lib/shared/policy-statement/2-conditions.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

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

        public ifAwsEpochTime(
          value: number | Date | string | (number | Date | string)[],
          operator?: Operator | string,
        ) {
          if (typeof (value as Date).getMonth === 'function') {
      Severity: Major
      Found in lib/shared/policy-statement/2-conditions.ts and 1 other location - About 5 hrs to fix
      lib/shared/policy-statement/2-conditions.ts on lines 182..201

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

      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

        public ifAwsCurrentTime(
          value: Date | string | (Date | string)[],
          operator?: Operator | string,
        ) {
          if (typeof (value as Date).getMonth === 'function') {
      Severity: Major
      Found in lib/shared/policy-statement/2-conditions.ts and 1 other location - About 5 hrs to fix
      lib/shared/policy-statement/2-conditions.ts on lines 257..276

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

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

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

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

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

      Refactorings

      Further Reading

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

        public ifAwsRequestTag(
          key: string,
          value: string | string[],
          operator?: Operator | string,
        ) {
      Severity: Major
      Found in lib/shared/policy-statement/2-conditions.ts and 2 other locations - About 1 hr to fix
      lib/shared/policy-statement/2-conditions.ts on lines 495..501
      lib/shared/policy-statement/2-conditions.ts on lines 693..699

      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

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

        public ifAwsPrincipalTag(
          key: string,
          value: string | string[],
          operator?: Operator | string,
        ) {
      Severity: Major
      Found in lib/shared/policy-statement/2-conditions.ts and 2 other locations - About 1 hr to fix
      lib/shared/policy-statement/2-conditions.ts on lines 572..578
      lib/shared/policy-statement/2-conditions.ts on lines 693..699

      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

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

        public ifAwsResourceTag(
          key: string,
          value: string | string[],
          operator?: Operator | string,
        ) {
      Severity: Major
      Found in lib/shared/policy-statement/2-conditions.ts and 2 other locations - About 1 hr to fix
      lib/shared/policy-statement/2-conditions.ts on lines 495..501
      lib/shared/policy-statement/2-conditions.ts on lines 572..578

      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

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

          if (this.servicePrefix.length && key.indexOf(':') < 0) {
            key = `${this.servicePrefix}:${key}`;
          }
      Severity: Major
      Found in lib/shared/policy-statement/2-conditions.ts and 1 other location - About 1 hr to fix
      lib/shared/policy-statement/3-actions.ts on lines 116..118

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

      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

        public ifAwsSourceArn(
          value: string | string[],
          operator?: Operator | string,
        ) {
          return this.if('aws:SourceArn', value, operator ?? Operator.arnLike);
      Severity: Major
      Found in lib/shared/policy-statement/2-conditions.ts and 3 other locations - About 55 mins to fix
      lib/shared/policy-statement/2-conditions.ts on lines 236..245
      lib/shared/policy-statement/2-conditions.ts on lines 366..371
      lib/shared/policy-statement/2-conditions.ts on lines 793..795

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

        public ifAwsSourceIp(value: string | string[], operator?: Operator | string) {
          return this.if('aws:SourceIp', value, operator ?? Operator.ipAddress);
        }
      Severity: Major
      Found in lib/shared/policy-statement/2-conditions.ts and 3 other locations - About 55 mins to fix
      lib/shared/policy-statement/2-conditions.ts on lines 236..245
      lib/shared/policy-statement/2-conditions.ts on lines 366..371
      lib/shared/policy-statement/2-conditions.ts on lines 751..756

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

        public ifAwsPrincipalArn(
          value: string | string[],
          operator?: Operator | string,
        ) {
          return this.if('aws:PrincipalArn', value, operator ?? Operator.arnLike);
      Severity: Major
      Found in lib/shared/policy-statement/2-conditions.ts and 3 other locations - About 55 mins to fix
      lib/shared/policy-statement/2-conditions.ts on lines 236..245
      lib/shared/policy-statement/2-conditions.ts on lines 751..756
      lib/shared/policy-statement/2-conditions.ts on lines 793..795

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

        public ifAwsEc2InstanceSourcePrivateIPv4(
          value: string | string[],
          operator?: Operator | string,
        ) {
          return this.if(
      Severity: Major
      Found in lib/shared/policy-statement/2-conditions.ts and 3 other locations - About 55 mins to fix
      lib/shared/policy-statement/2-conditions.ts on lines 366..371
      lib/shared/policy-statement/2-conditions.ts on lines 751..756
      lib/shared/policy-statement/2-conditions.ts on lines 793..795

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

        public ifAwsSecureTransport(value?: boolean) {
          return this.if(
            `aws:SecureTransport`,
            typeof value !== 'undefined' ? value : true,
            Operator.bool,
      Severity: Major
      Found in lib/shared/policy-statement/2-conditions.ts and 3 other locations - About 50 mins to fix
      lib/shared/policy-statement/2-conditions.ts on lines 329..335
      lib/shared/policy-statement/2-conditions.ts on lines 382..388
      lib/shared/policy-statement/2-conditions.ts on lines 938..944

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

        public ifAwsMultiFactorAuthPresent(value?: boolean) {
          return this.if(
            `aws:MultiFactorAuthPresent`,
            typeof value !== 'undefined' ? value : true,
            Operator.bool,
      Severity: Major
      Found in lib/shared/policy-statement/2-conditions.ts and 3 other locations - About 50 mins to fix
      lib/shared/policy-statement/2-conditions.ts on lines 382..388
      lib/shared/policy-statement/2-conditions.ts on lines 710..716
      lib/shared/policy-statement/2-conditions.ts on lines 938..944

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

        public ifAwsPrincipalIsAWSService(value?: boolean) {
          return this.if(
            `aws:PrincipalIsAWSService`,
            typeof value !== 'undefined' ? value : true,
            Operator.bool,
      Severity: Major
      Found in lib/shared/policy-statement/2-conditions.ts and 3 other locations - About 50 mins to fix
      lib/shared/policy-statement/2-conditions.ts on lines 329..335
      lib/shared/policy-statement/2-conditions.ts on lines 710..716
      lib/shared/policy-statement/2-conditions.ts on lines 938..944

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

        public ifAwsViaAWSService(value?: boolean) {
          return this.if(
            `aws:ViaAWSService`,
            typeof value !== 'undefined' ? value : true,
            Operator.bool,
      Severity: Major
      Found in lib/shared/policy-statement/2-conditions.ts and 3 other locations - About 50 mins to fix
      lib/shared/policy-statement/2-conditions.ts on lines 329..335
      lib/shared/policy-statement/2-conditions.ts on lines 382..388
      lib/shared/policy-statement/2-conditions.ts on lines 710..716

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

        public ifAwsPrincipalType(
          value: string | string[],
          operator?: Operator | string,
        ) {
          return this.if('aws:PrincipalType', value, operator);
      Severity: Major
      Found in lib/shared/policy-statement/2-conditions.ts and 20 other locations - About 30 mins to fix
      lib/shared/policy-statement/2-conditions.ts on lines 148..153
      lib/shared/policy-statement/2-conditions.ts on lines 165..170
      lib/shared/policy-statement/2-conditions.ts on lines 217..222
      lib/shared/policy-statement/2-conditions.ts on lines 288..293
      lib/shared/policy-statement/2-conditions.ts on lines 347..352
      lib/shared/policy-statement/2-conditions.ts on lines 402..407
      lib/shared/policy-statement/2-conditions.ts on lines 425..430
      lib/shared/policy-statement/2-conditions.ts on lines 534..536
      lib/shared/policy-statement/2-conditions.ts on lines 552..557
      lib/shared/policy-statement/2-conditions.ts on lines 610..615
      lib/shared/policy-statement/2-conditions.ts on lines 641..646
      lib/shared/policy-statement/2-conditions.ts on lines 675..680
      lib/shared/policy-statement/2-conditions.ts on lines 730..735
      lib/shared/policy-statement/2-conditions.ts on lines 774..779
      lib/shared/policy-statement/2-conditions.ts on lines 807..812
      lib/shared/policy-statement/2-conditions.ts on lines 824..829
      lib/shared/policy-statement/2-conditions.ts on lines 845..847
      lib/shared/policy-statement/2-conditions.ts on lines 884..889
      lib/shared/policy-statement/2-conditions.ts on lines 901..903
      lib/shared/policy-statement/2-conditions.ts on lines 915..917

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

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

        public ifAwsSourceVpc(
          value: string | string[],
          operator?: Operator | string,
        ) {
          return this.if('aws:SourceVpc', value, operator);
      Severity: Major
      Found in lib/shared/policy-statement/2-conditions.ts and 20 other locations - About 30 mins to fix
      lib/shared/policy-statement/2-conditions.ts on lines 148..153
      lib/shared/policy-statement/2-conditions.ts on lines 165..170
      lib/shared/policy-statement/2-conditions.ts on lines 217..222
      lib/shared/policy-statement/2-conditions.ts on lines 288..293
      lib/shared/policy-statement/2-conditions.ts on lines 347..352
      lib/shared/policy-statement/2-conditions.ts on lines 402..407
      lib/shared/policy-statement/2-conditions.ts on lines 425..430
      lib/shared/policy-statement/2-conditions.ts on lines 513..518
      lib/shared/policy-statement/2-conditions.ts on lines 534..536
      lib/shared/policy-statement/2-conditions.ts on lines 552..557
      lib/shared/policy-statement/2-conditions.ts on lines 610..615
      lib/shared/policy-statement/2-conditions.ts on lines 641..646
      lib/shared/policy-statement/2-conditions.ts on lines 675..680
      lib/shared/policy-statement/2-conditions.ts on lines 730..735
      lib/shared/policy-statement/2-conditions.ts on lines 774..779
      lib/shared/policy-statement/2-conditions.ts on lines 824..829
      lib/shared/policy-statement/2-conditions.ts on lines 845..847
      lib/shared/policy-statement/2-conditions.ts on lines 884..889
      lib/shared/policy-statement/2-conditions.ts on lines 901..903
      lib/shared/policy-statement/2-conditions.ts on lines 915..917

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

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

        public ifAwsPrincipalAccount(
          value: string | string[],
          operator?: Operator | string,
        ) {
          return this.if('aws:PrincipalAccount', value, operator);
      Severity: Major
      Found in lib/shared/policy-statement/2-conditions.ts and 20 other locations - About 30 mins to fix
      lib/shared/policy-statement/2-conditions.ts on lines 148..153
      lib/shared/policy-statement/2-conditions.ts on lines 165..170
      lib/shared/policy-statement/2-conditions.ts on lines 217..222
      lib/shared/policy-statement/2-conditions.ts on lines 288..293
      lib/shared/policy-statement/2-conditions.ts on lines 402..407
      lib/shared/policy-statement/2-conditions.ts on lines 425..430
      lib/shared/policy-statement/2-conditions.ts on lines 513..518
      lib/shared/policy-statement/2-conditions.ts on lines 534..536
      lib/shared/policy-statement/2-conditions.ts on lines 552..557
      lib/shared/policy-statement/2-conditions.ts on lines 610..615
      lib/shared/policy-statement/2-conditions.ts on lines 641..646
      lib/shared/policy-statement/2-conditions.ts on lines 675..680
      lib/shared/policy-statement/2-conditions.ts on lines 730..735
      lib/shared/policy-statement/2-conditions.ts on lines 774..779
      lib/shared/policy-statement/2-conditions.ts on lines 807..812
      lib/shared/policy-statement/2-conditions.ts on lines 824..829
      lib/shared/policy-statement/2-conditions.ts on lines 845..847
      lib/shared/policy-statement/2-conditions.ts on lines 884..889
      lib/shared/policy-statement/2-conditions.ts on lines 901..903
      lib/shared/policy-statement/2-conditions.ts on lines 915..917

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

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

        public ifAwsCalledViaFirst(
          value: string | string[],
          operator?: Operator | string,
        ) {
          return this.if('aws:CalledViaFirst', value, operator);
      Severity: Major
      Found in lib/shared/policy-statement/2-conditions.ts and 20 other locations - About 30 mins to fix
      lib/shared/policy-statement/2-conditions.ts on lines 165..170
      lib/shared/policy-statement/2-conditions.ts on lines 217..222
      lib/shared/policy-statement/2-conditions.ts on lines 288..293
      lib/shared/policy-statement/2-conditions.ts on lines 347..352
      lib/shared/policy-statement/2-conditions.ts on lines 402..407
      lib/shared/policy-statement/2-conditions.ts on lines 425..430
      lib/shared/policy-statement/2-conditions.ts on lines 513..518
      lib/shared/policy-statement/2-conditions.ts on lines 534..536
      lib/shared/policy-statement/2-conditions.ts on lines 552..557
      lib/shared/policy-statement/2-conditions.ts on lines 610..615
      lib/shared/policy-statement/2-conditions.ts on lines 641..646
      lib/shared/policy-statement/2-conditions.ts on lines 675..680
      lib/shared/policy-statement/2-conditions.ts on lines 730..735
      lib/shared/policy-statement/2-conditions.ts on lines 774..779
      lib/shared/policy-statement/2-conditions.ts on lines 807..812
      lib/shared/policy-statement/2-conditions.ts on lines 824..829
      lib/shared/policy-statement/2-conditions.ts on lines 845..847
      lib/shared/policy-statement/2-conditions.ts on lines 884..889
      lib/shared/policy-statement/2-conditions.ts on lines 901..903
      lib/shared/policy-statement/2-conditions.ts on lines 915..917

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

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

        public ifAwsSourceAccount(
          value: string | string[],
          operator?: Operator | string,
        ) {
          return this.if('aws:SourceAccount', value, operator);
      Severity: Major
      Found in lib/shared/policy-statement/2-conditions.ts and 20 other locations - About 30 mins to fix
      lib/shared/policy-statement/2-conditions.ts on lines 148..153
      lib/shared/policy-statement/2-conditions.ts on lines 165..170
      lib/shared/policy-statement/2-conditions.ts on lines 217..222
      lib/shared/policy-statement/2-conditions.ts on lines 288..293
      lib/shared/policy-statement/2-conditions.ts on lines 347..352
      lib/shared/policy-statement/2-conditions.ts on lines 402..407
      lib/shared/policy-statement/2-conditions.ts on lines 425..430
      lib/shared/policy-statement/2-conditions.ts on lines 513..518
      lib/shared/policy-statement/2-conditions.ts on lines 534..536
      lib/shared/policy-statement/2-conditions.ts on lines 552..557
      lib/shared/policy-statement/2-conditions.ts on lines 610..615
      lib/shared/policy-statement/2-conditions.ts on lines 641..646
      lib/shared/policy-statement/2-conditions.ts on lines 675..680
      lib/shared/policy-statement/2-conditions.ts on lines 774..779
      lib/shared/policy-statement/2-conditions.ts on lines 807..812
      lib/shared/policy-statement/2-conditions.ts on lines 824..829
      lib/shared/policy-statement/2-conditions.ts on lines 845..847
      lib/shared/policy-statement/2-conditions.ts on lines 884..889
      lib/shared/policy-statement/2-conditions.ts on lines 901..903
      lib/shared/policy-statement/2-conditions.ts on lines 915..917

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

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

        public ifAwsUsername(value: string | string[], operator?: Operator | string) {
          return this.if('aws:username', value, operator);
        }
      Severity: Major
      Found in lib/shared/policy-statement/2-conditions.ts and 20 other locations - About 30 mins to fix
      lib/shared/policy-statement/2-conditions.ts on lines 148..153
      lib/shared/policy-statement/2-conditions.ts on lines 165..170
      lib/shared/policy-statement/2-conditions.ts on lines 217..222
      lib/shared/policy-statement/2-conditions.ts on lines 288..293
      lib/shared/policy-statement/2-conditions.ts on lines 347..352
      lib/shared/policy-statement/2-conditions.ts on lines 402..407
      lib/shared/policy-statement/2-conditions.ts on lines 425..430
      lib/shared/policy-statement/2-conditions.ts on lines 513..518
      lib/shared/policy-statement/2-conditions.ts on lines 534..536
      lib/shared/policy-statement/2-conditions.ts on lines 552..557
      lib/shared/policy-statement/2-conditions.ts on lines 610..615
      lib/shared/policy-statement/2-conditions.ts on lines 641..646
      lib/shared/policy-statement/2-conditions.ts on lines 675..680
      lib/shared/policy-statement/2-conditions.ts on lines 730..735
      lib/shared/policy-statement/2-conditions.ts on lines 774..779
      lib/shared/policy-statement/2-conditions.ts on lines 807..812
      lib/shared/policy-statement/2-conditions.ts on lines 824..829
      lib/shared/policy-statement/2-conditions.ts on lines 845..847
      lib/shared/policy-statement/2-conditions.ts on lines 884..889
      lib/shared/policy-statement/2-conditions.ts on lines 901..903

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

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

        public ifAwsCalledViaLast(
          value: string | string[],
          operator?: Operator | string,
        ) {
          return this.if('aws:CalledViaLast', value, operator);
      Severity: Major
      Found in lib/shared/policy-statement/2-conditions.ts and 20 other locations - About 30 mins to fix
      lib/shared/policy-statement/2-conditions.ts on lines 148..153
      lib/shared/policy-statement/2-conditions.ts on lines 217..222
      lib/shared/policy-statement/2-conditions.ts on lines 288..293
      lib/shared/policy-statement/2-conditions.ts on lines 347..352
      lib/shared/policy-statement/2-conditions.ts on lines 402..407
      lib/shared/policy-statement/2-conditions.ts on lines 425..430
      lib/shared/policy-statement/2-conditions.ts on lines 513..518
      lib/shared/policy-statement/2-conditions.ts on lines 534..536
      lib/shared/policy-statement/2-conditions.ts on lines 552..557
      lib/shared/policy-statement/2-conditions.ts on lines 610..615
      lib/shared/policy-statement/2-conditions.ts on lines 641..646
      lib/shared/policy-statement/2-conditions.ts on lines 675..680
      lib/shared/policy-statement/2-conditions.ts on lines 730..735
      lib/shared/policy-statement/2-conditions.ts on lines 774..779
      lib/shared/policy-statement/2-conditions.ts on lines 807..812
      lib/shared/policy-statement/2-conditions.ts on lines 824..829
      lib/shared/policy-statement/2-conditions.ts on lines 845..847
      lib/shared/policy-statement/2-conditions.ts on lines 884..889
      lib/shared/policy-statement/2-conditions.ts on lines 901..903
      lib/shared/policy-statement/2-conditions.ts on lines 915..917

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

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

        public ifAwsTagKeys(value: string | string[], operator?: Operator | string) {
          return this.if('aws:TagKeys', value, operator);
        }
      Severity: Major
      Found in lib/shared/policy-statement/2-conditions.ts and 20 other locations - About 30 mins to fix
      lib/shared/policy-statement/2-conditions.ts on lines 148..153
      lib/shared/policy-statement/2-conditions.ts on lines 165..170
      lib/shared/policy-statement/2-conditions.ts on lines 217..222
      lib/shared/policy-statement/2-conditions.ts on lines 288..293
      lib/shared/policy-statement/2-conditions.ts on lines 347..352
      lib/shared/policy-statement/2-conditions.ts on lines 402..407
      lib/shared/policy-statement/2-conditions.ts on lines 425..430
      lib/shared/policy-statement/2-conditions.ts on lines 513..518
      lib/shared/policy-statement/2-conditions.ts on lines 534..536
      lib/shared/policy-statement/2-conditions.ts on lines 552..557
      lib/shared/policy-statement/2-conditions.ts on lines 610..615
      lib/shared/policy-statement/2-conditions.ts on lines 641..646
      lib/shared/policy-statement/2-conditions.ts on lines 675..680
      lib/shared/policy-statement/2-conditions.ts on lines 730..735
      lib/shared/policy-statement/2-conditions.ts on lines 774..779
      lib/shared/policy-statement/2-conditions.ts on lines 807..812
      lib/shared/policy-statement/2-conditions.ts on lines 824..829
      lib/shared/policy-statement/2-conditions.ts on lines 884..889
      lib/shared/policy-statement/2-conditions.ts on lines 901..903
      lib/shared/policy-statement/2-conditions.ts on lines 915..917

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

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

        public ifAwsEc2InstanceSourceVpc(
          value: string | string[],
          operator?: Operator | string,
        ) {
          return this.if('aws:Ec2InstanceSourceVpc', value, operator);
      Severity: Major
      Found in lib/shared/policy-statement/2-conditions.ts and 20 other locations - About 30 mins to fix
      lib/shared/policy-statement/2-conditions.ts on lines 148..153
      lib/shared/policy-statement/2-conditions.ts on lines 165..170
      lib/shared/policy-statement/2-conditions.ts on lines 288..293
      lib/shared/policy-statement/2-conditions.ts on lines 347..352
      lib/shared/policy-statement/2-conditions.ts on lines 402..407
      lib/shared/policy-statement/2-conditions.ts on lines 425..430
      lib/shared/policy-statement/2-conditions.ts on lines 513..518
      lib/shared/policy-statement/2-conditions.ts on lines 534..536
      lib/shared/policy-statement/2-conditions.ts on lines 552..557
      lib/shared/policy-statement/2-conditions.ts on lines 610..615
      lib/shared/policy-statement/2-conditions.ts on lines 641..646
      lib/shared/policy-statement/2-conditions.ts on lines 675..680
      lib/shared/policy-statement/2-conditions.ts on lines 730..735
      lib/shared/policy-statement/2-conditions.ts on lines 774..779
      lib/shared/policy-statement/2-conditions.ts on lines 807..812
      lib/shared/policy-statement/2-conditions.ts on lines 824..829
      lib/shared/policy-statement/2-conditions.ts on lines 845..847
      lib/shared/policy-statement/2-conditions.ts on lines 884..889
      lib/shared/policy-statement/2-conditions.ts on lines 901..903
      lib/shared/policy-statement/2-conditions.ts on lines 915..917

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

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

        public ifAwsPrincipalOrgID(
          value: string | string[],
          operator?: Operator | string,
        ) {
          return this.if('aws:PrincipalOrgID', value, operator);
      Severity: Major
      Found in lib/shared/policy-statement/2-conditions.ts and 20 other locations - About 30 mins to fix
      lib/shared/policy-statement/2-conditions.ts on lines 148..153
      lib/shared/policy-statement/2-conditions.ts on lines 165..170
      lib/shared/policy-statement/2-conditions.ts on lines 217..222
      lib/shared/policy-statement/2-conditions.ts on lines 288..293
      lib/shared/policy-statement/2-conditions.ts on lines 347..352
      lib/shared/policy-statement/2-conditions.ts on lines 425..430
      lib/shared/policy-statement/2-conditions.ts on lines 513..518
      lib/shared/policy-statement/2-conditions.ts on lines 534..536
      lib/shared/policy-statement/2-conditions.ts on lines 552..557
      lib/shared/policy-statement/2-conditions.ts on lines 610..615
      lib/shared/policy-statement/2-conditions.ts on lines 641..646
      lib/shared/policy-statement/2-conditions.ts on lines 675..680
      lib/shared/policy-statement/2-conditions.ts on lines 730..735
      lib/shared/policy-statement/2-conditions.ts on lines 774..779
      lib/shared/policy-statement/2-conditions.ts on lines 807..812
      lib/shared/policy-statement/2-conditions.ts on lines 824..829
      lib/shared/policy-statement/2-conditions.ts on lines 845..847
      lib/shared/policy-statement/2-conditions.ts on lines 884..889
      lib/shared/policy-statement/2-conditions.ts on lines 901..903
      lib/shared/policy-statement/2-conditions.ts on lines 915..917

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

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

        public ifAwsResourceOrgPaths(
          value: string | string[],
          operator?: Operator | string,
        ) {
          return this.if('aws:ResourceOrgPaths', value, operator);
      Severity: Major
      Found in lib/shared/policy-statement/2-conditions.ts and 20 other locations - About 30 mins to fix
      lib/shared/policy-statement/2-conditions.ts on lines 148..153
      lib/shared/policy-statement/2-conditions.ts on lines 165..170
      lib/shared/policy-statement/2-conditions.ts on lines 217..222
      lib/shared/policy-statement/2-conditions.ts on lines 288..293
      lib/shared/policy-statement/2-conditions.ts on lines 347..352
      lib/shared/policy-statement/2-conditions.ts on lines 402..407
      lib/shared/policy-statement/2-conditions.ts on lines 425..430
      lib/shared/policy-statement/2-conditions.ts on lines 513..518
      lib/shared/policy-statement/2-conditions.ts on lines 534..536
      lib/shared/policy-statement/2-conditions.ts on lines 552..557
      lib/shared/policy-statement/2-conditions.ts on lines 610..615
      lib/shared/policy-statement/2-conditions.ts on lines 641..646
      lib/shared/policy-statement/2-conditions.ts on lines 730..735
      lib/shared/policy-statement/2-conditions.ts on lines 774..779
      lib/shared/policy-statement/2-conditions.ts on lines 807..812
      lib/shared/policy-statement/2-conditions.ts on lines 824..829
      lib/shared/policy-statement/2-conditions.ts on lines 845..847
      lib/shared/policy-statement/2-conditions.ts on lines 884..889
      lib/shared/policy-statement/2-conditions.ts on lines 901..903
      lib/shared/policy-statement/2-conditions.ts on lines 915..917

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

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

        public ifAwsUserid(value: string | string[], operator?: Operator | string) {
          return this.if('aws:userid', value, operator);
        }
      Severity: Major
      Found in lib/shared/policy-statement/2-conditions.ts and 20 other locations - About 30 mins to fix
      lib/shared/policy-statement/2-conditions.ts on lines 148..153
      lib/shared/policy-statement/2-conditions.ts on lines 165..170
      lib/shared/policy-statement/2-conditions.ts on lines 217..222
      lib/shared/policy-statement/2-conditions.ts on lines 288..293
      lib/shared/policy-statement/2-conditions.ts on lines 347..352
      lib/shared/policy-statement/2-conditions.ts on lines 402..407
      lib/shared/policy-statement/2-conditions.ts on lines 425..430
      lib/shared/policy-statement/2-conditions.ts on lines 513..518
      lib/shared/policy-statement/2-conditions.ts on lines 534..536
      lib/shared/policy-statement/2-conditions.ts on lines 552..557
      lib/shared/policy-statement/2-conditions.ts on lines 610..615
      lib/shared/policy-statement/2-conditions.ts on lines 641..646
      lib/shared/policy-statement/2-conditions.ts on lines 675..680
      lib/shared/policy-statement/2-conditions.ts on lines 730..735
      lib/shared/policy-statement/2-conditions.ts on lines 774..779
      lib/shared/policy-statement/2-conditions.ts on lines 807..812
      lib/shared/policy-statement/2-conditions.ts on lines 824..829
      lib/shared/policy-statement/2-conditions.ts on lines 845..847
      lib/shared/policy-statement/2-conditions.ts on lines 884..889
      lib/shared/policy-statement/2-conditions.ts on lines 915..917

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

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

        public ifAwsSourceIdentity(
          value: string | string[],
          operator?: Operator | string,
        ) {
          return this.if('aws:SourceIdentity', value, operator);
      Severity: Major
      Found in lib/shared/policy-statement/2-conditions.ts and 20 other locations - About 30 mins to fix
      lib/shared/policy-statement/2-conditions.ts on lines 148..153
      lib/shared/policy-statement/2-conditions.ts on lines 165..170
      lib/shared/policy-statement/2-conditions.ts on lines 217..222
      lib/shared/policy-statement/2-conditions.ts on lines 288..293
      lib/shared/policy-statement/2-conditions.ts on lines 347..352
      lib/shared/policy-statement/2-conditions.ts on lines 402..407
      lib/shared/policy-statement/2-conditions.ts on lines 425..430
      lib/shared/policy-statement/2-conditions.ts on lines 513..518
      lib/shared/policy-statement/2-conditions.ts on lines 534..536
      lib/shared/policy-statement/2-conditions.ts on lines 552..557
      lib/shared/policy-statement/2-conditions.ts on lines 610..615
      lib/shared/policy-statement/2-conditions.ts on lines 641..646
      lib/shared/policy-statement/2-conditions.ts on lines 675..680
      lib/shared/policy-statement/2-conditions.ts on lines 730..735
      lib/shared/policy-statement/2-conditions.ts on lines 807..812
      lib/shared/policy-statement/2-conditions.ts on lines 824..829
      lib/shared/policy-statement/2-conditions.ts on lines 845..847
      lib/shared/policy-statement/2-conditions.ts on lines 884..889
      lib/shared/policy-statement/2-conditions.ts on lines 901..903
      lib/shared/policy-statement/2-conditions.ts on lines 915..917

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

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

        public ifAwsSourceVpce(
          value: string | string[],
          operator?: Operator | string,
        ) {
          return this.if('aws:SourceVpce', value, operator);
      Severity: Major
      Found in lib/shared/policy-statement/2-conditions.ts and 20 other locations - About 30 mins to fix
      lib/shared/policy-statement/2-conditions.ts on lines 148..153
      lib/shared/policy-statement/2-conditions.ts on lines 165..170
      lib/shared/policy-statement/2-conditions.ts on lines 217..222
      lib/shared/policy-statement/2-conditions.ts on lines 288..293
      lib/shared/policy-statement/2-conditions.ts on lines 347..352
      lib/shared/policy-statement/2-conditions.ts on lines 402..407
      lib/shared/policy-statement/2-conditions.ts on lines 425..430
      lib/shared/policy-statement/2-conditions.ts on lines 513..518
      lib/shared/policy-statement/2-conditions.ts on lines 534..536
      lib/shared/policy-statement/2-conditions.ts on lines 552..557
      lib/shared/policy-statement/2-conditions.ts on lines 610..615
      lib/shared/policy-statement/2-conditions.ts on lines 641..646
      lib/shared/policy-statement/2-conditions.ts on lines 675..680
      lib/shared/policy-statement/2-conditions.ts on lines 730..735
      lib/shared/policy-statement/2-conditions.ts on lines 774..779
      lib/shared/policy-statement/2-conditions.ts on lines 807..812
      lib/shared/policy-statement/2-conditions.ts on lines 845..847
      lib/shared/policy-statement/2-conditions.ts on lines 884..889
      lib/shared/policy-statement/2-conditions.ts on lines 901..903
      lib/shared/policy-statement/2-conditions.ts on lines 915..917

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

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

        public ifAwsFederatedProvider(
          value: string | string[],
          operator?: Operator | string,
        ) {
          return this.if('aws:FederatedProvider', value, operator);
      Severity: Major
      Found in lib/shared/policy-statement/2-conditions.ts and 20 other locations - About 30 mins to fix
      lib/shared/policy-statement/2-conditions.ts on lines 148..153
      lib/shared/policy-statement/2-conditions.ts on lines 165..170
      lib/shared/policy-statement/2-conditions.ts on lines 217..222
      lib/shared/policy-statement/2-conditions.ts on lines 347..352
      lib/shared/policy-statement/2-conditions.ts on lines 402..407
      lib/shared/policy-statement/2-conditions.ts on lines 425..430
      lib/shared/policy-statement/2-conditions.ts on lines 513..518
      lib/shared/policy-statement/2-conditions.ts on lines 534..536
      lib/shared/policy-statement/2-conditions.ts on lines 552..557
      lib/shared/policy-statement/2-conditions.ts on lines 610..615
      lib/shared/policy-statement/2-conditions.ts on lines 641..646
      lib/shared/policy-statement/2-conditions.ts on lines 675..680
      lib/shared/policy-statement/2-conditions.ts on lines 730..735
      lib/shared/policy-statement/2-conditions.ts on lines 774..779
      lib/shared/policy-statement/2-conditions.ts on lines 807..812
      lib/shared/policy-statement/2-conditions.ts on lines 824..829
      lib/shared/policy-statement/2-conditions.ts on lines 845..847
      lib/shared/policy-statement/2-conditions.ts on lines 884..889
      lib/shared/policy-statement/2-conditions.ts on lines 901..903
      lib/shared/policy-statement/2-conditions.ts on lines 915..917

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

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

        public ifAwsRequestedRegion(
          value: string | string[],
          operator?: Operator | string,
        ) {
          return this.if('aws:RequestedRegion', value, operator);
      Severity: Major
      Found in lib/shared/policy-statement/2-conditions.ts and 20 other locations - About 30 mins to fix
      lib/shared/policy-statement/2-conditions.ts on lines 148..153
      lib/shared/policy-statement/2-conditions.ts on lines 165..170
      lib/shared/policy-statement/2-conditions.ts on lines 217..222
      lib/shared/policy-statement/2-conditions.ts on lines 288..293
      lib/shared/policy-statement/2-conditions.ts on lines 347..352
      lib/shared/policy-statement/2-conditions.ts on lines 402..407
      lib/shared/policy-statement/2-conditions.ts on lines 425..430
      lib/shared/policy-statement/2-conditions.ts on lines 513..518
      lib/shared/policy-statement/2-conditions.ts on lines 534..536
      lib/shared/policy-statement/2-conditions.ts on lines 610..615
      lib/shared/policy-statement/2-conditions.ts on lines 641..646
      lib/shared/policy-statement/2-conditions.ts on lines 675..680
      lib/shared/policy-statement/2-conditions.ts on lines 730..735
      lib/shared/policy-statement/2-conditions.ts on lines 774..779
      lib/shared/policy-statement/2-conditions.ts on lines 807..812
      lib/shared/policy-statement/2-conditions.ts on lines 824..829
      lib/shared/policy-statement/2-conditions.ts on lines 845..847
      lib/shared/policy-statement/2-conditions.ts on lines 884..889
      lib/shared/policy-statement/2-conditions.ts on lines 901..903
      lib/shared/policy-statement/2-conditions.ts on lines 915..917

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

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

        public ifAwsResourceOrgID(
          value: string | string[],
          operator?: Operator | string,
        ) {
          return this.if('aws:ResourceOrgID', value, operator);
      Severity: Major
      Found in lib/shared/policy-statement/2-conditions.ts and 20 other locations - About 30 mins to fix
      lib/shared/policy-statement/2-conditions.ts on lines 148..153
      lib/shared/policy-statement/2-conditions.ts on lines 165..170
      lib/shared/policy-statement/2-conditions.ts on lines 217..222
      lib/shared/policy-statement/2-conditions.ts on lines 288..293
      lib/shared/policy-statement/2-conditions.ts on lines 347..352
      lib/shared/policy-statement/2-conditions.ts on lines 402..407
      lib/shared/policy-statement/2-conditions.ts on lines 425..430
      lib/shared/policy-statement/2-conditions.ts on lines 513..518
      lib/shared/policy-statement/2-conditions.ts on lines 534..536
      lib/shared/policy-statement/2-conditions.ts on lines 552..557
      lib/shared/policy-statement/2-conditions.ts on lines 610..615
      lib/shared/policy-statement/2-conditions.ts on lines 675..680
      lib/shared/policy-statement/2-conditions.ts on lines 730..735
      lib/shared/policy-statement/2-conditions.ts on lines 774..779
      lib/shared/policy-statement/2-conditions.ts on lines 807..812
      lib/shared/policy-statement/2-conditions.ts on lines 824..829
      lib/shared/policy-statement/2-conditions.ts on lines 845..847
      lib/shared/policy-statement/2-conditions.ts on lines 884..889
      lib/shared/policy-statement/2-conditions.ts on lines 901..903
      lib/shared/policy-statement/2-conditions.ts on lines 915..917

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

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

        public ifAwsPrincipalOrgPaths(
          value: string | string[],
          operator?: Operator | string,
        ) {
          return this.if('aws:PrincipalOrgPaths', value, operator);
      Severity: Major
      Found in lib/shared/policy-statement/2-conditions.ts and 20 other locations - About 30 mins to fix
      lib/shared/policy-statement/2-conditions.ts on lines 148..153
      lib/shared/policy-statement/2-conditions.ts on lines 165..170
      lib/shared/policy-statement/2-conditions.ts on lines 217..222
      lib/shared/policy-statement/2-conditions.ts on lines 288..293
      lib/shared/policy-statement/2-conditions.ts on lines 347..352
      lib/shared/policy-statement/2-conditions.ts on lines 402..407
      lib/shared/policy-statement/2-conditions.ts on lines 513..518
      lib/shared/policy-statement/2-conditions.ts on lines 534..536
      lib/shared/policy-statement/2-conditions.ts on lines 552..557
      lib/shared/policy-statement/2-conditions.ts on lines 610..615
      lib/shared/policy-statement/2-conditions.ts on lines 641..646
      lib/shared/policy-statement/2-conditions.ts on lines 675..680
      lib/shared/policy-statement/2-conditions.ts on lines 730..735
      lib/shared/policy-statement/2-conditions.ts on lines 774..779
      lib/shared/policy-statement/2-conditions.ts on lines 807..812
      lib/shared/policy-statement/2-conditions.ts on lines 824..829
      lib/shared/policy-statement/2-conditions.ts on lines 845..847
      lib/shared/policy-statement/2-conditions.ts on lines 884..889
      lib/shared/policy-statement/2-conditions.ts on lines 901..903
      lib/shared/policy-statement/2-conditions.ts on lines 915..917

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

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

        public ifAwsResourceAccount(
          value: string | string[],
          operator?: Operator | string,
        ) {
          return this.if('aws:ResourceAccount', value, operator);
      Severity: Major
      Found in lib/shared/policy-statement/2-conditions.ts and 20 other locations - About 30 mins to fix
      lib/shared/policy-statement/2-conditions.ts on lines 148..153
      lib/shared/policy-statement/2-conditions.ts on lines 165..170
      lib/shared/policy-statement/2-conditions.ts on lines 217..222
      lib/shared/policy-statement/2-conditions.ts on lines 288..293
      lib/shared/policy-statement/2-conditions.ts on lines 347..352
      lib/shared/policy-statement/2-conditions.ts on lines 402..407
      lib/shared/policy-statement/2-conditions.ts on lines 425..430
      lib/shared/policy-statement/2-conditions.ts on lines 513..518
      lib/shared/policy-statement/2-conditions.ts on lines 534..536
      lib/shared/policy-statement/2-conditions.ts on lines 552..557
      lib/shared/policy-statement/2-conditions.ts on lines 641..646
      lib/shared/policy-statement/2-conditions.ts on lines 675..680
      lib/shared/policy-statement/2-conditions.ts on lines 730..735
      lib/shared/policy-statement/2-conditions.ts on lines 774..779
      lib/shared/policy-statement/2-conditions.ts on lines 807..812
      lib/shared/policy-statement/2-conditions.ts on lines 824..829
      lib/shared/policy-statement/2-conditions.ts on lines 845..847
      lib/shared/policy-statement/2-conditions.ts on lines 884..889
      lib/shared/policy-statement/2-conditions.ts on lines 901..903
      lib/shared/policy-statement/2-conditions.ts on lines 915..917

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

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

        public ifAwsUserAgent(
          value: string | string[],
          operator?: Operator | string,
        ) {
          return this.if('aws:UserAgent', value, operator);
      Severity: Major
      Found in lib/shared/policy-statement/2-conditions.ts and 20 other locations - About 30 mins to fix
      lib/shared/policy-statement/2-conditions.ts on lines 148..153
      lib/shared/policy-statement/2-conditions.ts on lines 165..170
      lib/shared/policy-statement/2-conditions.ts on lines 217..222
      lib/shared/policy-statement/2-conditions.ts on lines 288..293
      lib/shared/policy-statement/2-conditions.ts on lines 347..352
      lib/shared/policy-statement/2-conditions.ts on lines 402..407
      lib/shared/policy-statement/2-conditions.ts on lines 425..430
      lib/shared/policy-statement/2-conditions.ts on lines 513..518
      lib/shared/policy-statement/2-conditions.ts on lines 534..536
      lib/shared/policy-statement/2-conditions.ts on lines 552..557
      lib/shared/policy-statement/2-conditions.ts on lines 610..615
      lib/shared/policy-statement/2-conditions.ts on lines 641..646
      lib/shared/policy-statement/2-conditions.ts on lines 675..680
      lib/shared/policy-statement/2-conditions.ts on lines 730..735
      lib/shared/policy-statement/2-conditions.ts on lines 774..779
      lib/shared/policy-statement/2-conditions.ts on lines 807..812
      lib/shared/policy-statement/2-conditions.ts on lines 824..829
      lib/shared/policy-statement/2-conditions.ts on lines 845..847
      lib/shared/policy-statement/2-conditions.ts on lines 901..903
      lib/shared/policy-statement/2-conditions.ts on lines 915..917

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

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

        public ifAwsReferer(value: string | string[], operator?: Operator | string) {
          return this.if('aws:Referer', value, operator);
        }
      Severity: Major
      Found in lib/shared/policy-statement/2-conditions.ts and 20 other locations - About 30 mins to fix
      lib/shared/policy-statement/2-conditions.ts on lines 148..153
      lib/shared/policy-statement/2-conditions.ts on lines 165..170
      lib/shared/policy-statement/2-conditions.ts on lines 217..222
      lib/shared/policy-statement/2-conditions.ts on lines 288..293
      lib/shared/policy-statement/2-conditions.ts on lines 347..352
      lib/shared/policy-statement/2-conditions.ts on lines 402..407
      lib/shared/policy-statement/2-conditions.ts on lines 425..430
      lib/shared/policy-statement/2-conditions.ts on lines 513..518
      lib/shared/policy-statement/2-conditions.ts on lines 552..557
      lib/shared/policy-statement/2-conditions.ts on lines 610..615
      lib/shared/policy-statement/2-conditions.ts on lines 641..646
      lib/shared/policy-statement/2-conditions.ts on lines 675..680
      lib/shared/policy-statement/2-conditions.ts on lines 730..735
      lib/shared/policy-statement/2-conditions.ts on lines 774..779
      lib/shared/policy-statement/2-conditions.ts on lines 807..812
      lib/shared/policy-statement/2-conditions.ts on lines 824..829
      lib/shared/policy-statement/2-conditions.ts on lines 845..847
      lib/shared/policy-statement/2-conditions.ts on lines 884..889
      lib/shared/policy-statement/2-conditions.ts on lines 901..903
      lib/shared/policy-statement/2-conditions.ts on lines 915..917

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

      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