tunnckoCore/gibon

View on GitHub

Showing 164 of 164 total issues

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

  function command(usage, settings, action) {
    if (typeof usage === 'function') {
      action = usage;
      usage = '';
    }
Severity: Minor
Found in yaro/yaro-command/src/core.js - About 1 hr to fix

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

    export default async function packageJson(packageName, endpoint) {
      const { name, version } = parsePkgName(packageName);
      const tag = version === '' ? 'latest' : version;
      const uri =
        typeof endpoint === 'function'
    Severity: Minor
    Found in @tunnckocore/package-json/src/index.js - About 1 hr to fix

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

            cli.meta.coerces = flag.aliases.reduce((acc, k) => {
              acc[k] = flag.type;
              return acc;
            }, cli.meta.coerces);
      Severity: Major
      Found in yaro/yaro-command/src/core.js and 2 other locations - About 1 hr to fix
      yaro/yaro-command/src/core.js on lines 83..86
      yaro/yaro-command/src/core.js on lines 93..96

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

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

            cli.meta.required = flag.aliases.reduce((acc, k) => {
              acc[k] = flag.required;
              return acc;
            }, cli.meta.required);
      Severity: Major
      Found in yaro/yaro-command/src/core.js and 2 other locations - About 1 hr to fix
      yaro/yaro-command/src/core.js on lines 83..86
      yaro/yaro-command/src/core.js on lines 88..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 61.

      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

        prog
          .command(
            'filter <...patterns>',
            'List all packages matching a given filter pattern',
          )
      Severity: Major
      Found in @hela/preset-workspaces/src/commands/filter.js and 1 other location - About 1 hr to fix
      @hela/preset-workspaces/src/commands/affected.js on lines 9..25

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

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

            cli.meta.defaults = flag.aliases.reduce((acc, k) => {
              acc[k] = flag.default;
              return acc;
            }, cli.meta.defaults);
      Severity: Major
      Found in yaro/yaro-command/src/core.js and 2 other locations - About 1 hr to fix
      yaro/yaro-command/src/core.js on lines 88..91
      yaro/yaro-command/src/core.js on lines 93..96

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

      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

        prog
          .command(
            'affected [name]',
            'List affected workspaces of change in `name` package',
          )
      Severity: Major
      Found in @hela/preset-workspaces/src/commands/affected.js and 1 other location - About 1 hr to fix
      @hela/preset-workspaces/src/commands/filter.js on lines 7..58

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

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

        return function thunk(done) {
          const fields = {};
          const fileFields = {};
          const files = [];
          const form =
      Severity: Minor
      Found in @packages/koa-better-body/src/utils.js - About 1 hr to fix

        Function allModulePaths has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        export default function allModulePaths(options = {}) {
          const { paths } = { paths: [], ...options };
        
          assert(Array.isArray(paths), 'expect options.paths to be string[]');
        
        
        Severity: Minor
        Found in @packages/all-module-paths/src/index.js - About 1 hr 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 incrementer has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        function incrementer(flags, { cwd }, { version, type }) {
          // TODO: force dry running for now
          flags.dryRun = flags.dryRun ?? true;
        
          if (flags.dryRun !== true) {
        Severity: Minor
        Found in @hela/preset-workspaces/src/commands/version.js - About 1 hr 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 initServer has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        function initServer() {
          const server = createServer(async (req, res) => {
            if (req.url === '/' && req.method.toLowerCase() === 'post') {
              // parse a file upload
              // `upload` does nothing now, could be used with `createTemporary*`
        Severity: Minor
        Found in modules/formidable-mini/example.js - About 1 hr 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 testResults has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          const testResults = await new Promise((resolve) => {
            proc
              .then(() => {
                resolve(
                  pass({
        Severity: Minor
        Found in @packages/jest-runner-node/src/runner.js - About 1 hr to fix

          Function parseFunction has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function parseFunction(opts = {}) {
            const plugins = [];
            const app = {
              /**
               * > Parse a given `code` and returns a `result` object
          Severity: Minor
          Found in @packages/parse-function/src/index.js - About 1 hr to fix

            Function initServer has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function initServer() {
              const server = createServer(async (req, res) => {
                if (req.url === '/' && req.method.toLowerCase() === 'post') {
                  // parse a file upload
                  // `upload` does nothing now, could be used with `createTemporary*`
            Severity: Minor
            Found in modules/formidable-mini/example.js - About 1 hr to fix

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

                      async (err) => {
                        const res = { status: 'rejected', reason: err, index };
                        const ret = await opts.afterEach(res, index, items);
              
                        return { ...res, ...ret };
              Severity: Major
              Found in @tunnckocore/p-all/src/index.js and 1 other location - About 1 hr to fix
              @tunnckocore/p-all/src/index.js on lines 70..75

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

              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

                      async (value) => {
                        const res = { status: 'fulfilled', value, index };
                        const ret = await opts.afterEach(res, index, items);
              
                        return { ...res, ...ret };
              Severity: Major
              Found in @tunnckocore/p-all/src/index.js and 1 other location - About 1 hr to fix
              @tunnckocore/p-all/src/index.js on lines 76..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 59.

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

                    async function commandAction(parsedFlags, ...argz) {
                      const argv = pipeline(
                        // run parser only if when we are given process.argv array
                        Array.isArray(parsedFlags) && parser(),
                        aliases(cli.meta.aliases), // aliases always first
              Severity: Minor
              Found in yaro/yaro-command/src/core.js - About 1 hr to fix

                Function findMatchCommand has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function findMatchCommand(entries, meta) {
                  const match = entries.find(([name, cmd]) => {
                    if (cmd.isYaroCommand) {
                      let matched = false;
                
                
                Severity: Minor
                Found in yaro/yaro-create-cli/src/index.js - About 1 hr to fix

                  Function jestCov has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      .reduce((acc, file) => {
                        let value = files[file];
                  
                        const [monoDir, ws, folderName] = file.split('/');
                  
                  
                  Severity: Minor
                  Found in @tunnckocore/utils/src/index.js - About 1 hr to fix

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

                      if (opts.verbose) {
                        console.log('');
                        console.log('Published:');
                        wsResolved.map((pkgPath) => console.log('-', pkgPath));
                      }
                    Severity: Major
                    Found in @hela/preset-workspaces/src/commands/publish.js and 1 other location - About 1 hr to fix
                    @hela/preset-workspaces/src/commands/publish.js on lines 100..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 57.

                    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