dataplug-io/dataplug

View on GitHub

Showing 5 of 21 total issues

Function toJSONSchema has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  toJSONSchema() {
    const schema: ConfigDeclarationJsonSchema = {
      type: 'object',
      additionalProperties: false,
      properties: {},
Severity: Minor
Found in src/configDeclaration.ts - About 1 hr to fix

    Function _obtainNextStream has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      _obtainNextStream() {
        if (this._nextStreamGetter) {
          // @ts-ignore
          Promise.try(() => this._nextStreamGetter(this._stream, this._context))
            .catch(error => {
    Severity: Minor
    Found in src/sequence.ts - About 1 hr to fix

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

      export default async function replicate(
        chain: Array<
          NodeJS.ReadableStream | NodeJS.WritableStream | Transform | Promise<any>
        >,
      ) {
      Severity: Minor
      Found in src/replicate.ts - About 1 hr to fix

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

          apply(values: Object) {
            let mappedValues = {}
            forOwn(this, (declaration: any, selector) => {
              let wasMatched = false
              if (declaration.mapper) {
        Severity: Minor
        Found in src/configMapping.ts - About 1 hr to fix

          Function constructor has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            constructor(
              sequence: Function | Array<NodeJS.ReadableStream>,
              options?: SequenceOptions,
            ) {
              options = Object.assign({}, Sequence.DEFAULT_OPTIONS, options)
          Severity: Minor
          Found in src/sequence.ts - About 45 mins to fix

          Cognitive Complexity

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

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

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

          Further reading

          Severity
          Category
          Status
          Source
          Language