estimancy/projestimate

View on GitHub

Showing 836 of 1,675 total issues

Method add_wbs_activity_to_project has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

  def add_wbs_activity_to_project
    @project = Project.find(params[:project_id])

    @pe_wbs_project_activity = @project.pe_wbs_projects.activities_wbs.first
    @wbs_project_elements_root = @project.wbs_project_element_root
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 getAlignedPos has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    getAlignedPos: function(pos, width, height) {
        var nconfig = this.node;
        var square, orn;
        if(nconfig.align == "center") {
            square = {
Severity: Minor
Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

    Function onCreateLabel has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          onCreateLabel: function(domElement, node) {
            var labelConf = config.Label,
                valueArray = node.getData('valueArray'),
                acum = $.reduce(valueArray, function(x, y) { return x + y; }, 0);
            var nlbs = {
    Severity: Minor
    Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

      Function multipleColumns has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              multipleColumns: function( c, $input ) {
                  // look for multiple columns "1-3,4-6,8" in data-column
                  var ranges, singles, indx,
                      wo = c.widgetOptions,
                  // only target "all" column inputs on initialization
      Severity: Minor
      Found in app/assets/javascripts/tablesorter.min.js - About 1 hr to fix

        Function spectrum has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            $.fn.spectrum = function (opts, extra) {
        
                if (typeof opts == "string") {
        
                    var returnValue = this;
        Severity: Minor
        Found in app/assets/javascripts/spectrum.js - About 1 hr to fix

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

                  this.paint = function(params, containerExtents) {
                      if (path == null) {
                          path = _node("path");
                          params.connector.svg.appendChild(path);
                          self.attachListeners(path, params.connector);
          Severity: Minor
          Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

            Function makeAnchor has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    this.makeAnchor = function() {
                        var _a = function(t, p) {
                            if (jsPlumb.Anchors[t]) return new jsPlumb.Anchors[t](p);
                            if (!_currentInstance.Defaults.DoNotThrowErrors)
                                throw { msg:"jsPlumb: unknown anchor type '" + t + "'" };
            Severity: Minor
            Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

              Function on_start_drag has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  fn.on_start_drag = function(event, ui) {
                      this.$helper.add(this.$player).add(this.$wrapper).addClass('dragging');
              
                      this.highest_col = this.get_highest_occupied_cell().col;
              
              
              Severity: Minor
              Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

                Function drag_handler has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    fn.drag_handler = function(e) {
                        var node = e.target.nodeName;
                        // skip if drag is disabled, or click was not done with the mouse primary button
                        if (this.disabled || e.which !== 1 && !isTouch) {
                            return;
                Severity: Minor
                Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

                  Function animationLoop has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function animationLoop(config, drawScale, drawData, ctx, clrx, clry, clrwidth, clrheight, midPosX, midPosY, borderX, borderY, data) {
                  
                          var cntiter=0;
                          
                          if (isIE() < 9 && isIE() != false) config.animation = false;
                  Severity: Minor
                  Found in app/assets/javascripts/ChartNew.js - About 1 hr to fix

                    Method display_balancing_output has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def display_balancing_output(module_project)
                        #pbs_project_element = @pbs_project_element || @project.root_component
                        pbs_project_element = current_component
                    
                        res = String.new
                    Severity: Minor
                    Found in app/helpers/projects_helper.rb - About 1 hr to fix

                      Method create has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def create
                          authorize! :manage, User
                      
                          set_page_title 'New user'
                      
                      
                      Severity: Minor
                      Found in app/controllers/users_controller.rb - About 1 hr to fix

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

                                format: function(table, c, wo, init) {
                                    var stored, time,
                                        $table = c.$table,
                                        saveSort = wo.saveSort !== false, // make saveSort active/inactive; default to true
                                        sortList = { "sortList" : c.sortList };
                        Severity: Minor
                        Found in app/assets/javascripts/tablesorter.min.js - About 1 hr to fix

                          Function toggleStylesOn has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            toggleStylesOn: function(type, node, set) {
                              var viz = this.viz;
                              var nStyles = this.nStyles;
                              if(set) {
                                var that = this;
                          Severity: Minor
                          Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

                            Function onMouseMove has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              onMouseMove: function(e, win, event) {
                                //if mouse button is down and moving set move=true
                                if(this.down) this.move = true;
                                //already handled by mouseover/out
                                if(this.dom && this.isLabel(e, win)) return;
                            Severity: Minor
                            Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

                              Function plotStep has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  plotStep: function(delta, controller, animating) {
                                      var viz = this.viz,
                                      config = this.config,
                                      canvas = viz.canvas, 
                                      ctx = canvas.getCtx(),
                              Severity: Minor
                              Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

                                Function updateHelperLocations has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        function updateHelperLocations() {
                                            var s = currentSaturation;
                                            var v = currentValue;
                                
                                            if(allowEmpty && isEmpty) {
                                Severity: Minor
                                Found in app/assets/javascripts/spectrum.js - About 1 hr to fix

                                  Function _updateAnchorList has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          var _updateAnchorList = function(lists, theta, order, conn, aBoolean, otherElId, idx, reverse, edgeId, elId, connsToPaint, endpointsToPaint) {        
                                              // first try to find the exact match, but keep track of the first index of a matching element id along the way.s
                                              var exactIdx = -1,
                                                  firstMatchingElIdx = -1,
                                                  endpoint = conn.endpoints[idx],
                                  Severity: Minor
                                  Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

                                    Function detach has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            this.detach = function() {
                                    
                                                if (arguments.length == 0) return;
                                                var connType =  _currentInstance.Defaults.ConnectionType || _currentInstance.getDefaultConnectionType(),
                                                    firstArgIsConnection = arguments[0].constructor == connType,
                                    Severity: Minor
                                    Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

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

                                                          dragOptions[stopEvent] = _wrap(dragOptions[stopEvent], function() {                             
                                                              if (existingStop) existingStop.apply(this, arguments);                                
                                      
                                                              //_currentlyDown = false;
                                                              _currentInstance.currentlyDragging = false;
                                      Severity: Minor
                                      Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language