estimancy/projestimate

View on GitHub

Showing 836 of 1,675 total issues

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

    ts.addHeaderResizeEvent = function(table, disable, options){
        var defaults = {
                timer : 250
            },
            o = $.extend({}, defaults, options),
Severity: Minor
Found in app/assets/javascripts/pager.js - 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 sl, time,
                    $t = c.$table,
                    ss = wo.saveSort !== false, // make saveSort active/inactive; default to true
                    sortList = { "sortList" : c.sortList };
    Severity: Minor
    Found in app/assets/javascripts/pager.js - About 1 hr to fix

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

          ts.storage = function(table, key, val){
              var d, k, ls = false, v = {},
                  id = table.id || $('.tablesorter').index( $(table) ),
                  url = window.location.pathname;
              // https://gist.github.com/paulirish/5558557
      Severity: Minor
      Found in app/assets/javascripts/pager.js - About 1 hr to fix

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

        function scrollFunction(){
            for (var i=0;i<dynamicDisplayList["length"];i++) {
              if (isScrolledIntoView(dynamicDisplay[dynamicDisplayList[i]][5]) && dynamicDisplay[dynamicDisplayList[i]][2]==false) {
                dynamicDisplay[dynamicDisplayList[i]][1]=true;
                switch(dynamicDisplay[dynamicDisplayList[i]][6]){
        Severity: Minor
        Found in app/assets/javascripts/ChartNew.js - About 1 hr to fix

          Method display_text_field_tag has 34 lines of code (exceeds 25 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

            Consider simplifying this complex logical expression.
            Open

                                } else if ( this.value !== '' && (
                                    // liveSearch can contain a min value length; ignore arrow and meta keys, but allow backspace
                                    ( typeof wo.filter_liveSearch === 'number' && this.value.length < wo.filter_liveSearch ) ||
                                        // let return & backspace continue on, but ignore arrows & non-valid characters
                                        ( event.which !== 13 && event.which !== 8 && ( event.which < 32 || (event.which >= 37 && event.which <= 40) ) ) ) ) {
            Severity: Critical
            Found in app/assets/javascripts/tablesorter.min.js - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

                          if ((readable && ! bestIsReadable) ||
                              (readable && bestIsReadable && score > bestScore) ||
                              ((! readable) && (! bestIsReadable) && score > bestScore)) {
                              bestIsReadable = readable;
                              bestScore = score;
              Severity: Critical
              Found in app/assets/javascripts/spectrum.js - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                                if ((angle > jsGraphAnnotate[ctx.canvas.id][i][5] && angle < jsGraphAnnotate[ctx.canvas.id][i][6]) || (angle > jsGraphAnnotate[ctx.canvas.id][i][5]-2*Math.PI && angle < jsGraphAnnotate[ctx.canvas.id][i][6]-2*Math.PI)|| (angle > jsGraphAnnotate[ctx.canvas.id][i][5]+2*Math.PI && angle < jsGraphAnnotate[ctx.canvas.id][i][6]+2*Math.PI)) {
                
                                    annotateDIV.style.border = config.annotateBorder;
                                    annotateDIV.style.padding = config.annotatePadding;
                                    annotateDIV.style.borderRadius = config.annotateBorderRadius;
                Severity: Critical
                Found in app/assets/javascripts/ChartNew.js - About 1 hr to fix

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

                        'render': function(node, canvas) {
                          var height = node.getData('height');
                          var ldist = height? height : this.config.levelDistance;
                          var span = node.getData('span') / 2, theta = node.pos.theta;
                          var begin = theta - span, end = theta + span;
                  Severity: Minor
                  Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

                    Function getPos has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    $.getPos = function(elem) {
                      var offset = getOffsets(elem);
                      var scroll = getScrolls(elem);
                      return {
                        x: offset.x - scroll.x,
                    Severity: Minor
                    Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

                      Function renderLabel has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          renderLabel: function(canvas, node, controller) {
                            var span = node.getData('span');
                            if(span < Math.PI /2 && Math.tan(span) * 
                                this.config.levelDistance * node._depth < 10) {
                              return;
                      Severity: Minor
                      Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

                        Function register has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                this.register = function(el) {
                                    var jpcl = jsPlumb.CurrentLibrary;
                                    el = jpcl.getElementObject(el);
                                    var id = _currentInstance.getId(el),
                                        domEl = jpcl.getDOMElement(el),
                        Severity: Minor
                        Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

                          Function can_go_widget_up has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              fn.can_go_widget_up = function(widget_grid_data) {
                                  var p_bottom_row = widget_grid_data.row + widget_grid_data.size_y - 1;
                                  var result = true;
                                  var upper_rows = [];
                                  var min_row = 10000;
                          Severity: Minor
                          Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

                            Function add_widget has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                fn.add_widget = function(html, size_x, size_y, col, row, max_size, min_size) {
                                    var pos;
                                    size_x || (size_x = 1);
                                    size_y || (size_y = 1);
                            
                            
                            Severity: Minor
                            Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

                              Function datepicker has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  $.fn.datepicker = function ( option ) {
                                      var args = Array.apply(null, arguments);
                                      args.shift();
                                      var internal_return,
                                          this_return;
                              Severity: Minor
                              Found in app/assets/javascripts/bootstrap-datepicker.js - About 1 hr to fix

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

                                    this.Doughnut = function (data, options) {
                                
                                        chart.Doughnut.defaults = {
                                                  inGraphDataShow: false,
                                                  inGraphDataPaddingRadius: 0,
                                Severity: Minor
                                Found in app/assets/javascripts/ChartNew.js - About 1 hr to fix

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

                                      this.Pie = function (data, options) {
                                          chart.Pie.defaults = {
                                                    inGraphDataShow: false,
                                                    inGraphDataPaddingRadius: 5,
                                                    inGraphDataPaddingAngle: 0,
                                  Severity: Minor
                                  Found in app/assets/javascripts/ChartNew.js - About 1 hr to fix

                                    Method compute_component_estimation_value has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      def compute_component_estimation_value(component, pe_attribute_id, level_estimation_value, wbs_project_elt_root=nil)
                                        #No authorize required since this method is private and won't be call from any route
                                        component_children_results_array = Array.new
                                        new_effort_person_hour = Hash.new
                                        pe_attribute = PeAttribute.find(pe_attribute_id)
                                    Severity: Minor
                                    Found in app/workers/estimations_worker.rb - About 1 hr to fix

                                      Method collapse_project_version has 33 lines of code (exceeds 25 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

                                        Method set_project_version has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          def set_project_version(project_to_checkout)
                                            #No authorize is required as method is private and could not be accessed by any route
                                            new_version = ''
                                            parent_version = project_to_checkout.version
                                        
                                        
                                        Severity: Minor
                                        Found in app/controllers/projects_controller.rb - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language