estimancy/projestimate

View on GitHub

Showing 836 of 1,675 total issues

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

    function $design(node, maxsize, acum) {
      var sval = node.getData(s, prop);
      var notsval = maxsize
          || (node.getData(nots, prop));

Severity: Minor
Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

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

      updateJSON: function(json, onComplete) {
        if(this.busy) return;
        this.busy = true;
        
        var delegate = this.delegate;
    Severity: Minor
    Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

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

              this.setEndpoint = function(ep) {
      
                  var _e = function(t, p) {
                      var rm = _jsPlumb.getRenderMode();
                      if (jsPlumb.Endpoints[rm][t]) return new jsPlumb.Endpoints[rm][t](p);
      Severity: Minor
      Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

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

                    getPath : function(segment) {
                        return ({
                            "Straight":function(segment) {
                                var d = segment.params;
                                return "m" + _conv(d.x1) + "," + _conv(d.y1) + " l" + _conv(d.x2) + "," + _conv(d.y2) + " e";
        Severity: Minor
        Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

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

              fn.on_drag = function(event, ui) {
                  //break if dragstop has been fired
                  if (this.$player === null) {
                      return false;
                  }
          Severity: Minor
          Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

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

                    getClassNames: function(date){
                        var cls = [],
                            year = this.viewDate.getUTCFullYear(),
                            month = this.viewDate.getUTCMonth(),
                            currentDate = this.date.valueOf(),
            Severity: Minor
            Found in app/assets/javascripts/bootstrap-datepicker.js - About 1 hr to fix

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

                          function multisort(table) { /*jshint loopfunc:true */
                              var dir = 0, tc = table.config,
                                  sortList = tc.sortList, l = sortList.length, bl = table.tBodies.length,
                                  sortTime, i, k, c, colMax, cache, lc, s, order, orgOrderCol;
                              if (tc.serverSideSorting || !tc.cache[0]) { // empty table - fixes #206
              Severity: Minor
              Found in app/assets/javascripts/pager.js - About 1 hr to fix

                Method update_install has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def update_install
                  #No authorize required
                  begin
                      expire_fragment('about_page')
                
                
                Severity: Minor
                Found in app/controllers/homes_controller.rb - About 1 hr to fix

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

                    def update
                      authorize! :edit_organizations, Organization
                  
                      @organization = Organization.find(params[:id])
                      if @organization.update_attributes(params[:organization])
                  Severity: Minor
                  Found in app/controllers/organizations_controller.rb - About 1 hr to fix

                    Method show_project_history has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def show_project_history
                        #No authorize required as authorizations are manage  in each called function...
                        @counter = params['counter']
                        checked_node_ids = params['checked_node_ids']
                        action_id = params['action_id']
                    Severity: Minor
                    Found in app/controllers/projects_controller.rb - About 1 hr to fix

                      Method add_filter_on_project_version has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def add_filter_on_project_version
                          #No authorize required
                          selected_filter_version = params[:filter_selected]
                          #"Display leaves projects only",1], ["Display all versions",2], ["Display root version only",3], ["Most recent version",4]
                      
                      
                      Severity: Minor
                      Found in app/controllers/projects_controller.rb - About 1 hr to fix

                        Function select_or_unselect_all has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function select_or_unselect_all(clicked_elt){
                            var mp_id = $(clicked_elt).data("mp_id");
                            var rows_or_cols = $(clicked_elt).data("rows_or_cols");
                            var at_least_one_selected = false;
                            var number_of_elt = 0;
                        Severity: Minor
                        Found in app/assets/javascripts/projestimate_script.js - 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

                        Function bind has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                            bind : function() {
                                var matchClass = new RegExp('(^|\\s)('+jscolor.bindClass+')(\\s*(\\{[^}]*\\})|\\s|$)', 'i');
                                var e = document.getElementsByTagName('input');
                                for(var i=0; i<e.length; i+=1) {
                                    var m;
                        Severity: Minor
                        Found in app/assets/javascripts/jscolor.js - 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

                        Function setMeasures has 10 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            function setMeasures(data, config, ctx, height, width, ylabels, reverseLegend, reverseAxis, drawAxis, drawLegendOnData) {
                        Severity: Major
                        Found in app/assets/javascripts/ChartNew.js - About 1 hr to fix

                          Method update_link_between_modules has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                            def update_link_between_modules(project, module_project, last_position_x=nil)
                              authorize! :alter_estimation_plan, project
                          
                              return if @initialization_module.nil?
                              initialization_mod_proj = project.module_projects.find_by_pemodule_id(@initialization_module.id)
                          Severity: Minor
                          Found in app/controllers/pemodules_controller.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

                          Method set_technology_size_type_abacus has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                            def set_technology_size_type_abacus
                              authorize! :edit_organizations, Organization
                          
                              @organization = Organization.find(params[:organization])
                              @technologies = @organization.organization_technologies
                          Severity: Minor
                          Found in app/controllers/organizations_controller.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

                          Method edit has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                            def edit
                              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 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

                          Method find_use_project has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                            def find_use_project
                              @project = Project.find(params[:project_id])
                              authorize! :show_project, @project
                          
                              @related_projects = Array.new
                          Severity: Minor
                          Found in app/controllers/projects_controller.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

                          Method results has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                            def results
                              #No authorize required since everyone can search
                              if params[:search].class == Array
                                classes = params[:search][:classes].map { |i| String::keep_clean_space(i).camelcase.constantize }
                              else
                          Severity: Minor
                          Found in app/controllers/searches_controller.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

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

                            def create
                              @project = Project.find(params[:project_id])
                              authorize! :alter_project_pbs_products, @project
                          
                              @pbs_project_element = PbsProjectElement.new(params[:pbs_project_element])
                          Severity: Minor
                          Found in app/controllers/pbs_project_elements_controller.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