estimancy/projestimate

View on GitHub

Showing 1,675 of 1,675 total issues

Function _applyStyles has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _applyStyles = function(node, style, component, _jsPlumb) {
        var styleToWrite = {};
        if (style.strokeStyle) {
            styleToWrite["stroked"] = "true";
            var strokeColor = jsPlumbUtil.convertStyle(style.strokeStyle, true);
Severity: Minor
Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

    Function buildHeaders has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                function buildHeaders(table) {
                    var header_index = computeThIndexes(table), ch, $t,
                        h, i, t, lock, time, c = table.config;
                    c.headerList = [];
                    c.headerContent = [];
    Severity: Minor
    Found in app/assets/javascripts/pager.js - About 1 hr to fix

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

                          jsGraphAnnotate[ctx.canvas.id][annotateCnt++] = ["POINT", midPosX + Math.cos(config.startAngle*Math.PI/180 - 0 * rotationDegree) * calculateOffset(config, data.datasets[i].data[0], calculatedScale, scaleHop), midPosY - Math.sin(config.startAngle*Math.PI/180 - 0 * rotationDegree) * calculateOffset(config, data.datasets[i].data[0], calculatedScale, scaleHop), lgtxt, lgtxt2, data.datasets[i].data[0], divprev, divnext, maxvalue[0], totvalue[0], i, 0];
      Severity: Major
      Found in app/assets/javascripts/ChartNew.js and 1 other location - About 1 hr to fix
      app/assets/javascripts/ChartNew.js on lines 1575..1575

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

      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

          $(".accordion").on("show", function (e) {
             $(e.target).parent().find(".icon-caret-right").removeClass("icon-caret-right").addClass("icon-caret-down");
          });
      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 172..174

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

      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

                              jsGraphAnnotate[ctx.canvas.id][annotateCnt++] = ["POINT", midPosX + Math.cos(config.startAngle*Math.PI/180 - j * rotationDegree) * calculateOffset(config, data.datasets[i].data[j], calculatedScale, scaleHop), midPosY - Math.sin(config.startAngle*Math.PI/180 - j * rotationDegree) * calculateOffset(config, data.datasets[i].data[j], calculatedScale, scaleHop), lgtxt, lgtxt2, data.datasets[i].data[j], divprev, divnext, maxvalue[j], totvalue[j], i, j];
      Severity: Major
      Found in app/assets/javascripts/ChartNew.js and 1 other location - About 1 hr to fix
      app/assets/javascripts/ChartNew.js on lines 1589..1589

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

      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

          $(".accordion").on("hide", function (e) {
              $(e.target).parent().find(".icon-caret-down").removeClass("icon-caret-down").addClass("icon-caret-right");
          });
      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 167..169

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

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

                new_mp.guw_unit_of_work_groups.each do |guw_group|
                  new_pbs_project_element = new_prj_components.find_by_copy_id(guw_group.pbs_project_element_id)
                  new_pbs_project_element_id = new_pbs_project_element.nil? ? nil : new_pbs_project_element.id
                  guw_group.update_attribute(:pbs_project_element_id, new_pbs_project_element_id)
      
      
      Severity: Major
      Found in app/controllers/projects_controller.rb and 3 other locations - About 1 hr to fix
      app/controllers/projects_controller.rb on lines 1557..1569
      app/models/project.rb on lines 379..391
      app/workers/organization_duplicate_project_worker.rb on lines 400..412

      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

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

              new_mp.guw_unit_of_work_groups.each do |guw_group|
                new_pbs_project_element = new_prj_components.find_by_copy_id(guw_group.pbs_project_element_id)
                new_pbs_project_element_id = new_pbs_project_element.nil? ? nil : new_pbs_project_element.id
                guw_group.update_attribute(:pbs_project_element_id, new_pbs_project_element_id)
      
      
      Severity: Major
      Found in app/workers/organization_duplicate_project_worker.rb and 3 other locations - About 1 hr to fix
      app/controllers/projects_controller.rb on lines 1557..1569
      app/controllers/projects_controller.rb on lines 1933..1945
      app/models/project.rb on lines 379..391

      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

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

                  new_mp.guw_unit_of_work_groups.each do |guw_group|
                    new_pbs_project_element = new_prj_components.find_by_copy_id(guw_group.pbs_project_element_id)
                    new_pbs_project_element_id = new_pbs_project_element.nil? ? nil : new_pbs_project_element.id
                    guw_group.update_attribute(:pbs_project_element_id, new_pbs_project_element_id)
      
      
      Severity: Major
      Found in app/models/project.rb and 3 other locations - About 1 hr to fix
      app/controllers/projects_controller.rb on lines 1557..1569
      app/controllers/projects_controller.rb on lines 1933..1945
      app/workers/organization_duplicate_project_worker.rb on lines 400..412

      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

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

              new_mp.guw_unit_of_work_groups.each do |guw_group|
                new_pbs_project_element = new_prj_components.find_by_copy_id(guw_group.pbs_project_element_id)
                new_pbs_project_element_id = new_pbs_project_element.nil? ? nil : new_pbs_project_element.id
                guw_group.update_attribute(:pbs_project_element_id, new_pbs_project_element_id)
      
      
      Severity: Major
      Found in app/controllers/projects_controller.rb and 3 other locations - About 1 hr to fix
      app/controllers/projects_controller.rb on lines 1933..1945
      app/models/project.rb on lines 379..391
      app/workers/organization_duplicate_project_worker.rb on lines 400..412

      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

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

        initialize: function(controller) {
          var $ForceDirected = $jit.ForceDirected;
      
          var config = {
            iterations: 50,
      Severity: Minor
      Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

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

            ts.addHeaderResizeEvent = function(table, disable, settings) {
                table = $(table)[0]; // make sure we're usig a dom element
                var headers,
                    defaults = {
                        timer : 250
        Severity: Minor
        Found in app/assets/javascripts/tablesorter.min.js - About 1 hr to fix

          Function checkFilters has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  checkFilters: function(table, filter, skipFirst) {
                      var c = table.config,
                          wo = c.widgetOptions,
                          filterArray = $.isArray(filter),
                          filters = (filterArray) ? filter : ts.getFilters(table, true),
          Severity: Minor
          Found in app/assets/javascripts/tablesorter.min.js - About 1 hr to fix

            Function plot has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

               plot: function(opt, animating) {
                 var viz = this.viz, 
                     aGraph = viz.graph, 
                     canvas = viz.canvas, 
                     id = viz.root, 
            Severity: Minor
            Found in app/assets/javascripts/jit-2.0.1.js - About 1 hr to fix

              Function paint has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      this.paint = function(params, containerExtents) {
                          var p = {}, d = params.d, connector = params.component;
                          if (params.strokeStyle) {
                              p["stroked"] = "true";
                              p["strokecolor"] = jsPlumbUtil.convertStyle(params.strokeStyle, true);                    
              Severity: Minor
              Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

                Function toString has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        toString: function(format) {
                            var formatSet = !!format;
                            format = format || this._format;
                
                            var formattedString = false;
                Severity: Minor
                Found in app/assets/javascripts/spectrum.js - About 1 hr to fix

                  Function populate has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          populate : function(model, values) {        
                              // for a string, see if it has parameter matches, and if so, try to make the substitutions.
                              var getValue = function(fromString) {
                                      var matches = fromString.match(/(\${.*?})/g);
                                      if (matches != null) {
                  Severity: Minor
                  Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

                    Function _initDraggableIfNecessary has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            _initDraggableIfNecessary = function(element, isDraggable, dragOptions) {
                                // TODO move to DragManager?
                                if (!jsPlumbAdapter.headless) {
                                    var draggable = isDraggable == null ? false : isDraggable, jpcl = jsPlumb.CurrentLibrary;
                                    if (draggable) {
                    Severity: Minor
                    Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js - About 1 hr to fix

                      Function set_placeholder has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          fn.set_placeholder = function(col, row) {
                              var phgd = $.extend({}, this.placeholder_grid_data);
                              var $nexts = this.widgets_below({
                                      col: phgd.col,
                                      row: phgd.row,
                      Severity: Minor
                      Found in app/assets/javascripts/jquery.gridster.js - About 1 hr to fix

                        Function PolarArea has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            this.PolarArea = function (data, options) {
                        
                                chart.PolarArea.defaults = {
                                    scaleOverlay: true,
                                    scaleOverride: false,
                        Severity: Minor
                        Found in app/assets/javascripts/ChartNew.js - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language