estimancy/projestimate

View on GitHub

Showing 836 of 1,675 total issues

Function generate_stylesheet has 48 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    fn.generate_stylesheet = function(opts) {
        var styles = '';
        var max_size_x = this.options.max_size_x || this.cols;
        var max_rows = 0;
        var max_cols = 0;
Severity: Minor
Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

    Method show_element_name has 48 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def show_element_name(element)
        if element.attributes.has_key? 'record_status_id'
          if element.is_root?
            "<span class='#{h element.record_status.to_s }'>#{h element.name} </span>"
          else
    Severity: Minor
    Found in app/helpers/wbs_activity_elements_helper.rb - About 1 hr to fix

      Method edit has 48 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def edit
          set_page_title 'Edit estimation'
      
          @project = Project.find(params[:id])
          @organization = @project.organization
      Severity: Minor
      Found in app/controllers/projects_controller.rb - About 1 hr to fix

        Method generate_wbs_project_elt_tree has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

          def generate_wbs_project_elt_tree(element, tree, show_hidden=false, is_project_show_view=false)
            #Root is always display
            gap = 2.5
            tree ||= String.new
            unless element.nil?
        Severity: Minor
        Found in app/helpers/wbs_activity_elements_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

        Method display_text_field_tag has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

          def display_text_field_tag(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
            organization = module_project.project.organization
            precision = est_val_pe_attribute.precision.nil? ? user_number_precision : est_val_pe_attribute.precision
        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

        Method collapse_project_version has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

          def collapse_project_version
            projects = Project.find_all_by_id(params[:project_ids])
            flash_error = ""
            Project.transaction do
              projects.each do |project|
        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

        Function contains has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            'contains': function(node, mpos) {
              var pos = node.pos.getc(true), 
                  width = node.getData('width'),
                  height = node.getData('height'),
                  algnPos = this.getAlignedPos(pos, width, height),
        Severity: Minor
        Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

          Function contains has 47 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              'contains': function(node, mpos) {
                var pos = node.pos.getc(true), 
                    width = node.getData('width'),
                    height = node.getData('height'),
                    algnPos = this.getAlignedPos(pos, width, height),
          Severity: Minor
          Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

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

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

              Function initialize has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                initialize: function(controller) {
                  var config = {
                    animate: false,
                    orientation: "h",
                    offset: 2,
              Severity: Minor
              Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

                Function updateJSON has 47 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 Bezier has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      jsPlumb.Connectors.Bezier = function(params) {
                          params = params || {};
                  
                          var self = this,
                              _super =  jsPlumb.Connectors.AbstractConnector.apply(this, arguments),
                  Severity: Minor
                  Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

                    Method duplicate_wbs_activity has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def duplicate_wbs_activity
                        #Update ancestry depth caching
                        WbsActivityElement.rebuild_depth_cache!
                    
                        begin
                    Severity: Minor
                    Found in app/controllers/wbs_activities_controller.rb - About 1 hr to fix

                      Function onClick has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                            onClick: function (id, options) {
                              var canvas = this.canvas, that = this, Geom = this.geom, config = this.config;
                              var innerController = {
                                  Move: {
                                      enable: true,
                      Severity: Minor
                      Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

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

                                    function $setRoot() {
                                        if(this.config.multitree && clickedNode.data.$orn) {
                                            var orn = clickedNode.data.$orn;
                                            var opp = {
                                                    'left': 'right',
                        Severity: Minor
                        Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

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

                                  this.paint = function(style) {        
                                      if (style !== null) {                
                                          var segments = self.getSegments(), p = { "path":"" },
                                              d = [self.x,self.y,self.w,self.h];
                                          
                          Severity: Minor
                          Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

                            Function stopEvent has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                            function() {
                                                var originalEvent = jpcl.getDropEvent(arguments);                    
                                                _ju.removeWithFunction(params.endpointsByElement[placeholderInfo.id], function(e) {
                                                    return e.id == floatingEndpoint.id;
                                                });
                            Severity: Minor
                            Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

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

                                    onPlaceLabel: function(domElement, node) {
                                      if(!nodeLabels[node.id]) return;
                                      var labels = nodeLabels[node.id],
                                          wrapperStyle = labels.wrapper.style,
                                          labelStyle = labels.label.style,
                              Severity: Minor
                              Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

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

                                        prepareEndpoint = function(existing, index, params, element, elementId, connectorPaintStyle, connectorHoverPaintStyle) {
                                            var e;
                                            if (existing) {
                                                self.endpoints[index] = existing;
                                                existing.addConnection(self);                    
                                Severity: Minor
                                Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

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

                                          var _prepareCompute = function(params) {
                                              self.lineWidth = params.lineWidth;
                                              var segment = jsPlumbUtil.segment(params.sourcePos, params.targetPos),
                                                  swapX = params.targetPos[0] < params.sourcePos[0],
                                                  swapY = params.targetPos[1] < params.sourcePos[1],
                                  Severity: Minor
                                  Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language