marionebl/jogwheel

View on GitHub

Showing 270 of 270 total issues

Function initPlayer has a Cognitive Complexity of 11 (exceeds 5 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

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

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

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

        const remote = process.env.GH_TOKEN ?
            `https://${process.env.GH_TOKEN}@github.com/${pkg.config.documentation.slug}.git` :
            `origin`;
    Severity: Major
    Found in source/scripts/pages-update.js and 1 other location - About 1 hr to fix
    source/scripts/release-pull-request.js on lines 67..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 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

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

        const remote = process.env.GH_TOKEN ?
            `https://${process.env.GH_TOKEN}@github.com/${pkg.config.documentation.slug}.git` :
            `origin`;
    Severity: Major
    Found in source/scripts/release-pull-request.js and 1 other location - About 1 hr to fix
    source/scripts/pages-update.js on lines 14..16

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

        onMatchMedia() {
            const {
                elements,
                players,
                settings,
    Severity: Minor
    Found in source/library/index.js - About 1 hr to fix

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

      export default function getPlayer(element, settings, window = global.window, document = global.document) {
          // Read all animation related styles from element, respect prefixes
          const {
              name,
              duration,
      Severity: Minor
      Found in source/library/get-player.js - About 1 hr to fix

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

        const playerStub = options => {
            const _state = {
                currentTime: 0,
                activeDuration: 0,
                playState: 'running'
        Severity: Minor
        Found in source/test/unit/stubs/player.js - About 1 hr to fix

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

          module.exports = function (options) {
              options = Object.assign({}, defaults, options);
          
              return function (err) {
                  if (!err) {
          Severity: Minor
          Found in tasks/helpers/on-error.js - About 1 hr to fix

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

            module.exports = function (props) {
                return function (image, headline, navigation) {
                    image = image || {
                        href: props.pkg.homepage,
                        src: props.pkg.logo
            Severity: Minor
            Found in tasks/partials/header.js - About 1 hr to fix

              Function build has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  return function build(done) {
                      return sequence(
                          task(clean),
                          [
                              task(copy),
              Severity: Minor
              Found in tasks/build.js - About 1 hr to fix

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

                    if (push.code === 0) {
                        console.log(`  ${chalk.green('✔')}   pushed to github.com/${pkg.config.documentation.slug}#${head}.`);
                    } else {
                        throw new Error(`failed pushing to "${title}":\n${push.output}`);
                    }
                Severity: Major
                Found in source/scripts/release-pull-request.js and 2 other locations - About 50 mins to fix
                source/scripts/pages-update.js on lines 54..58
                source/scripts/release-pull-request.js on lines 149..153

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

                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

                            console.log(`  ${chalk.green('✔')}   submitted pull request "${title}" via hub: ${pr.output.split('\n')[0]}`);
                Severity: Minor
                Found in source/scripts/release-pull-request.js and 1 other location - About 50 mins to fix
                source/scripts/pages-update.js on lines 84..84

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

                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 (remove.code === 0) {
                                console.log(`  ${chalk.green('✔')}   removed github.com/${pkg.config.documentation.slug}#${head}.`);
                            } else {
                                console.log(`  ${chalk.red('✖')}   failed to remove github.com/${pkg.config.documentation.slug}#${head}`);
                            }
                Severity: Major
                Found in source/scripts/release-pull-request.js and 2 other locations - About 50 mins to fix
                source/scripts/pages-update.js on lines 54..58
                source/scripts/release-pull-request.js on lines 110..114

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

                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 (push.code === 0) {
                        console.log(`  ${chalk.green('✔')}   pushed to github.com/${pkg.config.documentation.slug}#${head}.`);
                    } else {
                        throw new Error(`failed pushing to github.com/${pkg.config.documentation.slug}#${head}:\n${push.output}`);
                    }
                Severity: Major
                Found in source/scripts/pages-update.js and 2 other locations - About 50 mins to fix
                source/scripts/release-pull-request.js on lines 110..114
                source/scripts/release-pull-request.js on lines 149..153

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

                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

                            console.log(`  ${chalk.green('✔')}   submitted pull request "${head} → gh-pages" via hub: ${pr.output.split('\n')[0]}`);
                Severity: Minor
                Found in source/scripts/pages-update.js and 1 other location - About 50 mins to fix
                source/scripts/release-pull-request.js on lines 162..162

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

                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 initPlayer has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

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

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

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

                  Cognitive Complexity

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

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

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

                  Further reading

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

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

                  Cognitive Complexity

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

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

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

                  Further reading

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

                  export const keyframes = [
                      {
                          offset: 0,
                          height: '0',
                          width: '0'
                  Severity: Minor
                  Found in source/test/unit/fixtures/simple-animation-declaration.js and 1 other location - About 30 mins to fix
                  source/test/unit/fixtures/simple-animation-declaration.js on lines 41..52

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 45.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                  export const animation = [
                      {
                          offset: 0,
                          height: '0',
                          width: '0'
                  Severity: Minor
                  Found in source/test/unit/fixtures/simple-animation-declaration.js and 1 other location - About 30 mins to fix
                  source/test/unit/fixtures/simple-animation-declaration.js on lines 28..39

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 45.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Severity
                  Category
                  Status
                  Source
                  Language