estimancy/projestimate

View on GitHub

Showing 836 of 1,675 total issues

Function Arrow has 68 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    jsPlumb.Overlays.Arrow = function(params) {
        this.type = "Arrow";
        AbstractOverlay.apply(this, arguments);
        this.isAppendedAtTopLevel = false;
        params = params || {};
Severity: Major
Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 2 hrs to fix

    Function on_resize has 68 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        fn.on_resize = function(event, ui) {
            var rel_x = (ui.pointer.diff_left);
            var rel_y = (ui.pointer.diff_top);
            var wbd_x = this.options.widget_base_dimensions[0];
            var wbd_y = this.options.widget_base_dimensions[1];
    Severity: Major
    Found in app/assets/javascripts/jquery.gridster.js - About 2 hrs to fix

      Function drawBars has 68 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function drawBars(animPc) {
                  var cumvalue = new Array();
                  var totvalue = new Array();
                  for (var i = 0; i < data.datasets.length; i++) { for (var j = 0; j < data.datasets[i].data.length; j++) { cumvalue[j] = 0; totvalue[j] = 0; } }
                  for (var i = 0; i < data.datasets.length; i++) { for (var j = 0; j < data.datasets[i].data.length; j++) totvalue[j] += data.datasets[i].data[j]; }
      Severity: Major
      Found in app/assets/javascripts/ChartNew.js - About 2 hrs to fix

        Function drawBars has 68 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                function drawBars(animPc) {
                    var t1, t2, t3;
        
                    var cumvalue = new Array();
                    var totvalue = new Array();
        Severity: Major
        Found in app/assets/javascripts/ChartNew.js - About 2 hrs to fix

          File project.rb has 279 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          class Project < ActiveRecord::Base
            attr_accessible :title, :description, :version, :alias, :state, :estimation_status_id, :status_comment,
                            :start_date, :is_model, :organization_id, :project_area_id, :project_category_id,
                            :acquisition_category_id, :platform_category_id, :parent_id
          
          
          Severity: Minor
          Found in app/models/project.rb - About 2 hrs to fix

            Function makeEventObject has 67 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              makeEventObject: function(e, win) {
                var that = this,
                    graph = this.viz.graph,
                    fx = this.viz.fx,
                    ntypes = fx.nodeTypes,
            Severity: Major
            Found in app/assets/javascripts/jit-2.0.1.js - About 2 hrs to fix

              Function format has 67 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      format: function(table, c, wo) {
                          var i, time, classes, $header, $icon, $tfoot, $h, oldtheme, oldremove,
                              themesAll = ts.themes,
                              $table = c.$table,
                              $headers = c.$headers,
              Severity: Major
              Found in app/assets/javascripts/tablesorter.min.js - About 2 hrs to fix

                Method restore_change has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def restore_change
                    authorize! :manage_master_data, :all
                
                    #get the record controller name
                    controller = params[:controller]    #controller.controller_name
                Severity: Major
                Found in lib/data_validation_helper.rb - About 2 hrs to fix

                  Consider simplifying this complex logical expression.
                  Open

                                          } else if ( (typeof wo.filter_liveSearch === 'number' && this.value.length < wo.filter_liveSearch && this.value !== '') || ( e.type === 'keyup' &&
                                              ( (e.which < 32 && e.which !== 8 && wo.filter_liveSearch === true && e.which !== 13) || (e.which >= 37 && e.which <=40) || (e.which !== 13 && wo.filter_liveSearch === false) ) ) ) {
                                              return;
                                          }
                  Severity: Critical
                  Found in app/assets/javascripts/pager.js - About 2 hrs to fix

                    Method update_master_data! has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def self.update_master_data!
                        db=Home::connect_external_database
                        puts 'Updating from Master Data...'
                    
                        #begin
                    Severity: Major
                    Found in app/models/home.rb - About 2 hrs to fix

                      Function loadJSON has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        loadJSON: function(json) {
                          if(this.busy) return;
                          this.busy = true;
                          
                          var prefix = $.time(), 
                      Severity: Major
                      Found in app/assets/javascripts/jit-2.0.1.js - About 2 hrs to fix

                        Function draggable has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function draggable(element, onmove, onstart, onstop) {
                                onmove = onmove || function () { };
                                onstart = onstart || function () { };
                                onstop = onstop || function () { };
                                var doc = document;
                        Severity: Major
                        Found in app/assets/javascripts/spectrum.js - About 2 hrs to fix

                          Method update has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                          Open

                            def update
                              @user = User.find(params[:id])
                              if current_user != @user
                                authorize! :manage, User
                              end
                          Severity: Minor
                          Found in app/controllers/users_controller.rb - 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

                          Method validate_change has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                          Open

                            def validate_change
                              authorize! :manage_master_data, :all
                          
                              #get the record controller name
                              controller = params[:controller]    #controller.controller_name
                          Severity: Minor
                          Found in lib/data_validation_helper.rb - 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

                          Function out has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            out: function(){
                              if(this.busy) return;
                              this.busy = true;
                              this.events.hoveredNode = false;
                              var that = this,
                          Severity: Major
                          Found in app/assets/javascripts/jit-2.0.1.js - About 2 hrs to fix

                            Method generate_report has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def generate_report
                            
                                conditions = Hash.new
                                params[:report].each do |i|
                                  unless i.last.blank? or i.last.nil?
                            Severity: Major
                            Found in app/controllers/organizations_controller.rb - About 2 hrs to fix

                              Function paint has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      this.paint = function(params) {
                                          
                                          if (visible) {
                                                  
                                              params = params || {};
                              Severity: Major
                              Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 2 hrs to fix

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

                                     setRoot: function(id, method, onComplete) {
                                            if(this.busy) return;
                                            this.busy = true;
                                          var that = this, canvas = this.canvas;
                                            var rootNode = this.graph.getNode(this.root);
                                Severity: Major
                                Found in app/assets/javascripts/jit-2.0.1.js - About 2 hrs to fix

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

                                    out: function(){
                                      if(this.busy)
                                        return;
                                  
                                      var that = this,
                                  Severity: Major
                                  Found in app/assets/javascripts/jit-2.0.1.js - About 2 hrs to fix

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

                                        jsPlumb.DynamicAnchor = function(params) {
                                            jsPlumb.Anchor.apply(this, arguments);
                                            
                                            this.isSelective = true;
                                            this.isDynamic = true;            
                                    Severity: Major
                                    Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 2 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language