estimancy/projestimate

View on GitHub

Showing 836 of 1,675 total issues

Method display_effort_or_cost_per_phase has 97 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def display_effort_or_cost_per_phase(pbs_project_element, module_project_id, estimation_value, view_widget_id)
    res = String.new
    view_widget = ViewsWidget.find(view_widget_id)

    module_project = ModuleProject.find(module_project_id)
Severity: Major
Found in app/helpers/views_widgets_helper.rb - About 3 hrs to fix

    Function Arc has 96 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            Arc : function(params) {
                var self = this,
                    _super = jsPlumb.Segments.AbstractSegment.apply(this, arguments),
                    _calcAngle = function(_x, _y) {
                        return jsPlumbUtil.theta([params.cx, params.cy], [_x, _y]);    
    Severity: Major
    Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 3 hrs to fix

      Function redraw has 95 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              this.redraw = function(elementId, ui, timestamp, offsetToUI, clearEdits) {
              
                  if (!jsPlumbInstance.isSuspendDrawing()) {
                      // get all the endpoints for this element
                      var ep = _amEndpoints[elementId] || [],
      Severity: Major
      Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 3 hrs to fix

        Function AbstractDOMOverlay has 94 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            var AbstractDOMOverlay = function(params) {
                jsPlumb.DOMElementComponent.apply(this, arguments);
                AbstractOverlay.apply(this, arguments);
                
                var self = this, initialised = false, jpcl = jsPlumb.CurrentLibrary;
        Severity: Major
        Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 3 hrs to fix

          Function fill has 94 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  fill: function() {
                      var d = new Date(this.viewDate),
                          year = d.getUTCFullYear(),
                          month = d.getUTCMonth(),
                          startYear = this.o.startDate !== -Infinity ? this.o.startDate.getUTCFullYear() : -Infinity,
          Severity: Major
          Found in app/assets/javascripts/bootstrap-datepicker.js - About 3 hrs to fix

            Function render has 93 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                'render' : function(node, canvas) {
                  var pos = node.pos.getc(true), 
                      width = node.getData('width'),
                      height = node.getData('height'),
                      algnPos = this.getAlignedPos(pos, width, height),
            Severity: Major
            Found in app/assets/javascripts/jit-2.0.1.js - About 3 hrs to fix

              Function click has 92 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      click: function(e) {
                          e.preventDefault();
                          var target = $(e.target).closest('span, td, th');
                          if (target.length == 1) {
                              switch(target[0].nodeName.toLowerCase()) {
              Severity: Major
              Found in app/assets/javascripts/bootstrap-datepicker.js - About 3 hrs to fix

                Function SpkMultiWidget has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function SpkMultiWidget(helperId) {
                    this.helperId = helperId;
                    allMultiWidgets[""+helperId] = this;
                    this.eventHandlers = new Array();
                    this.refreshIntervalSecs = REFRESH_SECS;
                Severity: Major
                Found in app/assets/javascripts/spk_multiwidget.js - About 3 hrs to fix

                  Function render has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      'render' : function(node, canvas) {
                        var pos = node.pos.getc(true), 
                            width = node.getData('width'),
                            height = node.getData('height'),
                            algnPos = this.getAlignedPos(pos, width, height),
                  Severity: Major
                  Found in app/assets/javascripts/jit-2.0.1.js - About 3 hrs to fix

                    Function URI has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        URI : function(uri) { // See RFC3986
                    
                            this.scheme = null;
                            this.authority = null;
                            this.path = '';
                    Severity: Major
                    Found in app/assets/javascripts/jscolor.js - About 3 hrs to fix

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

                        def update
                          @module_project = ModuleProject.find(params[:id])
                          @project = @module_project.project
                      
                          authorize! :alter_estimation_plan, @project
                      Severity: Major
                      Found in app/controllers/module_projects_controller.rb - About 3 hrs to fix

                        Method checkout has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def checkout
                            old_prj = Project.find(params[:project_id])
                        
                            authorize! :commit_project, old_prj
                        
                        
                        Severity: Major
                        Found in app/controllers/projects_controller.rb - About 3 hrs to fix

                          Function SpkMultiWidget has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function SpkMultiWidget(helperId) {
                              this.helperId = helperId;
                              allMultiWidgets[""+helperId] = this;
                              this.eventHandlers = new Array();
                              this.refreshIntervalSecs = REFRESH_SECS;
                          Severity: Minor
                          Found in app/assets/javascripts/spk_multiwidget.js - About 3 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 generate_report has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                          Open

                            def generate_report
                          
                              conditions = Hash.new
                              params[:report].each do |i|
                                unless i.last.blank? or i.last.nil?
                          Severity: Minor
                          Found in app/controllers/organizations_controller.rb - About 3 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 initialize has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def initialize(user, organization)
                          
                              #Uncomment in order to authorize everybody to manage all the app
                              if Rails.env == "test" || user.super_admin == true
                                can :manage, :all
                          Severity: Major
                          Found in app/models/ability.rb - About 3 hrs to fix

                            Function render has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                'render' : function(node, canvas) {
                                  var pos = node.pos.getp(true),
                                      dimArray = node.getData('dimArray'),
                                      valueArray = node.getData('valueArray'),
                                      colorArray = node.getData('colorArray'),
                            Severity: Major
                            Found in app/assets/javascripts/jit-2.0.1.js - About 3 hrs to fix

                              Class OrganizationsController has 29 methods (exceeds 20 allowed). Consider refactoring.
                              Open

                              class OrganizationsController < ApplicationController
                                load_resource
                                require 'rubygems'
                                require 'securerandom'
                                include ProjectsHelper
                              Severity: Minor
                              Found in app/controllers/organizations_controller.rb - About 3 hrs to fix

                                Function render has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    'render' : function(node, canvas) {
                                      var pos = node.pos.getc(true), 
                                          width = node.getData('width'),
                                          height = node.getData('height'),
                                          algnPos = this.getAlignedPos(pos, width, height),
                                Severity: Major
                                Found in app/assets/javascripts/jit-2.0.1.js - About 3 hrs to fix

                                  Function parseDate has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          parseDate: function(date, format, language) {
                                              if (date instanceof Date) return date;
                                              if (/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(date)) {
                                                  var part_re = /([\-+]\d+)([dmwy])/,
                                                      parts = date.match(/([\-+]\d+)([dmwy])/g),
                                  Severity: Major
                                  Found in app/assets/javascripts/bootstrap-datepicker.js - About 3 hrs to fix

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

                                            format: function(table, c, wo){
                                                if (c.$table.hasClass('hasResizable')) { return; }
                                                c.$table.addClass('hasResizable');
                                                var $t, t, i, j, s = {}, $c, $cols, w, tw,
                                                    $tbl = c.$table,
                                    Severity: Major
                                    Found in app/assets/javascripts/pager.js - About 3 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language