marionebl/jogwheel

View on GitHub

Showing 270 of 270 total issues

Function main has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
Open

async function main(options) {
    const job = process.env.TRAVIS_JOB_NUMBER;

    if (!job) {
        console.log(`  ${chalk.yellow('⚠')}   Skipping, "$TRAVIS_JOB_NUMBER" is not defined.`);
Severity: Minor
Found in source/scripts/when-ci.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

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

main(minimist(process.argv.slice(2)))
    .then(message => console.log(message))
    .catch(err => {
        console.log(err);
        console.error(`  ${chalk.red('✖')}   release-pull-request failed.\n`);
Severity: Major
Found in source/scripts/release-pull-request.js and 1 other location - About 4 hrs to fix
source/scripts/pages-update.js on lines 95..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 127.

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

main(minimist(process.argv.slice(2)))
    .then(message => console.log(message))
    .catch(err => {
        console.log(err);
        console.error(`  ${chalk.red('✖')}   pages-update failed.\n`);
Severity: Major
Found in source/scripts/pages-update.js and 1 other location - About 4 hrs to fix
source/scripts/release-pull-request.js on lines 176..185

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

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

async function main() {
    const state = document.querySelector('[data-stage-state]');
    const stage = document.querySelector('[data-stage-demos]');
    const handle = document.querySelector('[data-stage-handle]');
    const img = document.createElement('img');
Severity: Major
Found in source/test/integration/index.js - About 4 hrs to fix

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

            if (!isNoPullRequest()) {
                console.log(`  ${chalk.yellow('⚠')}   Skipping, "${job}" is a pull request. ${chalk.gray('[--no-pull-request]')}`);
                throw new Error(1);
            } else {
                console.log(`  ${chalk.green('✔')}   Job "${job}" is no pull request. ${chalk.gray('[--no-pull-request]')}`);
    Severity: Major
    Found in source/scripts/when-ci.js and 1 other location - About 3 hrs to fix
    source/scripts/when-ci.js on lines 61..66

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

    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

            } else if (!isNoPullRequest()) {
                console.log(`  ${chalk.yellow('⚠')}   Skipping, job "${job}" on branch "master", but pull-request. ${chalk.grey('[--master]')}`);
                throw new Error(1);
            } else {
                console.log(`  ${chalk.green('✔')}   Job "${job}" is on branch master. ${chalk.grey('[--trusted]')}`);
    Severity: Major
    Found in source/scripts/when-ci.js and 1 other location - About 3 hrs to fix
    source/scripts/when-ci.js on lines 40..45

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

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

    async function main() {
        const start = Date.now();
        const version = await getVersion();
        const head = `release/${version}`;
    
    
    Severity: Major
    Found in source/scripts/release-pull-request.js - About 3 hrs to fix

      Function exports has 83 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = function (gulp, paths) {
          'use strict';
          function toHtml() {
              const rewrite = function () {
                  return function (ast, file) {
      Severity: Major
      Found in tasks/html.js - About 3 hrs to fix

        Function exports has 79 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function (gulp, paths) {
            const props = {
                paths: paths,
                gulp: gulp,
                pkg: merge({}, pkg, pkg.config.documentation),
        Severity: Major
        Found in tasks/documentation.js - About 3 hrs to fix

          Function main has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

          async function main() {
              const start = Date.now();
              const version = await getVersion();
              const head = `release/${version}`;
          
          
          Severity: Minor
          Found in source/scripts/release-pull-request.js - About 2 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 toHtml has 72 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function toHtml() {
                  const rewrite = function () {
                      return function (ast, file) {
                          const base = path.relative(file.filePath(), path.resolve('./'));
                          pkg.staticBase = base === '..' ? '.' : path.dirname(base);
          Severity: Major
          Found in tasks/html.js - About 2 hrs to fix

            Function main has 71 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            async function main(options) {
                const job = process.env.TRAVIS_JOB_NUMBER;
            
                if (!job) {
                    console.log(`  ${chalk.yellow('⚠')}   Skipping, "$TRAVIS_JOB_NUMBER" is not defined.`);
            Severity: Major
            Found in source/scripts/when-ci.js - About 2 hrs to fix

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

                                          [
                                              task(copy),
                                              task(copyStatic, 'copy-static'),
                                              task(copyExample, 'copy-example'),
                                              task(lint),
              Severity: Major
              Found in tasks/watch.js and 1 other location - About 2 hrs to fix
              tasks/build.js on lines 25..47

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

              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

                          [
                              task(copy),
                              task(copyStatic, 'copy-static'),
                              task(copyExample, 'copy-example'),
                              task(lint),
              Severity: Major
              Found in tasks/build.js and 1 other location - About 2 hrs to fix
              tasks/watch.js on lines 45..64

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

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

              async function main() {
                  const start = Date.now();
                  const hash = shell.exec(`git rev-parse --short HEAD`, {silent: true}).output.split('\n')[0];
              
                  const head = `gh-pages-update-${hash}`;
              Severity: Major
              Found in source/scripts/pages-update.js - About 2 hrs to fix

                Function main has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                Open

                async function main() {
                    const start = Date.now();
                    const hash = shell.exec(`git rev-parse --short HEAD`, {silent: true}).output.split('\n')[0];
                
                    const head = `gh-pages-update-${hash}`;
                Severity: Minor
                Found in source/scripts/pages-update.js - About 2 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

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

                    if (process.env.CI) {
                        shell.exec(`git config user.email "${pkg.author.email}"`, {silent: true});
                        shell.exec(`git config user.name "${pkg.author.name}"`, {silent: true});
                    }
                Severity: Major
                Found in source/scripts/pages-update.js and 1 other location - About 2 hrs to fix
                source/scripts/release-pull-request.js on lines 84..87

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

                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 (process.env.CI) {
                        shell.exec(`git config user.email "${pkg.author.email}"`, {silent: true});
                        shell.exec(`git config user.name "${pkg.author.name}"`, {silent: true});
                    }
                Severity: Major
                Found in source/scripts/release-pull-request.js and 1 other location - About 2 hrs to fix
                source/scripts/pages-update.js on lines 18..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 85.

                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

                module.exports = function (gulp, paths) {
                    return function postcss() {
                        /* @desc postprocess css sources */
                        return gulp.src(paths.source['public-css'])
                            .pipe(next())
                Severity: Major
                Found in tasks/css.js and 1 other location - About 2 hrs to fix
                tasks/test-css.js on lines 3..10

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

                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

                module.exports = function (gulp, paths) {
                    return function postcss() {
                        /* @desc postprocess test css sources */
                        return gulp.src(paths.source['test-css'])
                            .pipe(next())
                Severity: Major
                Found in tasks/test-css.js and 1 other location - About 2 hrs to fix
                tasks/css.js on lines 3..10

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

                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