seagull-js/seagull

View on GitHub

Showing 54 of 54 total issues

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

  addServerBackendService(
    config?: Partial<Services.ServerBundleService['config']>
  ) {
    const bus = this as EventBus<Services.ServerBundleServiceEvents>
    this.services.ServerBackend = new Services.ServerBundleService(bus, config)
Severity: Major
Found in packages/build/src/operators/operator.ts and 4 other locations - About 2 hrs to fix
packages/build/src/operators/operator.ts on lines 60..63
packages/build/src/operators/operator.ts on lines 65..68
packages/build/src/operators/operator.ts on lines 85..90
packages/build/src/operators/operator.ts on lines 99..104

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

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

  addVendorBundleService(
    config?: Partial<Services.VendorBundleService['config']>
  ) {
    const bus = this as EventBus<Services.VendorBundleServiceEvents>
    this.services.VendorBundle = new Services.VendorBundleService(bus, config)
Severity: Major
Found in packages/build/src/operators/operator.ts and 4 other locations - About 2 hrs to fix
packages/build/src/operators/operator.ts on lines 60..63
packages/build/src/operators/operator.ts on lines 65..68
packages/build/src/operators/operator.ts on lines 85..90
packages/build/src/operators/operator.ts on lines 92..97

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

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 createPipeline has 48 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  async createPipeline() {
    setCredsByProfile(this.profile)
    // preparations for deployment
    const isTest = this.stage === 'test'
    const suffix = `${isTest ? `-${this.branch}-test` : ''}-ci`
Severity: Minor
Found in packages/deploy-aws/src/templates/seagull_pipeline.ts - About 1 hr to fix

    Function html has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      html() {
        return (
          <div>
            <Helmet>
              <script src="/instantclick.min.js" data-no-instant />
    Severity: Minor
    Found in examples/helloworld/src/pages/crud/Listing.tsx - About 1 hr to fix

      Function render has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        render() {
          const html = this.html.bind(this)
          const rendered = html()
      
          const prop = (p: any): string => (isString(p) ? p : p.bind(this)())
      Severity: Minor
      Found in packages/pages/src/Page.tsx - About 1 hr to fix

        Function checkForWinner has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          checkForWinner() {
            if (this.state.currentGameIsFinished) {
              return
            }
            const fields = this.state.fields
        Severity: Minor
        Found in examples/helloworld/src/pages/TicTacToe.tsx - About 1 hr to fix

          Function render has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            render() {
              return (
                <div>
                  {this.state.step !== 'start' && (
                    <HangmanAscii fails={this.state.fails} />
          Severity: Minor
          Found in examples/helloworld/src/pages/Hangman.tsx - About 1 hr to fix

            Function constructor has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              constructor(props: SeagullPipelineProps) {
                this.appPath = props.appPath
                this.branch = props.branch
                this.computeTypeSize = props.computeTypeSize
                this.stage = props.stage
            Severity: Minor
            Found in packages/deploy-aws/src/templates/seagull_pipeline.ts - About 1 hr to fix

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

                private result<Value>(cb: any, value: Value) {
                  return cb ? (void cb(null, value) as void) : this.requestObject(value)
                }
              Severity: Major
              Found in packages/mock-s3/src/mock-fs.ts and 3 other locations - About 1 hr to fix
              packages/mock-cloudwatchlogs/src/mock_cloudwatchlogs_fs.ts on lines 140..142
              packages/mock-cloudwatchlogs/src/mock_cloudwatchlogs_mem.ts on lines 106..108
              packages/mock-s3/src/mock-mem.ts on lines 95..97

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

              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

                private result<Value>(cb: any, value: Value) {
                  return cb ? (void cb(null, value) as void) : this.requestObject(value)
                }
              packages/mock-cloudwatchlogs/src/mock_cloudwatchlogs_fs.ts on lines 140..142
              packages/mock-s3/src/mock-fs.ts on lines 105..107
              packages/mock-s3/src/mock-mem.ts on lines 95..97

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

              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

                private result<Value>(cb: any, value: Value) {
                  return cb ? (void cb(null, value) as void) : this.requestObject(value)
                }
              Severity: Major
              Found in packages/mock-cloudwatchlogs/src/mock_cloudwatchlogs_fs.ts and 3 other locations - About 1 hr to fix
              packages/mock-cloudwatchlogs/src/mock_cloudwatchlogs_mem.ts on lines 106..108
              packages/mock-s3/src/mock-fs.ts on lines 105..107
              packages/mock-s3/src/mock-mem.ts on lines 95..97

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

              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

                private result<Value>(cb: any, value: Value) {
                  return cb ? (void cb(null, value) as void) : this.requestObject(value)
                }
              Severity: Major
              Found in packages/mock-s3/src/mock-mem.ts and 3 other locations - About 1 hr to fix
              packages/mock-cloudwatchlogs/src/mock_cloudwatchlogs_fs.ts on lines 140..142
              packages/mock-cloudwatchlogs/src/mock_cloudwatchlogs_mem.ts on lines 106..108
              packages/mock-s3/src/mock-fs.ts on lines 105..107

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

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

                private handleError = (err: any) => {
                  this.bus.emit(LogEvent, 'ServerBundleService', 'BundleError', { err })
                  this.bus.emit(BundleServerErrorEvent)
                }
              Severity: Major
              Found in packages/build/src/services/bundler/server.ts and 4 other locations - About 55 mins to fix
              packages/build/src/services/bundler/backend_page.ts on lines 57..60
              packages/build/src/services/bundler/browser_page.ts on lines 67..70
              packages/build/src/services/bundler/lambda.ts on lines 56..59
              packages/build/src/services/bundler/vendor.ts on lines 51..54

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

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

                private handleError = (err: any) => {
                  this.bus.emit(LogEvent, 'LambdaBundleService', 'BundleError', { err })
                  this.bus.emit(BundleLambdaErrorEvent)
                }
              Severity: Major
              Found in packages/build/src/services/bundler/lambda.ts and 4 other locations - About 55 mins to fix
              packages/build/src/services/bundler/backend_page.ts on lines 57..60
              packages/build/src/services/bundler/browser_page.ts on lines 67..70
              packages/build/src/services/bundler/server.ts on lines 51..54
              packages/build/src/services/bundler/vendor.ts on lines 51..54

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

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

                private handleError = (err: any) => {
                  this.bus.emit(LogEvent, 'VendorBundleService', 'BundleError', { err })
                  this.bus.emit(BundleVendorErrorEvent)
                }
              Severity: Major
              Found in packages/build/src/services/bundler/vendor.ts and 4 other locations - About 55 mins to fix
              packages/build/src/services/bundler/backend_page.ts on lines 57..60
              packages/build/src/services/bundler/browser_page.ts on lines 67..70
              packages/build/src/services/bundler/lambda.ts on lines 56..59
              packages/build/src/services/bundler/server.ts on lines 51..54

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

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

                private handleError = (err: any) => {
                  this.bus.emit(LogEvent, 'BackendPageBundleService', 'BundleError', { err })
                  this.bus.emit(BundleBackendPageErrorEvent)
                }
              Severity: Major
              Found in packages/build/src/services/bundler/backend_page.ts and 4 other locations - About 55 mins to fix
              packages/build/src/services/bundler/browser_page.ts on lines 67..70
              packages/build/src/services/bundler/lambda.ts on lines 56..59
              packages/build/src/services/bundler/server.ts on lines 51..54
              packages/build/src/services/bundler/vendor.ts on lines 51..54

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

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

                private handleError = (err: any) => {
                  this.bus.emit(LogEvent, 'BrowserPageBundleService', 'BundleError', { err })
                  this.bus.emit(BundleBrowserPageErrorEvent)
                }
              Severity: Major
              Found in packages/build/src/services/bundler/browser_page.ts and 4 other locations - About 55 mins to fix
              packages/build/src/services/bundler/backend_page.ts on lines 57..60
              packages/build/src/services/bundler/lambda.ts on lines 56..59
              packages/build/src/services/bundler/server.ts on lines 51..54
              packages/build/src/services/bundler/vendor.ts on lines 51..54

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

              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

                  constructor() {
                      const { credentials, region } = config
                      this.s3 = new S3({ credentials, region })
                  }
              Severity: Major
              Found in packages/deploy-aws/src/aws_sdk_handler/handle_s3.ts and 3 other locations - About 50 mins to fix
              packages/deploy-aws/src/aws_sdk_handler/handle_cloudfront.ts on lines 12..15
              packages/deploy-aws/src/aws_sdk_handler/handle_ssm.ts on lines 27..30
              packages/deploy-aws/src/aws_sdk_handler/handle_sts.ts on lines 10..13

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

              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

              export interface CompilerServiceEvents extends OutputServiceEvents {
                [CompileEvent]: CompilerService['handleStartCompilation']
                [CompiledEvent]: () => void
                [CompileError]: () => void
              }
              Severity: Major
              Found in packages/build/src/services/compiler.ts and 3 other locations - About 50 mins to fix
              packages/build/src/services/bundler/lambda.ts on lines 9..13
              packages/build/src/services/bundler/server.ts on lines 9..13
              packages/build/src/services/bundler/vendor.ts on lines 10..14

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

              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

              export interface VendorBundleServiceEvents extends OutputServiceEvents {
                [BundleVendorEvent]: VendorBundleService['handleStartBundling']
                [BundledVendorEvent]: () => void
                [BundleVendorErrorEvent]: () => void
              }
              Severity: Major
              Found in packages/build/src/services/bundler/vendor.ts and 3 other locations - About 50 mins to fix
              packages/build/src/services/bundler/lambda.ts on lines 9..13
              packages/build/src/services/bundler/server.ts on lines 9..13
              packages/build/src/services/compiler.ts on lines 8..12

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

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

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

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

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

              Refactorings

              Further Reading

              Severity
              Category
              Status
              Source
              Language