estimancy/projestimate

View on GitHub

Showing 1,675 of 1,675 total issues

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

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

                                var _cont = (self.isTarget && _jpc.floatingAnchorIndex != 0) || (_jpc.suspendedEndpoint && self.referenceEndpoint && self.referenceEndpoint.id == _jpc.suspendedEndpoint.id);
        Severity: Major
        Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js and 1 other location - About 1 hr to fix
        app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js on lines 5534..5534

        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 62.

        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

                                var _cont = (self.isTarget && _jpc.floatingAnchorIndex != 0) || (_jpc.suspendedEndpoint && self.referenceEndpoint && self.referenceEndpoint.id == _jpc.suspendedEndpoint.id);
        Severity: Major
        Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js and 1 other location - About 1 hr to fix
        app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js on lines 5514..5514

        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 62.

        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

                this.editCanceled = function() {
                    self.fire("editCanceled", {
                        path:connector.getPath()
                    });
                    self.setHover(false);
        Severity: Major
        Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js and 1 other location - About 1 hr to fix
        app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js on lines 5604..5610

        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 62.

        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

                this.editCompleted = function() {            
                    self.fire("editCompleted", {
                        path:connector.getPath()
                    });       
                    self.setHover(false);     
        Severity: Major
        Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js and 1 other location - About 1 hr to fix
        app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js on lines 5611..5617

        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 62.

        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

        Identical blocks of code found in 3 locations. Consider refactoring.
        Open

                      @project.organization.attribute_organizations.each do |am|
                        ['input', 'output'].each do |in_out|
                          mpa = EstimationValue.create(:pe_attribute_id => am.pe_attribute.id,
                                                       :module_project_id => cap_module_project.id,
                                                       :in_out => in_out, :is_mandatory => am.is_mandatory,
        Severity: Major
        Found in app/controllers/projects_controller.rb and 2 other locations - About 1 hr to fix
        app/controllers/projects_controller.rb on lines 361..371
        app/controllers/projects_controller.rb on lines 605..611

        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 58.

        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

            ext_records_permission_project.each do |record|
              ext_permission_uuid=Array.new
              ext_project_security_level_uuid=Array.new
              ext_permission= db.query("SELECT uuid FROM permissions where id=#{record[0]}")
              ext_permission.each do |row|
        Severity: Major
        Found in app/models/home.rb and 1 other location - About 1 hr to fix
        app/models/home.rb on lines 722..736

        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 58.

        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

        Identical blocks of code found in 3 locations. Consider refactoring.
        Open

                        @project.organization.attribute_organizations.each do |am|
                          ['input', 'output'].each do |in_out|
                            mpa = EstimationValue.create(:pe_attribute_id => am.pe_attribute.id,
                                                         :module_project_id => cap_module_project.id,
                                                         :in_out => in_out,
        Severity: Major
        Found in app/controllers/projects_controller.rb and 2 other locations - About 1 hr to fix
        app/controllers/projects_controller.rb on lines 605..611
        app/controllers/projects_controller.rb on lines 629..637

        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 58.

        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

        Identical blocks of code found in 3 locations. Consider refactoring.
        Open

                      @project.organization.attribute_organizations.each do |am|
                        ['input', 'output'].each do |in_out|
                          mpa = EstimationValue.create(:pe_attribute_id => am.pe_attribute.id, :module_project_id => cap_module_project.id, :in_out => in_out,
                                                       :is_mandatory => am.is_mandatory, :description => am.pe_attribute.description, :display_order => nil,
                                                       :string_data_low => {:pe_attribute_name => am.pe_attribute.name, :default_low => ''},
        Severity: Major
        Found in app/controllers/projects_controller.rb and 2 other locations - About 1 hr to fix
        app/controllers/projects_controller.rb on lines 361..371
        app/controllers/projects_controller.rb on lines 629..637

        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 58.

        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

              ext_records_permission.each do |record|
                ext_permission_uuid=Array.new
                ext_group_uuid=Array.new
                ext_permission= db.query("SELECT uuid FROM permissions where id=#{record[0]}")
                ext_permission.each do |row|
        Severity: Major
        Found in app/models/home.rb and 1 other location - About 1 hr to fix
        app/models/home.rb on lines 771..785

        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 58.

        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

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