estimancy/projestimate

View on GitHub

Showing 1,675 of 1,675 total issues

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

          if(n.hovered && !n.selected) {
            for(var s in nStyles) {
              n.setData(s, n.styles['$' + s], 'end');
            }
            delete n.hovered;
Severity: Minor
Found in app/assets/javascripts/jit-2.0.1.js and 1 other location - About 50 mins to fix
app/assets/javascripts/jit-2.0.1.js on lines 2548..2553

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

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(!!nodeTo.visited === T && node.drawn && nodeTo.drawn) {
           !animating && opt.onBeforePlotLine(adj);
           that.plotLine(adj, canvas, animating);
           !animating && opt.onAfterPlotLine(adj);
         }
Severity: Minor
Found in app/assets/javascripts/jit-2.0.1.js and 1 other location - About 50 mins to fix
app/assets/javascripts/jit-2.0.1.js on lines 7132..7136

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

        var s = (this.config.multitree 
                && ('$orn' in node.data) 
                && node.data.$orn) || this.config.orientation;
Severity: Minor
Found in app/assets/javascripts/jit-2.0.1.js and 1 other location - About 50 mins to fix
app/assets/javascripts/jit-2.0.1.js on lines 9500..9502

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

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 ((sourceContinuous && oIdx == 0) || (targetContinuous && oIdx == 1))
                            jsPlumbUtil.addWithFunction(endpointsToPaint, conn.endpoints[oIdx], function(e) { return e.id == conn.endpoints[oIdx].id; });
Severity: Minor
Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js and 1 other location - About 50 mins to fix
app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js on lines 4039..4040

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

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(n.selected) {
          for(var s in nStyles) {
            n.setData(s, n.styles['$' + s], 'end');
          }
          delete n.selected;
Severity: Minor
Found in app/assets/javascripts/jit-2.0.1.js and 1 other location - About 50 mins to fix
app/assets/javascripts/jit-2.0.1.js on lines 2589..2594

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

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

  createLevelDistanceFunc: function() {
    var ld = this.config.levelDistance;
    return function(elem) {
      return (elem._depth + 1) * ld;
    };
Severity: Minor
Found in app/assets/javascripts/jit-2.0.1.js and 1 other location - About 50 mins to fix
app/assets/javascripts/jit-2.0.1.js on lines 15936..15941

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

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

                detach:function() {
                    for (var i = 0, ii = list.length; i < ii; i++)
                        _currentInstance.detach(list[i]);
                },                
Severity: Minor
Found in app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js and 1 other location - About 50 mins to fix
app/assets/javascripts/jquery.jsPlumb-1.4.1-all.js on lines 2441..2444

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

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

    respond_to do |format|
      if @widget.update_attributes(params[:widget])
        format.html { redirect_to widgets_path, notice: 'Widget was successfully updated.' }
        format.json { head :no_content }
      else
Severity: Minor
Found in app/controllers/widgets_controller.rb and 1 other location - About 45 mins to fix
app/controllers/factors_controller.rb on lines 78..84

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

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

  def create
    authorize! :manage, AcquisitionCategory

    @acquisition_category = AcquisitionCategory.new(params[:acquisition_category])
    @organization = Organization.find(params[:organization_id])
Severity: Minor
Found in app/controllers/acquisition_categories_controller.rb and 1 other location - About 45 mins to fix
app/controllers/project_categories_controller.rb on lines 60..71

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

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

    respond_to do |format|
      if @factor.update_attributes(params[:factor])
        format.html { redirect_to factors_path, notice: 'Factor was successfully updated.' }
        format.json { head :no_content }
      else
Severity: Minor
Found in app/controllers/factors_controller.rb and 1 other location - About 45 mins to fix
app/controllers/widgets_controller.rb on lines 79..85

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

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

  def create
    authorize! :manage, ProjectCategory

    @project_category = ProjectCategory.new(params[:project_category])
    @organization = Organization.find(params[:organization_id])
Severity: Minor
Found in app/controllers/project_categories_controller.rb and 1 other location - About 45 mins to fix
app/controllers/acquisition_categories_controller.rb on lines 59..70

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

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

Avoid deeply nested control flow statements.
Open

                      if(typeof adj[j] != 'string') {
                        data = $.merge(node.data, {});
                        node = node.nodeTo;
                      }
Severity: Major
Found in app/assets/javascripts/jit-2.0.1.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                                    if ($.inArray(type, noAnyMatch) < 0) {
                                        matches = typeFunction( c, data );
                                        if (matches !== null) {
                                            filterMatched = matches;
                                            return false;
    Severity: Major
    Found in app/assets/javascripts/tablesorter.min.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if (i === c.columns && $column.length) {
                                  wo.filter_$anyMatch = $column;
                              }
      Severity: Major
      Found in app/assets/javascripts/tablesorter.min.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                    if (filterMatched !== null) {
                                        showRow = filterMatched;
                                    } else {
                                        if (wo.filter_startsWith) {
                                            showRow = false;
        Severity: Major
        Found in app/assets/javascripts/tablesorter.min.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                      if (data.filter) {
                                          data.cache = data.cacheArray[columnIndex];
                                          // check if column data should be from the cell or from parsed data
                                          if (wo.filter_useParsedData || data.parsed[columnIndex]) {
                                              data.exact = data.cache;
          Severity: Major
          Found in app/assets/javascripts/tablesorter.min.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                        for (string in fxn) {
                                            if (typeof string === 'string') {
                                                options += options === '' ?
                                                    '<option value="">' + ($header.data('placeholder') || $header.attr('data-placeholder') || wo.filter_placeholder.select || '') + '</option>' : '';
                                                val = string;
            Severity: Major
            Found in app/assets/javascripts/tablesorter.min.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if ($.isArray(setFilters)) {
                                          // skip first (latest input) to maintain cursor position while typing
                                          if (skipFirst) { $column.slice(1); }
                                          if (i === c.columns) {
                                              // prevent data-column="all" from filling data-column="0,1" (etc)
              Severity: Major
              Found in app/assets/javascripts/tablesorter.min.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                            if (!searchFiltered) { indx = columnIndex; }
                Severity: Major
                Found in app/assets/javascripts/tablesorter.min.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                              if (cell) {
                                                  arry.push( $.trim( cell.textContent || cell.innerText || $(cell).text() ) );
                                              }
                  Severity: Major
                  Found in app/assets/javascripts/tablesorter.min.js - About 45 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language