tunnckoCore/gibon

View on GitHub

Showing 164 of 164 total issues

Function write has a Cognitive Complexity of 112 (exceeds 5 allowed). Consider refactoring.
Open

  write(data) {
    let i = 0;
    const length_ = data.length;
    let previousIndex = this.index;
    let { lookbehind, boundary, boundaryChars, index, state, flags } = this;
Severity: Minor
Found in modules/formidable-mini/src/multipart.js - About 2 days 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

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

  case 'multiparty': {
    const { Readable } = require('stream');

    const { Form } = require('multiparty');

modules/formidable-mini/benchmark/bench-multipart-fields-100mb-big.js on lines 83..138

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

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

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

  case 'multiparty': {
    const { Readable } = require('stream');

    const { Form } = require('multiparty');

modules/formidable-mini/benchmark/bench-multipart-fields-100mb-small.js on lines 84..139

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

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

export function yaro(argv, config) {
  const res = { _: [] };
  if (!argv) {
    return res;
  }
Severity: Minor
Found in yaro/yaro-parser/src/index.js - About 1 day 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 loadConfigFromWorkspace has 245 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function loadConfigFromWorkspace(ws) {
  const EXTENSIONS = [
    '.js',
    '.mjs',
    '.cjs',
Severity: Major
Found in xaxa/eslint-config-xaxa/src/main.js - About 1 day to fix

    Function write has 197 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      write(data) {
        let i = 0;
        const length_ = data.length;
        let previousIndex = this.index;
        let { lookbehind, boundary, boundaryChars, index, state, flags } = this;
    Severity: Major
    Found in modules/formidable-mini/src/multipart.js - About 7 hrs to fix

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

      function createMultipartBuffers(boundary, sizes) {
        const bufs = [];
        for (const [i, size] of sizes.entries()) {
          const mb = size * 1024 * 1024;
          bufs.push(
      modules/formidable-mini/benchmark/bench-multipart-fields-100mb-big.js on lines 3..21

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

      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

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

      function createMultipartBuffers(boundary, sizes) {
        const bufs = [];
        for (const [i, size] of sizes.entries()) {
          const mb = size * 1024 * 1024;
          bufs.push(
      modules/formidable-mini/benchmark/bench-multipart-fields-100mb-small.js on lines 3..21

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

      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

        case 'formidable-streaming': {
          const QuerystringParser = require('formidable/src/parsers/StreamingQuerystring.js');
      
          console.time(moduleName);
          (function next() {
      modules/formidable-mini/benchmark/bench-urlencoded-fields-100pairs-small.js on lines 49..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 158.

      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

        case 'formidable': {
          const QuerystringParser = require('formidable/src/parsers/Querystring.js');
      
          console.time(moduleName);
          (function next() {
      modules/formidable-mini/benchmark/bench-urlencoded-fields-100pairs-small.js on lines 71..91

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

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

      module.exports = function createRunner(runPath, { getExtraOptions } = {}) {
        class BaseTestRunner {
          constructor(globalConfig) {
            this._globalConfig = globalConfig;
          }
      Severity: Minor
      Found in @tunnckocore/create-jest-runner/src/createJestRunner.js - About 5 hrs 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 jestRunnerRollup has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
      Open

      module.exports = async function jestRunnerRollup({ testPath, config }) {
        const start = new Date();
      
        /** Load config from possible places */
        const cfg = await tryLoadConfig({ testPath, config, start });
      Severity: Minor
      Found in @packages/jest-runner-rollup/src/runner.js - About 5 hrs 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

      File multipart.js has 365 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /* eslint-disable */
      
      import { FormData } from 'formdata-polyfill/esm.min.js';
      import { FormidableFile } from './FormidableFile.js';
      
      
      Severity: Minor
      Found in modules/formidable-mini/src/multipart.js - About 4 hrs to fix

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

              if (flags.filter.length > 0) {
                const filtered = await filter(prog)(
                  { ...data, flags: { ...flags, raw: true }, patterns: flags.filter },
                  meta,
                );
        Severity: Major
        Found in @hela/preset-workspaces/src/commands/publish.js and 1 other location - About 4 hrs to fix
        @hela/preset-workspaces/src/commands/version.js on lines 61..74

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

        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

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

              if (flags.filter.length > 0) {
                const filtered = await filter(prog)(
                  { ...data, flags: { ...flags, raw: true }, patterns: flags.filter },
                  meta,
                );
        Severity: Major
        Found in @hela/preset-workspaces/src/commands/version.js and 1 other location - About 4 hrs to fix
        @hela/preset-workspaces/src/commands/publish.js on lines 56..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 129.

        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

          case 'formidable': {
            const QuerystringParser = require('formidable/src/parsers/Querystring.js');
        
            console.time(moduleName);
            const parser = new QuerystringParser();
        modules/formidable-mini/benchmark/bench-urlencoded-fields-900pairs-small-alt.js on lines 63..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 123.

        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

          case 'formidable-streaming': {
            const QuerystringParser = require('formidable/src/parsers/StreamingQuerystring.js');
        
            console.time(moduleName);
            const parser = new QuerystringParser();
        modules/formidable-mini/benchmark/bench-urlencoded-fields-900pairs-small-alt.js on lines 44..61

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

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

        module.exports = runner('docks', async (ctx) => {
          const start = Date.now();
          const { testPath, config, runnerConfig } = ctx;
        
          const docksConfig = {
        Severity: Major
        Found in @packages/jest-runner-docs/src/runner.js - About 4 hrs to fix

          Function yaro has 107 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function yaro(argv, config) {
            const res = { _: [] };
            if (!argv) {
              return res;
            }
          Severity: Major
          Found in yaro/yaro-parser/src/index.js - About 4 hrs to fix

            Function exports has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
            Open

            module.exports = runner('docks', async (ctx) => {
              const start = Date.now();
              const { testPath, config, runnerConfig } = ctx;
            
              const docksConfig = {
            Severity: Minor
            Found in @packages/jest-runner-docs/src/runner.js - About 4 hrs 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