estimancy/projestimate

View on GitHub

Showing 836 of 1,675 total issues

Function markup has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    markup = (function () {

        // IE does not support gradients with multiple stops, so we need to simulate
        //  that for the rainbow slider with 8 divs that each have a single gradient
        var gradientFix = "";
Severity: Minor
Found in app/assets/javascripts/spectrum.js - About 1 hr to fix

    Function slide has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      , slide: function (type, next) {
          var $active = this.$element.find('.item.active')
            , $next = next || $active[type]()
            , isCycling = this.interval
            , direction = type == 'next' ? 'left' : 'right'
    Severity: Minor
    Found in app/assets/javascripts/bootstrap.js - About 1 hr to fix

      Function find_collisions has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          fn.find_collisions = function(player_data_coords){
              var self = this;
              var overlapping_region = this.options.overlapping_region;
              var colliders_coords = [];
              var colliders_data = [];
      Severity: Minor
      Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

        Function Radar has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            this.Radar = function (data, options) {
        
                chart.Radar.defaults = {
                    scaleOverlay: false,
                    scaleOverride: false,
        Severity: Minor
        Found in app/assets/javascripts/ChartNew.js - About 1 hr to fix

          Method update_selected_attribute_organizations has 45 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def update_selected_attribute_organizations
              authorize! :manage_organizations, Organization
              @organization = Organization.find(params[:organization_id])
              @organization_projects = @organization.projects
              # Get the Initialization module. It is set in the ApplicationController : @initialization_module = Pemodule.find_by_alias("initialization")
          Severity: Minor
          Found in app/controllers/attribute_organizations_controller.rb - About 1 hr to fix

            Function design has 44 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function design(graph, node, prop, config, orn) {
                var multitree = config.multitree;
                var auxp = [ 'x', 'y' ], auxs = [ 'width', 'height' ];
                var ind = +(orn == "left" || orn == "right");
                var p = auxp[ind], notp = auxp[1 - ind];
            Severity: Minor
            Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

              Function nodeFx has 44 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                 nodeFx: function(opt) {
                   var viz = this.viz,
                       graph  = viz.graph,
                       animation = this.nodeFxAnimation,
                       options = $.merge(this.viz.config, {
              Severity: Minor
              Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

                Function enter has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  enter: function (node) {
                    if (this.busy)
                      return;
                    this.busy = true;
                
                
                Severity: Minor
                Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

                  Function attachEvents has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    attachEvents: function() {
                      var htmlCanvas = this.canvas.getElement(), 
                          that = this;
                      htmlCanvas.oncontextmenu = $.lambda(false);
                      $.addEvents(htmlCanvas, {
                  Severity: Minor
                  Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

                    Function writeSegments has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                writeSegments = function(segments, paintInfo) {
                                    var current, next;                
                                    for (var i = 0; i < segments.length - 1; i++) {
                                        
                                        current = current || _cloneArray(segments[i]);
                    Severity: Minor
                    Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

                      Function on_start_resize has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          fn.on_start_resize = function(event, ui) {
                              this.$resized_widget = ui.$player.closest('.gs-w');
                              this.resize_coords = this.$resized_widget.coords();
                              this.resize_wgd = this.resize_coords.grid;
                              this.resize_initial_width = this.resize_coords.coords.width;
                      Severity: Minor
                      Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

                        Function toAbsolute has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                this.toAbsolute = function(base) {
                                    var base = new jscolor.URI(base);
                                    var r = this;
                                    var t = new jscolor.URI;
                        
                        
                        Severity: Minor
                        Found in app/assets/javascripts/jscolor.js - About 1 hr to fix

                          Function on_stop_drag has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              fn.on_stop_drag = function(event, ui) {
                                  this.$helper.add(this.$player).add(this.$wrapper)
                                      .removeClass('dragging');
                          
                                  ui.position.left = ui.position.left + this.baseX;
                          Severity: Minor
                          Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

                            Function redrawPad has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    function redrawPad() {
                                        // redraw the pad pointer
                                        switch(modeID) {
                                            case 0: var yComponent = 1; break;
                                            case 1: var yComponent = 2; break;
                            Severity: Minor
                            Found in app/assets/javascripts/jscolor.js - About 1 hr to fix

                              Function drawLabels has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      function drawLabels() {
                                          ctx.font = config.scaleFontStyle + " " + config.scaleFontSize + "px " + config.scaleFontFamily;
                              
                                          //X axis line                                                          
                                          if(config.xAxisTop || config.xAxisBottom) {                                                    
                              Severity: Minor
                              Found in app/assets/javascripts/ChartNew.js - About 1 hr to fix

                                Function drawLabels has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        function drawLabels() {
                                            ctx.font = config.scaleFontStyle + " " + config.scaleFontSize + "px " + config.scaleFontFamily;
                                
                                            //X axis line                                                          
                                
                                
                                Severity: Minor
                                Found in app/assets/javascripts/ChartNew.js - About 1 hr to fix

                                  Function drawLabels has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          function drawLabels() {
                                              ctx.font = config.scaleFontStyle + " " + config.scaleFontSize + "px " + config.scaleFontFamily;
                                  
                                              //X axis line                                                          
                                              if(config.xAxisTop || config.xAxisBottom) {                                                    
                                  Severity: Minor
                                  Found in app/assets/javascripts/ChartNew.js - About 1 hr to fix

                                    Function drawLabels has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            function drawLabels() {
                                                ctx.font = config.scaleFontStyle + " " + config.scaleFontSize + "px " + config.scaleFontFamily;
                                    
                                                //X axis labels                                                          
                                    
                                    
                                    Severity: Minor
                                    Found in app/assets/javascripts/ChartNew.js - About 1 hr to fix

                                      Function drawLabels has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                              function drawLabels() {
                                                  ctx.font = config.scaleFontStyle + " " + config.scaleFontSize + "px " + config.scaleFontFamily;
                                      
                                                  //X Labels     
                                                  if(config.xAxisTop || config.xAxisBottom) {                                                    
                                      Severity: Minor
                                      Found in app/assets/javascripts/ChartNew.js - About 1 hr to fix

                                        Method pemodule_input has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                          def pemodule_input(level, est_val, module_project, level_estimation_values, pbs_project_element, attribute_type="", read_only_value=false)
                                        
                                            est_val_pe_attribute = est_val.pe_attribute
                                            if est_val_pe_attribute.attr_type == 'integer' or est_val_pe_attribute.attr_type == 'float'
                                        
                                        
                                        Severity: Minor
                                        Found in app/helpers/projects_helper.rb - 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

                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language