webcol/Calima

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

Summary

Maintainability
F
3 days
Test Coverage

File textile.js has 472 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

(function(mod) {
  if (typeof exports == 'object' && typeof module == 'object') { // CommonJS

    Function handlePhraseModifier has 61 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Parser.prototype.handlePhraseModifier = function(ch) {
      if (ch === '_') {
        if (this.stream.eat('_')) {
          return this.togglePhraseModifier('italic', /^.*__/);
        }

      Function RegExpFactory has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function RegExpFactory() {
        this.cache = {};
        this.single = {
          bc: 'bc',
          bq: 'bq',

        Function createRe has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        RegExpFactory.prototype.createRe = function(name) {
          switch (name) {
            case 'drawTable':
              return this.makeRe('^', this.single.drawTable, '$');
            case 'html':

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

            blockType: function() {
              var match,
                  type;
              this.state.layoutType = null;
          
          

            Avoid too many return statements within this function.
            Open

                return this.togglePhraseModifier('cite', /^.*\?\?/);

              Avoid too many return statements within this function.
              Open

                  return this.execMode(Modes.text);

                Avoid too many return statements within this function.
                Open

                    return type;

                  Avoid too many return statements within this function.
                  Open

                      return this.togglePhraseModifier('deletion', /^.*-/);

                    Avoid too many return statements within this function.
                    Open

                        return this.togglePhraseModifier('addition', /^.*\+/);

                      Avoid too many return statements within this function.
                      Open

                            return this.tokenStylesWith(this.styleFor('html'));

                        Avoid too many return statements within this function.
                        Open

                            return this.togglePhraseModifier('sup', /^.*\^/);

                          Avoid too many return statements within this function.
                          Open

                              return this.tokenStyles();

                            Avoid too many return statements within this function.
                            Open

                                return this.togglePhraseModifier('notextile', /^.*==/);

                              Avoid too many return statements within this function.
                              Open

                                  return this.togglePhraseModifier('code', /^.*@/);

                                Avoid too many return statements within this function.
                                Open

                                    return this.togglePhraseModifier('span', /^.*%/);

                                  Avoid too many return statements within this function.
                                  Open

                                          return this.execMode(Modes.definitionList);

                                    Avoid too many return statements within this function.
                                    Open

                                        return this.tokenStyles();

                                      Avoid too many return statements within this function.
                                      Open

                                        return this.tokenStyles();

                                        Avoid too many return statements within this function.
                                        Open

                                            return this.togglePhraseModifier('sub', /^.*~/);

                                          Avoid too many return statements within this function.
                                          Open

                                                  return this.execMode(Modes.html);

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

                                              tableCellAttributes: function() {
                                                this.setModeForNextToken(Modes.tableText);
                                            
                                                if (this.eat('tableCellAttributes')) {
                                                  return this.tokenStylesWith(this.styleFor('attributes'));
                                            public_/plantillas/inspinia/js/plugins/codemirror/mode/textile/textile.js on lines 430..437

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

                                            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

                                              attributes: function() {
                                                this.setModeForNextToken(Modes.layoutLength);
                                            
                                                if (this.eat('attributes')) {
                                                  return this.tokenStylesWith(this.styleFor('attributes'));
                                            public_/plantillas/inspinia/js/plugins/codemirror/mode/textile/textile.js on lines 511..518

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

                                            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 === '*') {
                                                if (this.stream.eat('*')) {
                                                  return this.togglePhraseModifier('bold', /^.*\*\*/);
                                                }
                                                return this.togglePhraseModifier('strong', /^.*\*/);
                                            public_/plantillas/inspinia/js/plugins/codemirror/mode/textile/textile.js on lines 97..102

                                            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

                                              if (ch === '_') {
                                                if (this.stream.eat('_')) {
                                                  return this.togglePhraseModifier('italic', /^.*__/);
                                                }
                                                return this.togglePhraseModifier('em', /^.*_/);
                                            public_/plantillas/inspinia/js/plugins/codemirror/mode/textile/textile.js on lines 104..109

                                            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

                                                if (this.stream.eat('.') && this.stream.eat('.')) {
                                                  this.state.spanningLayout = true;
                                                }
                                            public_/librerias/jqueryMobile/jquery.mobile.custom.js on lines 11182..11184

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

                                            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

                                            Parser.prototype.eat = function(name) {
                                              return this.stream.match(this.regExpFactory.pattern(name), true);
                                            };
                                            public_/plantillas/inspinia/js/plugins/codemirror/mode/textile/textile.js on lines 62..64

                                            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

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

                                            Parser.prototype.check = function(name) {
                                              return this.stream.match(this.regExpFactory.pattern(name), false);
                                            };
                                            public_/plantillas/inspinia/js/plugins/codemirror/mode/textile/textile.js on lines 58..60

                                            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

                                            There are no issues that match your filters.

                                            Category
                                            Status