tunnckoCore/gibon

View on GitHub

Showing 120 of 120 total issues

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

    const parser = busboy({
      limits: {
        fieldSizeLimit: Number.POSITIVE_INFINITY,
      },
      headers: {
modules/formidable-mini/benchmark/bench-multipart-fields-100mb-big.js on lines 41..48

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

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 toFilePath has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export default function toFilePath(args) {
  if (arguments.length > 1) {
    // eslint-disable-next-line prefer-rest-params
    return toFilePath(arguments);
  }
Severity: Minor
Found in modules/to-file-path/src/index.js - 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

Avoid too many return statements within this function.
Open

    return yield* next;
Severity: Major
Found in @packages/koa-better-body/src/utils.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                return;
    Severity: Major
    Found in modules/formidable-mini/src/multipart.js - About 30 mins to fix

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

        result.value.footer = result.value.footer ? EOL + EOL + result.value.footer : '';
      Severity: Minor
      Found in @packages/parse-commit-message/src/commit.ts and 1 other location - About 30 mins to fix
      @packages/parse-commit-message/src/commit.ts on lines 79..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 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

      Avoid too many return statements within this function.
      Open

                  return;
      Severity: Major
      Found in modules/formidable-mini/src/multipart.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

          if (res.hasError) return res.error;
        Severity: Major
        Found in @packages/jest-runner-rollup/src/runner.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return yield* next;
          Severity: Major
          Found in @packages/koa-better-body/src/utils.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

              return res;
            Severity: Major
            Found in @packages/jest-runner-rollup/src/runner.js - About 30 mins to fix

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

                  const passing = pass({
                    start,
                    end: Date.now(),
                    test: { path: outFile, title: 'babel' },
                  });
              Severity: Minor
              Found in @tunnckocore/jest-runner-babel/src/runner.js and 1 other location - About 30 mins to fix
              @tunnckocore/jest-runner-eslint/src/runner.js on lines 106..113

              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

              Avoid too many return statements within this function.
              Open

                return 'green';
              Severity: Major
              Found in @tunnckocore/utils/src/index.js - About 30 mins to fix

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

                  result.value.body = result.value.body ? EOL + EOL + result.value.body : '';
                Severity: Minor
                Found in @packages/parse-commit-message/src/commit.ts and 1 other location - About 30 mins to fix
                @packages/parse-commit-message/src/commit.ts on lines 80..80

                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

                Avoid too many return statements within this function.
                Open

                    return ret;
                Severity: Major
                Found in @packages/jest-runner-rollup/src/runner.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return '99CC09';
                  Severity: Major
                  Found in @tunnckocore/utils/src/index.js - About 30 mins to fix

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

                      const result = pass({
                        start,
                        end: Date.now(),
                        test: {
                          path: testPath,
                    Severity: Minor
                    Found in @tunnckocore/jest-runner-eslint/src/runner.js and 1 other location - About 30 mins to fix
                    @tunnckocore/jest-runner-babel/src/runner.js on lines 77..81

                    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

                    Avoid too many return statements within this function.
                    Open

                      return result;
                    Severity: Major
                    Found in @tunnckocore/jest-runner-eslint/src/runner.js - About 30 mins to fix

                      Function defaultOptions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export function defaultOptions(options = {}) {
                        const cfg = { ...options };
                      
                        const types = defaultTypes(cfg.extendTypes);
                        const opts = extend(
                      Severity: Minor
                      Found in @packages/koa-better-body/src/utils.js - About 25 mins to fix

                      Cognitive Complexity

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

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

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

                      Further reading

                      Function inArray has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function inArray(arr, val) {
                        const items = [arr].flat().filter(Boolean);
                        const len = items.length;
                        let i = null;
                      
                      
                      Severity: Minor
                      Found in modules/arr-includes/src/index.js - About 25 mins to fix

                      Cognitive Complexity

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

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

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

                      Further reading

                      Function checkCommit has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export function checkCommit(commit: Commit | BasicCommit, options?: Options): Commit {
                        const { error, value: headerObj } = validateHeader(commit.header, options) as {
                          error?: Error;
                          value: Header;
                        };
                      Severity: Minor
                      Found in @packages/parse-commit-message/src/commit.ts - About 25 mins to fix

                      Cognitive Complexity

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

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

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

                      Further reading

                      Function parse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export function parse(commits: PossibleCommit, options?: Options): Commit[] {
                        const result = toArray(commits)
                          .filter(Boolean)
                          .flat()
                          .reduce((acc: any[], val) => {
                      Severity: Minor
                      Found in @packages/parse-commit-message/src/main.ts - About 25 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