dotledger/dotledger

View on GitHub

Showing 155 of 155 total issues

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

    initialize: function () {
      // FIXME: This is a hack to make it easier to test.
      if (this.view.options.tags) {
        this.tags = this.view.options.tags;
      } else {
Severity: Major
Found in app/assets/javascripts/dot_ledger/behaviors/tag_selector.js and 3 other locations - About 2 hrs to fix
app/assets/javascripts/dot_ledger/behaviors/account_group_selector.js on lines 3..11
app/assets/javascripts/dot_ledger/behaviors/account_selector.js on lines 3..11
app/assets/javascripts/dot_ledger/behaviors/category_selector.js on lines 3..11

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

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

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

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

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

Refactorings

Further Reading

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

    setActiveTab: function () {
      this.$el.find('a[data-tab]').parent().removeClass('active');
      this.$el.find("a[data-tab='" + (this.params.get('tab')) + "']").parent().addClass('active');
    },
Severity: Major
Found in app/assets/javascripts/dot_ledger/views/accounts/show.js and 2 other locations - About 2 hrs to fix
app/assets/javascripts/dot_ledger/views/accounts/balance_graph.js on lines 16..19
app/assets/javascripts/dot_ledger/views/payments/projected_balance_graph.js on lines 16..19

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

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

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

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

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

Refactorings

Further Reading

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

    setActivePeriod: function () {
      this.$el.find('a[data-period]').parent().removeClass('active');
      this.$el.find("a[data-period='" + (this.params.get('period')) + "']").parent().addClass('active');
    },
app/assets/javascripts/dot_ledger/views/accounts/show.js on lines 25..28
app/assets/javascripts/dot_ledger/views/payments/projected_balance_graph.js on lines 16..19

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

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

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

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

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

Refactorings

Further Reading

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

    setActivePeriod: function () {
      this.$el.find('a[data-period]').parent().removeClass('active');
      this.$el.find("a[data-period='" + (this.params.get('period')) + "']").parent().addClass('active');
    },
app/assets/javascripts/dot_ledger/views/accounts/balance_graph.js on lines 16..19
app/assets/javascripts/dot_ledger/views/accounts/show.js on lines 25..28

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

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

    templateHelpers: function () {
      return {
        hasAccounts: _.bind(function () {
          return this.collection.length > 0;
        }, this),
Severity: Major
Found in app/assets/javascripts/dot_ledger/views/accounts/list_widget.js - About 2 hrs to fix

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

        balanceGraphData: function () {
          return [
            {
              color: 'rgb(111, 202, 194)',
              data: this.balances.map(function (balance) {
    app/assets/javascripts/dot_ledger/views/accounts/balance_graph.js on lines 60..69

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

    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

        balanceGraphData: function () {
          return [
            {
              color: 'rgb(111, 202, 194)',
              data: this.balances.map(function (balance) {
    app/assets/javascripts/dot_ledger/views/payments/projected_balance_graph.js on lines 48..57

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

    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

        clickPeriod: function (event) {
          event.preventDefault();
          this.params.set({
            period: $(event.target).data('period')
          });
    app/assets/javascripts/dot_ledger/views/payments/projected_balance_graph.js on lines 21..28

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

    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

        clickPeriod: function (event) {
          event.preventDefault();
          this.params.set({
            period: $(event.target).data('period')
          });
    app/assets/javascripts/dot_ledger/views/accounts/balance_graph.js on lines 21..28

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

    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

        save: function () {
          this.update();
          this.model.save({}, {
            success: _.bind(function () {
              this.trigger('save', this.model);
    Severity: Major
    Found in app/assets/javascripts/dot_ledger/views/categories/form.js and 5 other locations - About 2 hrs to fix
    app/assets/javascripts/dot_ledger/views/account_groups/form.js on lines 39..47
    app/assets/javascripts/dot_ledger/views/payments/form.js on lines 110..118
    app/assets/javascripts/dot_ledger/views/saved_searches/form.js on lines 135..143
    app/assets/javascripts/dot_ledger/views/sorted_transactions/form.js on lines 46..54
    app/assets/javascripts/dot_ledger/views/sorting_rules/form.js on lines 57..65

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

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

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

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

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

    Refactorings

    Further Reading

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

        attachHtml: function (collectionView, childView, index) {
          var listID;
          listID = 'category-type-' + (s.underscored(childView.model.get('type')));
          collectionView.$('#' + listID).append(childView.el);
        }
    app/assets/javascripts/dot_ledger/views/categories/list.js on lines 24..28
    app/assets/javascripts/dot_ledger/views/goals/list.js on lines 28..32

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

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

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

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

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

    Refactorings

    Further Reading

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

        attachHtml: function (collectionView, childView, index) {
          var listID;
          listID = 'category-type-' + (s.underscored(childView.model.get('type')));
          collectionView.$('div#' + listID).append(childView.el);
        }
    Severity: Major
    Found in app/assets/javascripts/dot_ledger/views/categories/list.js and 2 other locations - About 2 hrs to fix
    app/assets/javascripts/dot_ledger/views/goals/list.js on lines 28..32
    app/assets/javascripts/dot_ledger/views/reports/income_and_expenses/table.js on lines 58..62

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

    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

        save: function () {
          this.update();
          this.model.save({}, {
            success: _.bind(function () {
              this.trigger('save', this.model);
    app/assets/javascripts/dot_ledger/views/categories/form.js on lines 55..63
    app/assets/javascripts/dot_ledger/views/payments/form.js on lines 110..118
    app/assets/javascripts/dot_ledger/views/saved_searches/form.js on lines 135..143
    app/assets/javascripts/dot_ledger/views/sorted_transactions/form.js on lines 46..54
    app/assets/javascripts/dot_ledger/views/sorting_rules/form.js on lines 57..65

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

    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

        save: function () {
          this.update();
          this.model.save({}, {
            success: _.bind(function () {
              this.trigger('save', this.model);
    app/assets/javascripts/dot_ledger/views/account_groups/form.js on lines 39..47
    app/assets/javascripts/dot_ledger/views/categories/form.js on lines 55..63
    app/assets/javascripts/dot_ledger/views/payments/form.js on lines 110..118
    app/assets/javascripts/dot_ledger/views/saved_searches/form.js on lines 135..143
    app/assets/javascripts/dot_ledger/views/sorted_transactions/form.js on lines 46..54

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

    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

        save: function () {
          this.update();
          this.model.save({}, {
            success: _.bind(function () {
              this.trigger('save', this.model);
    app/assets/javascripts/dot_ledger/views/account_groups/form.js on lines 39..47
    app/assets/javascripts/dot_ledger/views/categories/form.js on lines 55..63
    app/assets/javascripts/dot_ledger/views/payments/form.js on lines 110..118
    app/assets/javascripts/dot_ledger/views/sorted_transactions/form.js on lines 46..54
    app/assets/javascripts/dot_ledger/views/sorting_rules/form.js on lines 57..65

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

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

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

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

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

    Refactorings

    Further Reading

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

        attachHtml: function (collectionView, childView, index) {
          var listID;
          listID = 'category-type-' + (s.underscored(childView.model.get('category_type')));
          collectionView.$('div#' + listID).append(childView.el);
        },
    Severity: Major
    Found in app/assets/javascripts/dot_ledger/views/goals/list.js and 2 other locations - About 2 hrs to fix
    app/assets/javascripts/dot_ledger/views/categories/list.js on lines 24..28
    app/assets/javascripts/dot_ledger/views/reports/income_and_expenses/table.js on lines 58..62

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

    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

        save: function () {
          this.update();
          this.model.save({}, {
            success: _.bind(function () {
              this.trigger('save', this.model);
    Severity: Major
    Found in app/assets/javascripts/dot_ledger/views/payments/form.js and 5 other locations - About 2 hrs to fix
    app/assets/javascripts/dot_ledger/views/account_groups/form.js on lines 39..47
    app/assets/javascripts/dot_ledger/views/categories/form.js on lines 55..63
    app/assets/javascripts/dot_ledger/views/saved_searches/form.js on lines 135..143
    app/assets/javascripts/dot_ledger/views/sorted_transactions/form.js on lines 46..54
    app/assets/javascripts/dot_ledger/views/sorting_rules/form.js on lines 57..65

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

    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

        save: function () {
          this.update();
          this.model.save({}, {
            success: _.bind(function () {
              this.trigger('save', this.model);
    app/assets/javascripts/dot_ledger/views/account_groups/form.js on lines 39..47
    app/assets/javascripts/dot_ledger/views/categories/form.js on lines 55..63
    app/assets/javascripts/dot_ledger/views/payments/form.js on lines 110..118
    app/assets/javascripts/dot_ledger/views/saved_searches/form.js on lines 135..143
    app/assets/javascripts/dot_ledger/views/sorting_rules/form.js on lines 57..65

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

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

        incomeAndExpenses: function () {
          var categoryStatistics, filterView, renderReport, reportView;
          DotLedger.title('Reports', 'Income and Expenses');
          if (!this.QueryParams.has('period')) {
            this.QueryParams.set({
    Severity: Major
    Found in app/assets/javascripts/dot_ledger/routers/app.js - About 2 hrs to fix

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

            categoryTypeStatistics.fetch({
              success: function () {
                var activity;
                activity = new DotLedger.Views.Statistics.ActivityPerCategoryType.List({
                  collection: categoryTypeStatistics
      Severity: Major
      Found in app/assets/javascripts/dot_ledger/routers/app.js and 1 other location - About 2 hrs to fix
      app/assets/javascripts/dot_ledger/routers/app.js on lines 72..80

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

      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