estimancy/projestimate

View on GitHub

Showing 836 of 1,675 total issues

Method update has 138 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def update
    set_page_title 'Edit estimation'
    @project = Project.find(params[:id])
    @organization = @project.organization

Severity: Major
Found in app/controllers/projects_controller.rb - About 5 hrs to fix

    Class ApplicationController has 41 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class ApplicationController < ActionController::Base
      protect_from_forgery
    
      before_filter :authenticate_user!
    
    
    Severity: Minor
    Found in app/controllers/application_controller.rb - About 5 hrs to fix

      Function Doughnut has 136 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          var Doughnut = function (data, config, ctx) {
              var segmentTotal = 0;
              var msr, midPieX, midPieY;
      
              if (!dynamicFunction(data,config,ctx,"Doughnut"))return;
      Severity: Major
      Found in app/assets/javascripts/ChartNew.js - About 5 hrs to fix

        Function Pie has 135 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            var Pie = function (data, config, ctx) {
                var segmentTotal = 0;
                var msr, midPieX, midPieY,pieRadius;
        
                if (!dynamicFunction(data,config,ctx,"Pie"))return;
        Severity: Major
        Found in app/assets/javascripts/ChartNew.js - About 5 hrs to fix

          File application_controller.rb has 387 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          class ApplicationController < ActionController::Base
            protect_from_forgery
          
            before_filter :authenticate_user!
          
          
          Severity: Minor
          Found in app/controllers/application_controller.rb - About 5 hrs to fix

            Function makeSource has 132 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    this.makeSource = function(el, params, referenceParams) {
                        var p = jsPlumb.extend({}, referenceParams);
                        jsPlumb.extend(p, params);
                        _setEndpointPaintStylesAndAnchor(p, 0);   
                        var jpcl = jsPlumb.CurrentLibrary,
            Severity: Major
            Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 5 hrs to fix

              Function init has 131 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      init: function(table, c, wo) {
                          // filter language options
                          ts.language = $.extend(true, {}, {
                              to  : 'to',
                              or  : 'or',
              Severity: Major
              Found in app/assets/javascripts/tablesorter.min.js - About 5 hrs to fix

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

                        format: function(table, c, wo){
                            if (c.$table.hasClass('hasStickyHeaders')) { return; }
                            var $t = c.$table,
                                $win = $(window),
                                header = $t.children('thead:first'),
                Severity: Major
                Found in app/assets/javascripts/pager.js - About 5 hrs to fix

                  Method create has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def create
                      @is_model = params[:project][:is_model]
                      if @is_model == "true"
                        authorize! :manage_estimation_models, Project
                      else
                  Severity: Minor
                  Found in app/controllers/projects_controller.rb - About 5 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 execute_duplication_SAVE has 127 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def execute_duplication_SAVE(project_id, new_organization_id, user_id)
                  
                      user = User.find(user_id)
                  
                      #begin
                  Severity: Major
                  Found in app/workers/organization_duplicate_project_worker.rb - About 5 hrs to fix

                    Function PolarArea has 124 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        var PolarArea = function (data, config, ctx) {
                            var maxSize, scaleHop, calculatedScale, labelHeight, scaleHeight, valueBounds, labelTemplateString, msr, midPosX, midPosY;
                    
                            if (!dynamicFunction(data,config,ctx,"PolarArea"))return;
                    
                    
                    Severity: Major
                    Found in app/assets/javascripts/ChartNew.js - About 4 hrs to fix

                      Function bindEvents has 123 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                  function bindEvents(table){
                                      var c = table.config,
                                          $this = c.$table,
                                          j, downTime;
                                      // apply event handling to headers
                      Severity: Major
                      Found in app/assets/javascripts/pager.js - About 4 hrs to fix

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

                          def update
                            authorize! :manage_estimation_widgets, @project
                        
                            @views_widget = ViewsWidget.find(params[:id])
                            @view_id = @views_widget.view_id
                        Severity: Minor
                        Found in app/controllers/views_widgets_controller.rb - About 4 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 update_views_and_widgets has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def update_views_and_widgets(new_prj, old_mp, new_mp)
                            #For initialization module level
                            if old_mp.pemodule.alias == Projestimate::Application::INITIALIZATION
                              #Copy the views and widgets for the new project
                              new_view = View.create(organization_id: new_prj.organization_id, name: "#{new_prj.to_s} : view for #{new_mp.to_s}", description: "Please rename the view's name and description if needed.")
                        Severity: Minor
                        Found in app/controllers/projects_controller.rb - About 4 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 restore_change has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def restore_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 4 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 drawBars has 121 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                function drawBars(animPc) {
                                    ctx.lineWidth = config.barStrokeWidth;
                                    var yStart = new Array(data.datasets.length);
                        
                                    var cumvalue = new Array();
                        Severity: Major
                        Found in app/assets/javascripts/ChartNew.js - About 4 hrs to fix

                          Method included has 121 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def self.included(base)
                          
                              base.class_eval do
                          
                                #self relation on master data : Parent<->Child
                          Severity: Major
                          Found in lib/master_data_helper.rb - About 4 hrs to fix

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

                                    function drawBars(animPc) {
                                        ctx.lineWidth = config.barStrokeWidth;
                                        var yStart = new Array(data.datasets.length);
                            
                                        var cumvalue = new Array();
                            Severity: Major
                            Found in app/assets/javascripts/ChartNew.js - About 4 hrs to fix

                              Function morph has 119 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  morph: function(json, opt, extraModes) {
                                      extraModes = extraModes || {};
                                      var viz = this.viz;
                                      var options = $.merge(this.options, viz.controller, opt), root = viz.root;
                                      var graph;
                              Severity: Major
                              Found in app/assets/javascripts/jit-2.0.1.js - About 4 hrs to fix

                                Method load_master_data! has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  def self.load_master_data!
                                    db=Home::connect_external_database
                                    #begin
                                    record_status = ExternalMasterDatabase::ExternalRecordStatus.all
                                    record_status.each do |i|
                                Severity: Minor
                                Found in app/models/home.rb - About 4 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

                                Severity
                                Category
                                Status
                                Source
                                Language