webcol/Calima

View on GitHub
public_/plantillas/inspinia/js/plugins/codemirror/mode/slim/slim.js

Summary

Maintainability
D
3 days
Test Coverage

File slim.js has 525 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE

// Slim Highlighting for CodeMirror copyright (c) HicknHack Software Gmbh

Severity: Major
Found in public_/plantillas/inspinia/js/plugins/codemirror/mode/slim/slim.js - About 1 day to fix

    Function readQuoted has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function readQuoted(quote, style, embed, unescaped, nextTokenize) {
          return function(stream, state) {
            finishContinue(state);
            var fresh = stream.current().length == 0;
            if (stream.match(/^\\$/, fresh)) {
    Severity: Minor
    Found in public_/plantillas/inspinia/js/plugins/codemirror/mode/slim/slim.js - About 1 hr to fix

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

          function maybeBackup(stream, state, pat, offset, style) {
      Severity: Minor
      Found in public_/plantillas/inspinia/js/plugins/codemirror/mode/slim/slim.js - About 35 mins to fix

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

            function readQuoted(quote, style, embed, unescaped, nextTokenize) {
        Severity: Minor
        Found in public_/plantillas/inspinia/js/plugins/codemirror/mode/slim/slim.js - About 35 mins to fix

          Avoid too many return statements within this function.
          Open

                  return "keyword";
          Severity: Major
          Found in public_/plantillas/inspinia/js/plugins/codemirror/mode/slim/slim.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  return startRubySplat(slimAttribute)(stream, state);
            Severity: Major
            Found in public_/plantillas/inspinia/js/plugins/codemirror/mode/slim/slim.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return style;
              Severity: Major
              Found in public_/plantillas/inspinia/js/plugins/codemirror/mode/slim/slim.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return startSubMode(m[1], state);
                Severity: Major
                Found in public_/plantillas/inspinia/js/plugins/codemirror/mode/slim/slim.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return slimTag(stream, state);
                  Severity: Major
                  Found in public_/plantillas/inspinia/js/plugins/codemirror/mode/slim/slim.js - About 30 mins to fix

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

                    (function(mod) {
                      if (typeof exports == "object" && typeof module == "object") // CommonJS
                        mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), require("../ruby/ruby"));
                      else if (typeof define == "function" && define.amd) // AMD
                        define(["../../lib/codemirror", "../htmlmixed/htmlmixed", "../ruby/ruby"], mod);
                    public_/plantillas/inspinia/js/plugins/codemirror/mode/django/django.js on lines 4..67
                    public_/plantillas/inspinia/js/plugins/codemirror/mode/gfm/gfm.js on lines 4..122
                    public_/plantillas/inspinia/js/plugins/codemirror/mode/haml/haml.js on lines 4..159
                    public_/plantillas/inspinia/js/plugins/codemirror/mode/php/php.js on lines 4..226
                    public_/plantillas/inspinia/js/plugins/codemirror/mode/smartymixed/smartymixed.js on lines 15..197
                    public_/plantillas/inspinia/js/plugins/codemirror/mode/tornado/tornado.js on lines 4..68

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

                    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 function(stream, state) {
                            var ch = stream.peek();
                            if (ch == endQuote && state.rubyState.tokenize.length == 1) {
                              // step out of ruby context as it seems to complete processing all the braces
                              stream.next();
                    public_/plantillas/inspinia/js/plugins/codemirror/mode/haml/haml.js on lines 20..30

                    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

                          if (ch == '"' || ch == "\'") {
                            state.tokenize = readQuoted(ch, "string", true, false, attributeWrapper);
                            stream.next();
                            return state.tokenize(stream, state);
                          }
                    public_/plantillas/inspinia/js/plugins/codemirror/mode/slim/slim.js on lines 430..434

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

                    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

                          if (ch == '"' || ch == "\'") {
                            state.tokenize = readQuoted(ch, "string", true, false, slimAttribute);
                            stream.next();
                            return state.tokenize(stream, state);
                          }
                    public_/plantillas/inspinia/js/plugins/codemirror/mode/slim/slim.js on lines 250..254

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

                    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

                          state.stack = {
                            parent: state.stack,
                            style: "comment",
                            indented: state.indented + 1,
                            tokenize: state.line
                    public_/plantillas/inspinia/js/plugins/codemirror/mode/slim/slim.js on lines 325..330

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

                    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

                          state.stack = {
                            parent: state.stack,
                            style: "sub",
                            indented: state.indented + 1,
                            tokenize: state.line
                    public_/plantillas/inspinia/js/plugins/codemirror/mode/slim/slim.js on lines 217..222

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

                    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 attributeWrapperAssign(stream, state) {
                          if (stream.match(/^==?/)) {
                            state.tokenize = attributeWrapperValue;
                            return null;
                          }
                    public_/plantillas/inspinia/js/plugins/codemirror/mode/slim/slim.js on lines 386..392

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

                    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 slimTagExtras(stream, state) {
                          if (stream.match(/^(<>?|><?)/)) {
                            state.tokenize = slimClass;
                            return null;
                          }
                    public_/plantillas/inspinia/js/plugins/codemirror/mode/slim/slim.js on lines 241..247

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

                    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

                    There are no issues that match your filters.

                    Category
                    Status