estimancy/projestimate

View on GitHub

Showing 1,675 of 1,675 total issues

Function Line has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    this.Line = function (data, options) {

        chart.Line.defaults = {
                  inGraphDataShow: false,
                  inGraphDataPaddingX: 3,
Severity: Major
Found in app/assets/javascripts/ChartNew.js - About 2 hrs to fix

    Function initialize has 55 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        initialize: function(viz, opt) {
          this.viz = viz;
          this.opt = this.config = opt;
          var id = $.type(opt.injectInto) == 'string'? 
              opt.injectInto:opt.injectInto.id,
    Severity: Major
    Found in app/assets/javascripts/jit-2.0.1.js - About 2 hrs to fix

      Function Bar has 55 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          this.Bar = function (data, options) {
              chart.Bar.defaults = {
                        inGraphDataShow: false,
                        inGraphDataPaddingX: 0,
                        inGraphDataPaddingY: 3,
      Severity: Major
      Found in app/assets/javascripts/ChartNew.js - About 2 hrs to fix

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

                for (i = 0; i < last_n_rows; i++) {
                    if ($.inArray(this.last_rows[i], rows) === -1) {
                        (end_callback || $.noop).call(this, this.last_rows[i]);
                    }
                }
        Severity: Major
        Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 2 hrs to fix
        app/assets/javascripts/jquery.gridster.js on lines 2286..2290

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

        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

                        viz.fx.animate($.merge(options, {
                            modes: ['node-property:alpha', 'linear'],
                            onComplete: function() {
                                that.removeNode(n, { type: 'nothing' });
                                options.onComplete && options.onComplete();
        Severity: Major
        Found in app/assets/javascripts/jit-2.0.1.js and 1 other location - About 2 hrs to fix
        app/assets/javascripts/jit-2.0.1.js on lines 5491..5497

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

        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

                toHsv: function() {
                    var hsv = rgbToHsv(this._r, this._g, this._b);
                    return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a };
                },
        Severity: Major
        Found in app/assets/javascripts/spectrum.js and 1 other location - About 2 hrs to fix
        app/assets/javascripts/spectrum.js on lines 1238..1241

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

        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

                                    $.each(ts.filter.types, function(type, typeFunction) {
                                        if ($.inArray(type, noAnyMatch) < 0) {
                                            matches = typeFunction( c, data );
                                            if (matches !== null) {
                                                filterMatched = matches;
        Severity: Major
        Found in app/assets/javascripts/tablesorter.min.js and 1 other location - About 2 hrs to fix
        app/assets/javascripts/tablesorter.min.js on lines 1313..1321

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

        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

                for (i = 0; i< last_n_cols; i++) {
                    if ($.inArray(this.last_cols[i], cols) === -1) {
                        (stop_callback || $.noop).call(this, this.last_cols[i]);
                    }
                }
        Severity: Major
        Found in app/assets/javascripts/jquery.gridster.js and 1 other location - About 2 hrs to fix
        app/assets/javascripts/jquery.gridster.js on lines 2324..2328

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

        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

                toHsl: function() {
                    var hsl = rgbToHsl(this._r, this._g, this._b);
                    return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a };
                },
        Severity: Major
        Found in app/assets/javascripts/spectrum.js and 1 other location - About 2 hrs to fix
        app/assets/javascripts/spectrum.js on lines 1227..1230

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

        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

                        viz.fx.animate($.merge(options, {
                            modes: ['edge-property:alpha', 'linear'],
                            onComplete: function() {
                                that.removeEdge(v, { type: 'nothing' });
                                options.onComplete && options.onComplete();
        Severity: Major
        Found in app/assets/javascripts/jit-2.0.1.js and 1 other location - About 2 hrs to fix
        app/assets/javascripts/jit-2.0.1.js on lines 5388..5394

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

        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

                                            $.each(ts.filter.types, function(type, typeFunction) {
                                                if ($.inArray(type, excludeMatch) < 0) {
                                                    matches = typeFunction( c, data );
                                                    if (matches !== null) {
                                                        filterMatched = matches;
        Severity: Major
        Found in app/assets/javascripts/tablesorter.min.js and 1 other location - About 2 hrs to fix
        app/assets/javascripts/tablesorter.min.js on lines 1233..1241

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

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

                  ["input", "output"].each do |io|
                    new_mp.pemodule.pe_attributes.each do |attr|
                      old_prj.pbs_project_elements.each do |old_component|
                        new_prj_components.each do |new_component|
                          ev = new_mp.estimation_values.where(pe_attribute_id: attr.id, in_out: io).first
        Severity: Major
        Found in app/controllers/organizations_controller.rb and 5 other locations - About 2 hrs to fix
        app/controllers/projects_controller.rb on lines 1580..1590
        app/controllers/projects_controller.rb on lines 1956..1966
        app/models/project.rb on lines 402..412
        app/workers/organization_duplicate_project_worker.rb on lines 248..258
        app/workers/organization_duplicate_project_worker.rb on lines 423..433

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

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

                  ["input", "output"].each do |io|
                    new_mp.pemodule.pe_attributes.each do |attr|
                      old_prj.pbs_project_elements.each do |old_component|
                        new_prj_components.each do |new_component|
                          ev = new_mp.estimation_values.where(pe_attribute_id: attr.id, in_out: io).first
        Severity: Major
        Found in app/controllers/projects_controller.rb and 5 other locations - About 2 hrs to fix
        app/controllers/organizations_controller.rb on lines 410..420
        app/controllers/projects_controller.rb on lines 1580..1590
        app/models/project.rb on lines 402..412
        app/workers/organization_duplicate_project_worker.rb on lines 248..258
        app/workers/organization_duplicate_project_worker.rb on lines 423..433

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

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

                ["input", "output"].each do |io|
                  new_mp.pemodule.pe_attributes.each do |attr|
                    old_prj.pbs_project_elements.each do |old_component|
                      new_prj_components.each do |new_component|
                        ev = new_mp.estimation_values.where(pe_attribute_id: attr.id, in_out: io).first
        Severity: Major
        Found in app/controllers/projects_controller.rb and 5 other locations - About 2 hrs to fix
        app/controllers/organizations_controller.rb on lines 410..420
        app/controllers/projects_controller.rb on lines 1956..1966
        app/models/project.rb on lines 402..412
        app/workers/organization_duplicate_project_worker.rb on lines 248..258
        app/workers/organization_duplicate_project_worker.rb on lines 423..433

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

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

                ["input", "output"].each do |io|
                  new_mp.pemodule.pe_attributes.each do |attr|
                    old_prj.pbs_project_elements.each do |old_component|
                      new_prj_components.each do |new_component|
                        ev = new_mp.estimation_values.where(pe_attribute_id: attr.id, in_out: io).first
        Severity: Major
        Found in app/workers/organization_duplicate_project_worker.rb and 5 other locations - About 2 hrs to fix
        app/controllers/organizations_controller.rb on lines 410..420
        app/controllers/projects_controller.rb on lines 1580..1590
        app/controllers/projects_controller.rb on lines 1956..1966
        app/models/project.rb on lines 402..412
        app/workers/organization_duplicate_project_worker.rb on lines 423..433

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

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

                ["input", "output"].each do |io|
                  new_mp.pemodule.pe_attributes.each do |attr|
                    old_prj.pbs_project_elements.each do |old_component|
                      new_prj_components.each do |new_component|
                        ev = new_mp.estimation_values.where(pe_attribute_id: attr.id, in_out: io).first
        Severity: Major
        Found in app/workers/organization_duplicate_project_worker.rb and 5 other locations - About 2 hrs to fix
        app/controllers/organizations_controller.rb on lines 410..420
        app/controllers/projects_controller.rb on lines 1580..1590
        app/controllers/projects_controller.rb on lines 1956..1966
        app/models/project.rb on lines 402..412
        app/workers/organization_duplicate_project_worker.rb on lines 248..258

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

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

                    ["input", "output"].each do |io|
                      new_mp.pemodule.pe_attributes.each do |attr|
                        old_prj.pbs_project_elements.each do |old_component|
                          new_prj_components.each do |new_component|
                            ev = new_mp.estimation_values.where(pe_attribute_id: attr.id, in_out: io).first
        Severity: Major
        Found in app/models/project.rb and 5 other locations - About 2 hrs to fix
        app/controllers/organizations_controller.rb on lines 410..420
        app/controllers/projects_controller.rb on lines 1580..1590
        app/controllers/projects_controller.rb on lines 1956..1966
        app/workers/organization_duplicate_project_worker.rb on lines 248..258
        app/workers/organization_duplicate_project_worker.rb on lines 423..433

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

        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 mouseDownListener has 54 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                            var mouseDownListener = function(e) {
        
                                // if disabled, return.
                                if (!_sourcesEnabled[idToRegisterAgainst]) return;
                                
        Severity: Major
        Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 2 hrs to fix

          Function HorizontalStackedBar has 54 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              this.HorizontalStackedBar = function (data, options) {
          
                  chart.HorizontalStackedBar.defaults = {
                            inGraphDataShow: false,
                            inGraphDataPaddingX: -3,
          Severity: Major
          Found in app/assets/javascripts/ChartNew.js - About 2 hrs to fix

            Function HorizontalBar has 54 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                this.HorizontalBar = function (data, options) {
                    chart.HorizontalBar.defaults = {
                              inGraphDataShow: false,
                              inGraphDataPaddingX: 3,
                              inGraphDataPaddingY: 0,
            Severity: Major
            Found in app/assets/javascripts/ChartNew.js - About 2 hrs to fix
              Severity
              Category
              Status
              Source
              Language