PruvoNet/squiss-ts

View on GitHub

Showing 14 of 14 total issues

File Squiss.ts has 601 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

import * as url from 'url';
import {EventEmitter} from 'events';
import {Message} from './Message';
Severity: Major
Found in src/Squiss.ts - About 1 day to fix

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

        public getQueueVisibilityTimeout(): Promise<number> {
            if (this._queueVisibilityTimeout) {
                return Promise.resolve(this._queueVisibilityTimeout);
            }
            return this.getQueueUrl().then((queueUrl) => {
    Severity: Major
    Found in src/Squiss.ts and 1 other location - About 7 hrs to fix
    src/Squiss.ts on lines 177..194

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

    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 getQueueMaximumMessageSize(): Promise<number> {
            if (this._queueMaximumMessageSize) {
                return Promise.resolve(this._queueMaximumMessageSize);
            }
            return this.getQueueUrl().then((queueUrl) => {
    Severity: Major
    Found in src/Squiss.ts and 1 other location - About 7 hrs to fix
    src/Squiss.ts on lines 158..175

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

    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

    Squiss has 37 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export class Squiss extends (EventEmitter as new() => SquissEmitter) {
    
        public get inFlight(): number {
            return this._inFlight;
        }
    Severity: Minor
    Found in src/Squiss.ts - About 4 hrs to fix

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

          private _initS3() {
              if (this._opts.S3) {
                  if (typeof this._opts.S3 === 'function') {
                      return new this._opts.S3(this._opts.awsConfig);
                  } else {
      Severity: Major
      Found in src/Squiss.ts and 1 other location - About 3 hrs to fix
      src/Squiss.ts on lines 547..557

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

      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

          private _initSqs() {
              if (this._opts.SQS) {
                  if (typeof this._opts.SQS === 'function') {
                      return new this._opts.SQS(this._opts.awsConfig);
                  } else {
      Severity: Major
      Found in src/Squiss.ts and 1 other location - About 3 hrs to fix
      src/Squiss.ts on lines 314..324

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

      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

          on<P extends keyof TEventRecord, T>(
              this: T,
              event: P,
              listener: (...args: ListenerType<TEventRecord[P]>) => void
          ): EEMethodReturnType<TEmitter, 'on', T>;
      Severity: Major
      Found in src/EventEmitterTypesHelper.ts and 3 other locations - About 2 hrs to fix
      src/EventEmitterTypesHelper.ts on lines 45..49
      src/EventEmitterTypesHelper.ts on lines 55..59
      src/EventEmitterTypesHelper.ts on lines 85..89

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

          addListener<P extends keyof TEventRecord, T>(
              this: T,
              event: P,
              listener: (...args: ListenerType<TEventRecord[P]>) => void
          ): EEMethodReturnType<TEmitter, 'addListener', T>;
      Severity: Major
      Found in src/EventEmitterTypesHelper.ts and 3 other locations - About 2 hrs to fix
      src/EventEmitterTypesHelper.ts on lines 35..39
      src/EventEmitterTypesHelper.ts on lines 55..59
      src/EventEmitterTypesHelper.ts on lines 85..89

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

          once<P extends keyof TEventRecord, T>(
              this: T,
              event: P,
              listener: (...args: ListenerType<TEventRecord[P]>) => void
          ): EEMethodReturnType<TEmitter, 'once', T>;
      Severity: Major
      Found in src/EventEmitterTypesHelper.ts and 3 other locations - About 2 hrs to fix
      src/EventEmitterTypesHelper.ts on lines 35..39
      src/EventEmitterTypesHelper.ts on lines 45..49
      src/EventEmitterTypesHelper.ts on lines 55..59

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

          addEventListener<P extends keyof TEventRecord, T>(
              this: T,
              event: P,
              listener: (...args: ListenerType<TEventRecord[P]>) => void
          ): EEMethodReturnType<TEmitter, 'addEventListener', T>;
      Severity: Major
      Found in src/EventEmitterTypesHelper.ts and 3 other locations - About 2 hrs to fix
      src/EventEmitterTypesHelper.ts on lines 35..39
      src/EventEmitterTypesHelper.ts on lines 45..49
      src/EventEmitterTypesHelper.ts on lines 85..89

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

          removeListener<P extends keyof TEventRecord, T>(
              this: T,
              event: P,
              listener: (...args: any[]) => any
          ): EEMethodReturnType<TEmitter, 'removeListener', T>;
      Severity: Major
      Found in src/EventEmitterTypesHelper.ts and 1 other location - About 1 hr to fix
      src/EventEmitterTypesHelper.ts on lines 75..79

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

      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

          removeEventListener<P extends keyof TEventRecord, T>(
              this: T,
              event: P,
              listener: (...args: any[]) => any
          ): EEMethodReturnType<TEmitter, 'removeEventListener', T>;
      Severity: Major
      Found in src/EventEmitterTypesHelper.ts and 1 other location - About 1 hr to fix
      src/EventEmitterTypesHelper.ts on lines 65..69

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

      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

              return this.getQueueUrl()
                  .then((queueUrl) => {
                      return this.sqs.purgeQueue({QueueUrl: queueUrl}).promise();
                  })
                  .then(() => {
      Severity: Major
      Found in src/Squiss.ts and 1 other location - About 1 hr to fix
      src/Squiss.ts on lines 129..135

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

              return this.getQueueUrl()
                  .then((queueUrl) => {
                      return this.sqs.deleteQueue({QueueUrl: queueUrl}).promise();
                  })
                  .then(() => {
      Severity: Major
      Found in src/Squiss.ts and 1 other location - About 1 hr to fix
      src/Squiss.ts on lines 220..229

      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

      Severity
      Category
      Status
      Source
      Language