phodal/echoesworks

View on GitHub

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

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

          listHandlerStart: function (stra, replaceStr) {
              if ((stra[0].trim().substr(0, 1) === '*') || (stra[0].trim().substr(0, 1) === '-')) {
                  replaceStr = '<ul>';
              } else {
                  replaceStr = '<ol>';
      Severity: Major
      Found in src/umarkdown.js and 1 other location - About 2 hrs to fix
      src/umarkdown.js on lines 177..184

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

      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

          listsHandlerEnd: function (stra, replaceStr) {
              if ((stra[0].trim().substr(0, 1) === '*') || (stra[0].trim().substr(0, 1) === '-')) {
                  replaceStr += '</ul>';
              } else {
                  replaceStr += '</ol>';
      Severity: Major
      Found in src/umarkdown.js and 1 other location - About 2 hrs to fix
      src/umarkdown.js on lines 168..175

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

      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

      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

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

                        str = str.replace(stra[0], '<a ' + micromarkdown.mmdCSSclass(stra[2], strict) + 'href="' + stra[2] + '">' + stra[1] + '</a>\n');
            Severity: Major
            Found in src/umarkdown.js and 1 other location - About 1 hr to fix
            src/umarkdown.js on lines 67..67

            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

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

                    for (i = 0; i < helper.length; i++) {
                        replaceStr += cel[calign[i]] + helper[i].trim() + '</th>';
                    }
            Severity: Major
            Found in src/umarkdown.js and 1 other location - About 1 hr to fix
            src/umarkdown.js on lines 137..139

            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

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

                    return str.replace(stra[0], '<a ' + micromarkdown.mmdCSSclass(helper[1], strict) + 'href="' + helper[1] + '">' + stra[1] + '</a>');
            Severity: Major
            Found in src/umarkdown.js and 1 other location - About 1 hr to fix
            src/umarkdown.js on lines 49..49

            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

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

                        for (j = 0; j < helper2.length; j++) {
                            replaceStr += cel[calign[j]] + helper2[j].trim() + '</td>';
                        }
            Severity: Major
            Found in src/umarkdown.js and 1 other location - About 1 hr to fix
            src/umarkdown.js on lines 153..155

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

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

              function hiddenWords() {
                  document.querySelector('slide').classList.add('full');
                  document.querySelector('words').classList.add('hidden');
              }
              Severity: Minor
              Found in src/main.js and 1 other location - About 55 mins to fix
              src/main.js on lines 121..124

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

              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

              function hiddenCode() {
                  document.querySelector('slide').classList.add('full');
                  document.querySelector('pre').classList.add('hidden');
              }
              Severity: Minor
              Found in src/main.js and 1 other location - About 55 mins to fix
              src/main.js on lines 116..119

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

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

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

                            } else if (strict !== true) {
                                if (calign[i][0] === ':') {
                                    calign[i] = 1;
                                } else {
                                    calign[i] = 0;
                Severity: Minor
                Found in src/umarkdown.js and 1 other location - About 40 mins to fix
                src/umarkdown.js on lines 112..126

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

                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