marionebl/jogwheel

View on GitHub

Showing 30 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

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

    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

              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

                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

                    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

                          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

                                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

                                  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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language