marionebl/jogwheel

View on GitHub

Showing 270 of 270 total issues

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

module.exports = function (gulp, paths, options, cli) {
    var task = require('./helpers/task')(gulp);
    var build = require('./build')(gulp, paths, {fails: true, notifies: true}, cli);

    return function watch(cb) {
Severity: Major
Found in tasks/watch.js - About 2 hrs to fix

    Function watch has 54 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        return function watch(cb) {
            /* @desc execute sequence after changes */
            var watchOptions = {fails: false, notifies: true, watch: true};
            var transpile = require('./transpile')(gulp, paths, watchOptions, cli);
            var documentation = require('./documentation')(gulp, paths, watchOptions, cli);
    Severity: Major
    Found in tasks/watch.js - About 2 hrs to fix

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

      module.exports = function (gulp, paths) {
          return function copy() {
              /* @desc copy static files to distribution */
              return gulp.src(paths.source.static)
                  .pipe(gulp.dest(paths.target.distribution));
      Severity: Major
      Found in tasks/copy.js and 1 other location - About 1 hr to fix
      tasks/copy-example.js on lines 1..7

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

      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 copyExamples() {
              /* @desc copy static files to distribution */
              return gulp.src(paths.source.example)
                  .pipe(gulp.dest(paths.target.example));
      Severity: Major
      Found in tasks/copy-example.js and 1 other location - About 1 hr to fix
      tasks/copy.js on lines 1..7

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

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

          return function documentation(done) {
              /* @desc build markdown from sources */
              getApiDocumentation(paths.source.entry, ['md', 'json', 'html'], (err, docs) => {
                  if (err) {
                      return done(err);
      Severity: Minor
      Found in tasks/documentation.js - About 1 hr to fix

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

        module.exports = function (gulp, paths, options) {
            options = Object.assign({}, options, {fails: true});
        
            var args = [].slice.call(arguments);
        
        
        Severity: Minor
        Found in tasks/build.js - About 1 hr to fix

          Function initPlayer has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function initPlayer(element, keyframes, options, render, window = global.window, document = global.document) {
              // Gracefully handle cases where element.animate is not defined
              if (typeof element.animate !== 'function') {
                  const {HTMLElement = {}} = window;
                  const {prototype: ElementPrototype = {}} = HTMLElement;
          Severity: Minor
          Found in source/library/init-player.js - About 1 hr to fix

            Async function 'main' has a complexity of 21.
            Open

            async function main(options) {
            Severity: Minor
            Found in source/scripts/when-ci.js by eslint

            Limit Cyclomatic Complexity (complexity)

            Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

            function a(x) {
                if (true) {
                    return x; // 1st path
                } else if (false) {
                    return x+1; // 2nd path
                } else {
                    return 4; // 3rd path
                }
            }

            Rule Details

            This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

            Examples of incorrect code for a maximum of 2:

            /*eslint complexity: ["error", 2]*/
            
            function a(x) {
                if (true) {
                    return x;
                } else if (false) {
                    return x+1;
                } else {
                    return 4; // 3rd path
                }
            }

            Examples of correct code for a maximum of 2:

            /*eslint complexity: ["error", 2]*/
            
            function a(x) {
                if (true) {
                    return x;
                } else {
                    return 4;
                }
            }

            Options

            Optionally, you may specify a max object property:

            "complexity": ["error", 2]

            is equivalent to

            "complexity": ["error", { "max": 2 }]

            Deprecated: the object property maximum is deprecated. Please use the property max instead.

            When Not To Use It

            If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

            Further Reading

            Related Rules

            • [max-depth](max-depth.md)
            • [max-len](max-len.md)
            • [max-nested-callbacks](max-nested-callbacks.md)
            • [max-params](max-params.md)
            • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

            Function 'initPlayer' has too many parameters (6). Maximum allowed is 4.
            Open

            export default function initPlayer(element, keyframes, options, render, window = global.window, document = global.document) {
            Severity: Minor
            Found in source/library/init-player.js by eslint

            enforce a maximum number of parameters in function definitions (max-params)

            Functions that take numerous parameters can be difficult to read and write because it requires the memorization of what each parameter is, its type, and the order they should appear in. As a result, many coders adhere to a convention that caps the number of parameters a function can take.

            function foo (bar, baz, qux, qxx) { // four parameters, may be too many
                doSomething();
            }

            Rule Details

            This rule enforces a maximum number of parameters allowed in function definitions.

            Options

            This rule has a number or object option:

            • "max" (default 3) enforces a maximum number of parameters in function definitions

            Deprecated: The object property maximum is deprecated; please use the object property max instead.

            max

            Examples of incorrect code for this rule with the default { "max": 3 } option:

            /*eslint max-params: ["error", 3]*/
            /*eslint-env es6*/
            
            function foo (bar, baz, qux, qxx) {
                doSomething();
            }
            
            let foo = (bar, baz, qux, qxx) => {
                doSomething();
            };

            Examples of correct code for this rule with the default { "max": 3 } option:

            /*eslint max-params: ["error", 3]*/
            /*eslint-env es6*/
            
            function foo (bar, baz, qux) {
                doSomething();
            }
            
            let foo = (bar, baz, qux) => {
                doSomething();
            };

            Related Rules

            • [complexity](complexity.md)
            • [max-depth](max-depth.md)
            • [max-len](max-len.md)
            • [max-nested-callbacks](max-nested-callbacks.md)
            • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

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

                    if (add.code === 0) {
                        console.log(`  ${chalk.green('✔')}   added gh-pages changes`);
                    } else {
                        throw new Error(`failed to add gh-pages changes:\n${add.output}`);
                    }
            Severity: Major
            Found in source/scripts/pages-update.js and 2 other locations - About 1 hr to fix
            source/scripts/pages-update.js on lines 44..48
            source/scripts/release-pull-request.js on lines 91..95

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

            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

                    if (commit.code === 0) {
                        console.log(`  ${chalk.green('✔')}   commited changes`);
                    } else {
                        throw new Error(`failed to commit changes:\n${commit.output}`);
                    }
            Severity: Major
            Found in source/scripts/pages-update.js and 2 other locations - About 1 hr to fix
            source/scripts/pages-update.js on lines 26..30
            source/scripts/release-pull-request.js on lines 91..95

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

            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

                if (add.code === 0) {
                    console.log(`  ${chalk.green('✔')}   added docs and gh-pages changes`);
                } else {
                    throw new Error(`failed to add docs and gh-pages changes:\n${add.output}`);
                }
            Severity: Major
            Found in source/scripts/release-pull-request.js and 2 other locations - About 1 hr to fix
            source/scripts/pages-update.js on lines 26..30
            source/scripts/pages-update.js on lines 44..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 67.

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

                            const onload = async function () {
                                const frameDocument = frame.contentDocument || frame.contentWindow.document;
                                const inject = getInject(frameDocument.body);
            
                                // fetch test styling
            Severity: Minor
            Found in source/test/integration/index.js - About 1 hr to fix

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

              module.exports = function (props) {
                  return function () {
                      return (
              `
              ---
              Severity: Minor
              Found in tasks/partials/footer.js - About 1 hr to fix

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

                module.exports = function (props) {
                    return `<!doctype html>
                <html lang="en" prefix="og: http://ogp.me/ns#">
                    <head>
                        <title>${props.pkg.name} - ${props.pkg.description}</title>
                Severity: Minor
                Found in tasks/partials/page-layout.js - About 1 hr to fix

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

                      try {
                          taskFactory = require(taskFile);
                      } catch(err) {
                          util.log('Could not load task "' + taskName +'" from "' + taskFile + '":');
                          util.log(err);
                  Severity: Major
                  Found in gulpfile.js and 1 other location - About 1 hr to fix
                  gulpfile.js on lines 50..57

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

                  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

                      try {
                          taskFunction = taskFactory(gulp, config.paths, taskOptions, cliOptions);
                      } catch(err) {
                          util.log('Could not initialize task function "' + taskName +'" from "' + taskFile + '":');
                          util.log(err);
                  Severity: Major
                  Found in gulpfile.js and 1 other location - About 1 hr to fix
                  gulpfile.js on lines 35..42

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

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

                  module.exports = function (gulp) {
                      return function list() {
                          /* @desc list all public tasks */
                          var tasks = Object.keys(gulp.tasks || {})
                              .reduce(function (results, taskName) {
                  Severity: Minor
                  Found in tasks/list.js - About 1 hr to fix

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

                        t.throws(() => {
                            initPlayer(nativeStub,
                                [],
                                {
                                    render(el, style) {
                    Severity: Major
                    Found in source/test/unit/init-player.js and 1 other location - About 1 hr to fix
                    source/test/unit/init-player.js on lines 76..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 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

                        t.doesNotThrow(() => {
                            initPlayer(nativeStub,
                                [],
                                {
                                    render(el, style) {
                    Severity: Major
                    Found in source/test/unit/init-player.js and 1 other location - About 1 hr to fix
                    source/test/unit/init-player.js on lines 94..105

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language