BabylonJS/Spector.js

View on GitHub
vendors/ace-mode-glsl.js

Summary

Maintainability
D
2 days
Test Coverage

File ace-mode-glsl.js has 478 lines of code (exceeds 250 allowed). Consider refactoring.
Open

ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
"use strict";

var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
Severity: Minor
Found in vendors/ace-mode-glsl.js - About 7 hrs to fix

    Function c_cppHighlightRules has 168 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var c_cppHighlightRules = function() {
    
        var keywordControls = (
            "break|case|continue|default|do|else|for|goto|if|_Pragma|" +
            "return|switch|while|catch|operator|try|throw|using"
    Severity: Major
    Found in vendors/ace-mode-glsl.js - About 6 hrs to fix

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

      var glslHighlightRules = function() {
      
          var keywords = (
              "layout|attribute|const|uniform|varying|break|continue|do|for|while|" +
              "if|else|in|out|inout|float|int|void|bool|true|false|" +
      Severity: Minor
      Found in vendors/ace-mode-glsl.js - About 1 hr to fix

        Function getSectionRange has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            this.getSectionRange = function(session, row) {
                var line = session.getLine(row);
                var startIndent = line.search(/\S/);
                var startRow = row;
                var startColumn = line.length;
        Severity: Minor
        Found in vendors/ace-mode-glsl.js - About 1 hr to fix

          Function getFoldWidgetRange has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
                  var line = session.getLine(row);
                  
                  if (this.startRegionRe.test(line))
                      return this.getCommentRegionBlock(session, line, row);
          Severity: Minor
          Found in vendors/ace-mode-glsl.js - About 1 hr to fix

            Avoid too many return statements within this function.
            Open

                            return this.closingBracketBlock(session, match[1], row, i);
            Severity: Major
            Found in vendors/ace-mode-glsl.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                          return session.getCommentFoldRange(row, i, -1);
              Severity: Major
              Found in vendors/ace-mode-glsl.js - About 30 mins to fix

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

                });                (function() {
                                    ace.require(["ace/mode/glsl"], function(m) {
                                        if (typeof module == "object" && typeof exports == "object" && module) {
                                            module.exports = m;
                                        }
                Severity: Major
                Found in vendors/ace-mode-glsl.js and 2 other locations - About 1 hr to fix
                vendors/ace-ext-searchbox.js on lines 507..513
                vendors/ace-theme-monokai.js on lines 105..111

                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

                var Mode = function() {
                    this.HighlightRules = c_cppHighlightRules;
                
                    this.$outdent = new MatchingBraceOutdent();
                    this.$behaviour = new CstyleBehaviour();
                Severity: Major
                Found in vendors/ace-mode-glsl.js and 1 other location - About 1 hr to fix
                vendors/ace-mode-glsl.js on lines 558..564

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

                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

                var Mode = function() {
                    this.HighlightRules = glslHighlightRules;
                    
                    this.$outdent = new MatchingBraceOutdent();
                    this.$behaviour = new CstyleBehaviour();
                Severity: Major
                Found in vendors/ace-mode-glsl.js and 1 other location - About 1 hr to fix
                vendors/ace-mode-glsl.js on lines 436..443

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

                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