estimancy/projestimate

View on GitHub

Showing 1,675 of 1,675 total issues

Function buildParserCache has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            function buildParserCache(table) {
                var c = table.config,
                // update table bodies in case we start with an empty table
                    tb = c.$tbodies = c.$table.children('tbody:not(.' + c.cssInfoBlock + ')'),
                    rows, list, l, i, h, ch, p, parsersDebug = "";
Severity: Minor
Found in app/assets/javascripts/pager.js - About 1 hr to fix

    Function resize_widget has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        fn.resize_widget = function($widget, size_x, size_y, callback) {
            var wgd = $widget.coords().grid;
            var col = wgd.col;
            var max_cols = this.options.max_cols;
            var old_size_y = wgd.size_y;
    Severity: Minor
    Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

      Function updateNavArrows has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              updateNavArrows: function() {
                  if (!this._allow_update) return;
      
                  var d = new Date(this.viewDate),
                      year = d.getUTCFullYear(),
      Severity: Minor
      Found in app/assets/javascripts/bootstrap-datepicker.js - About 1 hr to fix

        Function set_player has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            fn.set_player = function(col, row, no_player) {
                var self = this;
                if (!no_player) {
                    this.empty_cells_player_occupies();
                }
        Severity: Minor
        Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

          Function get_valid_rows has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              fn.get_valid_rows = function(widget_grid_data, upper_rows, min_row) {
                  var p_top_row = widget_grid_data.row;
                  var p_bottom_row = widget_grid_data.row + widget_grid_data.size_y - 1;
                  var size_y = widget_grid_data.size_y;
                  var r = min_row - 1;
          Severity: Minor
          Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

            Method import_user_from_ldap_mail has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def import_user_from_ldap_mail(ldap_cn, email, ldap_server)
                login_filter = Net::LDAP::Filter.eq ldap_server.email_attribute, "#{email}"
                object_filter = Net::LDAP::Filter.eq 'objectClass', '*'
                #is_an_automatic_account_activation? ? status = 'active' : 'pending'
            
            
            Severity: Minor
            Found in app/models/user.rb - About 1 hr to fix

              Method import_user_from_ldap has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def import_user_from_ldap(ldap_cn, login, ldap_server)
                  login_filter = Net::LDAP::Filter.eq ldap_server.user_name_attribute, "#{login}"
                  object_filter = Net::LDAP::Filter.eq 'objectClass', '*'
                  #is_an_automatic_account_activation? ? status = 'active' : status = 'pending'
              
              
              Severity: Minor
              Found in app/models/user.rb - About 1 hr to fix

                Function defMouse has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function defMouse(ctx,data,config,tpgraph) {
                
                        if (config.annotateDisplay == true) {
                            if (cursorDivCreated == false) oCursor = new makeCursorObj('divCursor');
                            if (isIE() < 9 && isIE() != false) ctx.canvas.attachEvent("on" + config.annotateFunction.split(' ')[0], function (event) { 
                Severity: Minor
                Found in app/assets/javascripts/ChartNew.js - About 1 hr to fix

                  Method show has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

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

                    Method perform has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def perform(pbs_project_elt_id, estimation_value_id)
                        #No authorize required since this method is private and won't be call from any route
                    
                        pbs_project_elt = PbsProjectElement.find(pbs_project_elt_id)
                        estimation_value = EstimationValue.find(estimation_value_id)
                    Severity: Minor
                    Found in app/workers/estimations_worker.rb - About 1 hr to fix

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                                  ActiveRecord::Base.transaction do
                                    ancestors = []
                                    ext_ancestry = ext.ancestry
                                    unless ext_ancestry.nil?
                                      ext_ancestry_list = ext.ancestry.split('/')
                      Severity: Major
                      Found in app/models/home.rb and 1 other location - About 1 hr to fix
                      app/models/home.rb on lines 454..467

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 54.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                                ActiveRecord::Base.transaction do
                                  ancestors = []
                                  ext_ancestry = ext_elt.ancestry
                                  unless ext_ancestry.nil?
                                    ext_ancestry_list = ext_elt.ancestry.split('/')
                      Severity: Major
                      Found in app/models/home.rb and 1 other location - About 1 hr to fix
                      app/models/home.rb on lines 312..325

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 54.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Function onComplete has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                            onComplete: function() {
                              //compute positions of newly inserted nodes
                              if(config.request)
                                that.compute();
                      
                      
                      Severity: Minor
                      Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

                        Function normalizeDims has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          normalizeDims: function() {
                            //number of elements
                            var root = this.delegate.graph.getNode(this.delegate.root), l=0;
                            root.eachAdjacency(function() {
                              l++;
                        Severity: Minor
                        Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

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

                                onPlaceLabel: function(domElement, node) {
                                  if(!config.showLabels) return;
                                  var pos = node.pos.getp(true),
                                      dimArray = node.getData('dimArray'),
                                      span = node.getData('span') / 2,
                          Severity: Minor
                          Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

                            Function contract has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                contract: function(node, opt) {
                                  var viz = this.viz;
                                  if(node.collapsed || !node.anySubnode($.lambda(true))) return;
                                  opt = $.merge(this.options, viz.config, opt || {}, {
                                    'modes': ['node-property:alpha:span', 'linear']
                            Severity: Minor
                            Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

                              Function hideFilters has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      hideFilters: function(table, c) {
                                          var $filterRow, $filterRow2, timer;
                                          $(table)
                                              .find('.' + ts.css.filterRow)
                                              .addClass('hideme')
                              Severity: Minor
                              Found in app/assets/javascripts/tablesorter.min.js - About 1 hr to fix

                                Function getConnections has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        this.getConnections = function(options, flat) {
                                            if (!options) {
                                                options = {};
                                            } else if (options.constructor == String) {
                                                options = { "scope": options };
                                Severity: Minor
                                Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

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

                                          this.detach = function(connection, ignoreTarget, forceDetach, fireEvent, originalEvent) {
                                              var idx = _ju.findWithFunction(self.connections, function(c) { return c.id == connection.id}), 
                                                  actuallyDetached = false;
                                              fireEvent = (fireEvent !== false);
                                              if (idx >= 0) {        
                                  Severity: Minor
                                  Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

                                    Function can_go_player_up has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        fn.can_go_player_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
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language