estimancy/projestimate

View on GitHub

Showing 1,675 of 1,675 total issues

Function drawBars has 68 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function drawBars(animPc) {
            var t1, t2, t3;

            var cumvalue = new Array();
            var totvalue = new Array();
Severity: Major
Found in app/assets/javascripts/ChartNew.js - About 2 hrs to fix

    File project.rb has 279 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    class Project < ActiveRecord::Base
      attr_accessible :title, :description, :version, :alias, :state, :estimation_status_id, :status_comment,
                      :start_date, :is_model, :organization_id, :project_area_id, :project_category_id,
                      :acquisition_category_id, :platform_category_id, :parent_id
    
    
    Severity: Minor
    Found in app/models/project.rb - About 2 hrs to fix

      Function makeEventObject has 67 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        makeEventObject: function(e, win) {
          var that = this,
              graph = this.viz.graph,
              fx = this.viz.fx,
              ntypes = fx.nodeTypes,
      Severity: Major
      Found in app/assets/javascripts/jit-2.0.1.js - About 2 hrs to fix

        Function format has 67 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                format: function(table, c, wo) {
                    var i, time, classes, $header, $icon, $tfoot, $h, oldtheme, oldremove,
                        themesAll = ts.themes,
                        $table = c.$table,
                        $headers = c.$headers,
        Severity: Major
        Found in app/assets/javascripts/tablesorter.min.js - About 2 hrs to fix

          Method restore_change has 67 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def restore_change
              authorize! :manage_master_data, :all
          
              #get the record controller name
              controller = params[:controller]    #controller.controller_name
          Severity: Major
          Found in lib/data_validation_helper.rb - About 2 hrs to fix

            Consider simplifying this complex logical expression.
            Open

                                    } else if ( (typeof wo.filter_liveSearch === 'number' && this.value.length < wo.filter_liveSearch && this.value !== '') || ( e.type === 'keyup' &&
                                        ( (e.which < 32 && e.which !== 8 && wo.filter_liveSearch === true && e.which !== 13) || (e.which >= 37 && e.which <=40) || (e.which !== 13 && wo.filter_liveSearch === false) ) ) ) {
                                        return;
                                    }
            Severity: Critical
            Found in app/assets/javascripts/pager.js - About 2 hrs to fix

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

                                  if (o < 2) {
                                      c.sortList.push([i, o]);
                                      // add other columns if header spans across multiple
                                      if (cell.colSpan > 1) {
                                          for (j = 1; j < cell.colSpan; j++) {
              Severity: Major
              Found in app/assets/javascripts/pager.js and 1 other location - About 2 hrs to fix
              app/assets/javascripts/pager.js on lines 777..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 88.

              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

                                      if (o < 2) {
                                          c.sortList.push([i, o]);
                                          // add other columns if header spans across multiple
                                          if (cell.colSpan > 1) {
                                              for (j = 1; j < cell.colSpan; j++) {
              Severity: Major
              Found in app/assets/javascripts/pager.js and 1 other location - About 2 hrs to fix
              app/assets/javascripts/pager.js on lines 743..751

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

              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

                function getScrolls(elem) {
                  var position = {
                    x: 0,
                    y: 0
                  };
              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 407..418

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

              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

                function getOffsets(elem) {
                  var position = {
                    x: 0,
                    y: 0
                  };
              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 420..431

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

              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

              Method update_master_data! has 66 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def self.update_master_data!
                  db=Home::connect_external_database
                  puts 'Updating from Master Data...'
              
                  #begin
              Severity: Major
              Found in app/models/home.rb - About 2 hrs to fix

                Function loadJSON has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  loadJSON: function(json) {
                    if(this.busy) return;
                    this.busy = true;
                    
                    var prefix = $.time(), 
                Severity: Major
                Found in app/assets/javascripts/jit-2.0.1.js - About 2 hrs to fix

                  Function draggable has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function draggable(element, onmove, onstart, onstop) {
                          onmove = onmove || function () { };
                          onstart = onstart || function () { };
                          onstop = onstop || function () { };
                          var doc = document;
                  Severity: Major
                  Found in app/assets/javascripts/spectrum.js - About 2 hrs to fix

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

                                $("#table_list_"+tab_index)
                    
                                    .tablesorter({
                                        // this will apply the bootstrap theme if "uitheme" widget is included
                                        // the widgetOptions.uitheme is no longer required to be set
                    Severity: Major
                    Found in app/assets/javascripts/pager.js and 1 other location - About 2 hrs to fix
                    app/assets/javascripts/pager.js on lines 86..110

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

                    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

                        $("table")
                            .tablesorter({
                                // this will apply the bootstrap theme if "uitheme" widget is included
                                // the widgetOptions.uitheme is no longer required to be set
                                theme : "bootstrap",
                    Severity: Major
                    Found in app/assets/javascripts/pager.js and 1 other location - About 2 hrs to fix
                    app/assets/javascripts/pager.js on lines 157..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 87.

                    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

                      layout: {
                        orientation: "h",
                        vertical: function(){
                          return this.orientation == "v";
                        },
                    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 13716..13727

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

                    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

                      layout: {
                        orientation: "h",
                        vertical: function(){
                          return this.orientation == "v";
                        },
                    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 15067..15078

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

                    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

                        if(this.touched) {
                          if(this.touchMoved) {
                            this.config.onTouchEnd(this.touched, event, evt);
                          } else {
                            this.config.onTouchCancel(this.touched, event, evt);
                    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 2171..2178

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

                    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

                        if(this.pressed) {
                          if(this.moved) {
                            this.config.onDragEnd(this.pressed, event, evt);
                          } else {
                            this.config.onDragCancel(this.pressed, event, evt);
                    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 2282..2289

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

                    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 = opts.rows; i >= 0; i--) {
                                styles += (opts.namespace + ' [data-row="' + (i + 1) + '"] { top:' +
                                    ((i * opts.widget_base_dimensions[1]) +
                                    (i * opts.widget_margins[1]) +
                                    ((i + 1) * opts.widget_margins[1]) ) + 'px; }\n');
                    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 3669..3674

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

                    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