estimancy/projestimate

View on GitHub

Showing 1,675 of 1,675 total issues

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

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

                                    res << "#{text_field_tag "[#{level}][#{est_val_pe_attribute.alias.to_sym}][#{module_project.id.to_s}][#{wbs_project_elt.id.to_s}]",
                                                             pbs_last_result[wbs_project_elt.id][:value],
                                                             :readonly => true,
                                                             :class => "input-small #{level} #{est_val.id} #{wbs_project_elt.id} #{attribute_type}",
                                                             "data-est_val_id" => est_val.id, "data-wbs_project_elt_id" => wbs_project_elt.id}"
                Severity: Major
                Found in app/helpers/projects_helper.rb and 1 other location - About 1 hr to fix
                app/helpers/projects_helper.rb on lines 815..819

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

                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 2 locations. Consider refactoring.
                Open

                                  res << "#{text_field_tag "[#{level}][#{est_val_pe_attribute.alias.to_sym}][#{module_project.id.to_s}][#{wbs_project_elt.id.to_s}]",
                                                           pbs_last_result[wbs_project_elt.id][:value],
                                                           :readonly => true, :class => "input-small #{level} #{est_val.id} #{wbs_project_elt.id} #{attribute_type}",
                                                           "data-est_val_id" => est_val.id, "data-wbs_project_elt_id" => wbs_project_elt.id}"
                                  readonly_option = true
                Severity: Major
                Found in app/helpers/projects_helper.rb and 1 other location - About 1 hr to fix
                app/helpers/projects_helper.rb on lines 801..806

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

                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 3 locations. Consider refactoring.
                Open

                                        _delements[pid][id] = {
                                            id:id,
                                            offset:{
                                                left:cLoc.left - pLoc.left,
                                                top:cLoc.top - pLoc.top
                Severity: Major
                Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js and 2 other locations - About 1 hr to fix
                app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js on lines 466..472
                app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js on lines 497..503

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

                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

                          $.support.transition && this.$element.hasClass('fade')?
                            this.$backdrop.one($.support.transition.end, callback) :
                            callback()
                Severity: Major
                Found in app/assets/javascripts/bootstrap.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/bootstrap.js on lines 578..580

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

                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

                      delegate.config.offsetY = -size.height/2 + margin.bottom 
                        + (config.showLabels && (config.labelOffset + config.Label.size));
                Severity: Major
                Found in app/assets/javascripts/jit-2.0.1.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/jit-2.0.1.js on lines 10344..10345

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

                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

                      $.support.transition && this.$element.hasClass('collapse') ?
                        this.$element.one($.support.transition.end, complete) :
                        complete()
                Severity: Major
                Found in app/assets/javascripts/bootstrap.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/bootstrap.js on lines 986..988

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

                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

                            return pointHelper(p1, p2, function(_p1, _p2) {
                                return Math.sqrt(Math.pow(_p2[1] - _p1[1], 2) + Math.pow(_p2[0] - _p1[0], 2));            
                            });
                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 7842..7844

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

                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 3 locations. Consider refactoring.
                Open

                                                _delements[id][cid] = {
                                                    id:cid,
                                                    offset:{
                                                        left:cOff.left - parentOffset.left,
                                                        top:cOff.top - parentOffset.top
                Severity: Major
                Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js and 2 other locations - About 1 hr to fix
                app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js on lines 497..503
                app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js on lines 527..533

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

                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

                            c.$table
                                .removeClass('hasResizable')
                                .find('thead')
                                .unbind('mouseup.tsresize mouseleave.tsresize contextmenu.tsresize')
                                .find('tr').children()
                Severity: Major
                Found in app/assets/javascripts/pager.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/tablesorter.min.js on lines 1958..1965

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

                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

                    $("#project_record_number").change(function() {
                        return $.ajax({
                            url: "project_record_number",
                            method: "GET",
                            data: "nb=" + $(this).val()
                Severity: Major
                Found in app/assets/javascripts/projestimate_script.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/projestimate_script.js on lines 159..165

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

                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 3 locations. Consider refactoring.
                Open

                                    _delements[id][i] = {
                                        id:i,
                                        offset:{
                                            left:cOff.left - parentOffset.left,
                                            top:cOff.top - parentOffset.top
                Severity: Major
                Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js and 2 other locations - About 1 hr to fix
                app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js on lines 466..472
                app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js on lines 527..533

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

                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

                            switch (o.minViewMode) {
                                case 1:
                                case 'months':
                                    o.minViewMode = 1;
                                    break;
                Severity: Major
                Found in app/assets/javascripts/bootstrap-datepicker.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/bootstrap-datepicker.js on lines 112..123

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

                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

                            segLength = function(s) {
                                return Math.sqrt(Math.pow(s[0] - s[2], 2) + Math.pow(s[1] - s[3], 2));    
                            },
                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 180..182

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

                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

                Severity
                Category
                Status
                Source
                Language