phodal/echoesworks

View on GitHub

Showing 17 of 27 total issues

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

module.exports = function (grunt) {

    grunt.initConfig({

        pkg: grunt.file.readJSON('package.json'),
Severity: Major
Found in Gruntfile.js - About 3 hrs to fix

    Function from has 82 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var from = function () {
    
        var element = this.options.element,
            parent = element.nodeType === 1 ? element : document.querySelector(element),
            slides = [].filter.call(parent.children, function (el) {
    Severity: Major
    Found in src/slide.js - About 3 hrs to fix

      File umarkdown.js has 273 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*
       * micro-markdown.js
       * markdown in under 5kb
       *
       * Copyright 2014, Simon Waldherr - http://simon.waldherr.eu/
      Severity: Minor
      Found in src/umarkdown.js - About 2 hrs to fix

        Function from has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

        var from = function () {
        
            var element = this.options.element,
                parent = element.nodeType === 1 ? element : document.querySelector(element),
                slides = [].filter.call(parent.children, function (el) {
        Severity: Minor
        Found in src/slide.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

        micromarkdown has 22 functions (exceeds 20 allowed). Consider refactoring.
        Open

        var micromarkdown = {
            regexobject: {
                headline: /^(\#{1,6})([^\#\n]+)$/m,
                pre: /\s\`\`\`(\w+)\n?[^`]+\`\`\`/g,
                code: /\s\`\`\`\n?([^`]+)\`\`\`/g,
        Severity: Minor
        Found in src/umarkdown.js - About 2 hrs to fix

          Function tableHandlerHelper has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
          Open

              tableHandlerHelper: function (helper, calign, strict) {
                  var i;
                  for (i = 0; i < helper.length; i++) {
                      if (calign.length <= i) {
                          calign.push(0);
          Severity: Minor
          Found in src/umarkdown.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 touchDeviceHandler has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function touchDeviceHandler() {
                  EchoesWorks.forEach(slides, function (slide) {
                      var halfWidth = window.screen.width / 3,
                          thirdHeight = window.screen.height / 3,
                          delta;
          Severity: Minor
          Found in src/events_handler.js - About 1 hr to fix

            Function applyEchoes has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            EchoesWorks.prototype.applyEchoes = function () {
                var that = this;
                var isDataValid = that.parser.data && that.parser.data.codes !== undefined && that.parser.data.codes.length > 0;
                if (isDataValid) {
                    that.data = that.parser.data;
            Severity: Minor
            Found in src/main.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 EchoesWorks has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var EchoesWorks = function (options) {
                var defaults;
                defaults = {
                    element: 'slide',
                    auto: false
            Severity: Minor
            Found in src/main.js - About 1 hr to fix

              Function forEach has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

              EchoesWorks.forEach = function (collection, callback, scope) {
                  if (Object.prototype.toString.call(collection) === '[object Object]') {
                      for (var prop in collection) {
                          if (Object.prototype.hasOwnProperty.call(collection, prop)) {
                              callback.call(scope, collection[prop], prop, collection);
              Severity: Minor
              Found in src/utils.js - About 55 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 listHandler has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  listHandler: function (line, nstatus, status, replaceStr, helper1, casca) {
              Severity: Minor
              Found in src/umarkdown.js - About 45 mins to fix

                Function tableHandler has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    tableHandler: function (helper1, i, calign, replaceStr, cel) {
                Severity: Minor
                Found in src/umarkdown.js - About 35 mins to fix

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

                  EchoesWorks.defaults = function (obj) {
                      if (!EchoesWorks.isObject(obj)) {
                          return obj;
                      }
                  
                  
                  Severity: Minor
                  Found in src/utils.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 send has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                  EchoesWorks.send = function (url, method, callback, data) {
                      data = data || null;
                      var request = new XMLHttpRequest();
                      if (callback instanceof Function) {
                          request.onreadystatechange = function () {
                  Severity: Minor
                  Found in src/ajax.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 extend has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                  EchoesWorks.extend = function (obj) {
                      if (!EchoesWorks.isObject(obj)) {
                          return obj;
                      }
                      var source, prop;
                  Severity: Minor
                  Found in src/utils.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 listHandler has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      listHandler: function (line, nstatus, status, replaceStr, helper1, casca) {
                          var indent = false;
                          if ((line[2] === undefined) || (line[2].length === 0)) {
                              nstatus = 0;
                          } else {
                  Severity: Minor
                  Found in src/umarkdown.js - About 25 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 parse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      parse: function (str, strict) {
                          var helper, helper1, stra, trashgc = [], i, that = this, regexObject = micromarkdown.regexobject;
                          regexObject.lists = this.listStrict(strict, regexObject);
                  
                          str = '\n' + str + '\n';
                  Severity: Minor
                  Found in src/umarkdown.js - About 25 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

                  Severity
                  Category
                  Status
                  Source
                  Language