dotledger/dotledger

View on GitHub

Showing 155 of 155 total issues

File app.js has 694 lines of code (exceeds 250 allowed). Consider refactoring.
Open

DotLedger.module('Routers', function () {
  var routes;
  routes = {
    // Root
    '': 'root',
Severity: Major
Found in app/assets/javascripts/dot_ledger/routers/app.js - About 1 day to fix

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

        confirmDelete: function (e) {
          var confirmation;
          e.preventDefault();
    
          confirmation = new DotLedger.Views.Application.ConfirmationModal({
    app/assets/javascripts/dot_ledger/views/categories/list_item.js on lines 17..38

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

    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

        confirmDelete: function (e) {
          var confirmation;
          e.preventDefault();
          confirmation = new DotLedger.Views.Application.ConfirmationModal({
            body: 'Are you sure you want to delete ' + (this.model.get('name')) + '?'
    app/assets/javascripts/dot_ledger/views/sorting_rules/list_item.js on lines 27..49

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

    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

        confirmDelete: function (e) {
          e.preventDefault();
    
          var confirmation = new DotLedger.Views.Application.ConfirmationModal({
            body: 'Are you sure you want to delete ' + (this.model.get('name')) + '?'
    app/assets/javascripts/dot_ledger/views/saved_searches/list_item.js on lines 23..43

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

    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

        confirmDelete: function (e) {
          e.preventDefault();
    
          var confirmation = new DotLedger.Views.Application.ConfirmationModal({
            body: 'Are you sure you want to delete ' + (this.model.get('name')) + '?'
    app/assets/javascripts/dot_ledger/views/account_groups/list_item.js on lines 15..35

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

    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

        templateHelpers: function () {
          return {
            hasTransactions: _.bind(function () {
              return this.collection.length > 0;
            }, this),
    app/assets/javascripts/dot_ledger/views/statistics/activity_per_category/list.js on lines 13..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 198.

    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

        templateHelpers: function () {
          return {
            hasActivity: _.bind(function () {
              return this.collection.length > 0;
            }, this),
    app/assets/javascripts/dot_ledger/views/statistics/activity_per_category_type/list.js on lines 17..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 198.

    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

        renderPeriodFrom: function (data) {
          data = (data || DotLedgerData);
    
          this.ui.period_from.empty();
          this.ui.period_from.append($("<option value=''></option>"));
    app/assets/javascripts/dot_ledger/views/saved_searches/form.js on lines 77..88

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

    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

        renderPeriodTo: function (data) {
          data = (data || DotLedgerData);
    
          this.ui.period_to.empty();
          this.ui.period_to.append($("<option value=''></option>"));
    app/assets/javascripts/dot_ledger/views/saved_searches/form.js on lines 64..75

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

    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

        editAccountGroup: function (accountGroupID) {
          var accountGroup, form;
          accountGroup = new DotLedger.Models.AccountGroup({
            id: accountGroupID
          });
    Severity: Major
    Found in app/assets/javascripts/dot_ledger/routers/app.js and 2 other locations - About 6 hrs to fix
    app/assets/javascripts/dot_ledger/routers/app.js on lines 554..573
    app/assets/javascripts/dot_ledger/routers/app.js on lines 656..675

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

    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

        editPayment: function (paymentID) {
          var form, payment;
          payment = new DotLedger.Models.Payment({
            id: paymentID
          });
    Severity: Major
    Found in app/assets/javascripts/dot_ledger/routers/app.js and 2 other locations - About 6 hrs to fix
    app/assets/javascripts/dot_ledger/routers/app.js on lines 605..624
    app/assets/javascripts/dot_ledger/routers/app.js on lines 656..675

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

    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

        editSavedSearch: function (savedSearchID) {
          var savedSearch, form;
          savedSearch = new DotLedger.Models.SavedSearch({
            id: savedSearchID
          });
    Severity: Major
    Found in app/assets/javascripts/dot_ledger/routers/app.js and 2 other locations - About 6 hrs to fix
    app/assets/javascripts/dot_ledger/routers/app.js on lines 554..573
    app/assets/javascripts/dot_ledger/routers/app.js on lines 605..624

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

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

        renderGoalTypes: function (data) {
          data = (data || DotLedgerData);
    
          this.ui.type.empty();
          _.each(data.goal_types, _.bind(function (option) {
    Severity: Major
    Found in app/assets/javascripts/dot_ledger/views/goals/list_item.js and 5 other locations - About 5 hrs to fix
    app/assets/javascripts/dot_ledger/views/accounts/form.js on lines 27..37
    app/assets/javascripts/dot_ledger/views/categories/form.js on lines 17..27
    app/assets/javascripts/dot_ledger/views/goals/list_item.js on lines 39..49
    app/assets/javascripts/dot_ledger/views/payments/form.js on lines 41..51
    app/assets/javascripts/dot_ledger/views/payments/form.js on lines 53..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 153.

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

        renderCategoryTypes: function (data) {
          data = (data || DotLedgerData);
    
          this.ui.type.empty();
          _.each(data.category_types, _.bind(function (option) {
    Severity: Major
    Found in app/assets/javascripts/dot_ledger/views/categories/form.js and 5 other locations - About 5 hrs to fix
    app/assets/javascripts/dot_ledger/views/accounts/form.js on lines 27..37
    app/assets/javascripts/dot_ledger/views/goals/list_item.js on lines 27..37
    app/assets/javascripts/dot_ledger/views/goals/list_item.js on lines 39..49
    app/assets/javascripts/dot_ledger/views/payments/form.js on lines 41..51
    app/assets/javascripts/dot_ledger/views/payments/form.js on lines 53..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 153.

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

        renderAccountTypes: function (data) {
          data = (data || DotLedgerData);
    
          this.ui.type.empty();
          _.each(data.account_types, _.bind(function (option) {
    Severity: Major
    Found in app/assets/javascripts/dot_ledger/views/accounts/form.js and 5 other locations - About 5 hrs to fix
    app/assets/javascripts/dot_ledger/views/categories/form.js on lines 17..27
    app/assets/javascripts/dot_ledger/views/goals/list_item.js on lines 27..37
    app/assets/javascripts/dot_ledger/views/goals/list_item.js on lines 39..49
    app/assets/javascripts/dot_ledger/views/payments/form.js on lines 41..51
    app/assets/javascripts/dot_ledger/views/payments/form.js on lines 53..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 153.

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

        renderGoalPeriods: function (data) {
          data = (data || DotLedgerData);
    
          this.ui.period.empty();
          _.each(data.goal_periods, _.bind(function (option) {
    Severity: Major
    Found in app/assets/javascripts/dot_ledger/views/goals/list_item.js and 5 other locations - About 5 hrs to fix
    app/assets/javascripts/dot_ledger/views/accounts/form.js on lines 27..37
    app/assets/javascripts/dot_ledger/views/categories/form.js on lines 17..27
    app/assets/javascripts/dot_ledger/views/goals/list_item.js on lines 27..37
    app/assets/javascripts/dot_ledger/views/payments/form.js on lines 41..51
    app/assets/javascripts/dot_ledger/views/payments/form.js on lines 53..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 153.

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

        renderPaymentPeriods: function (data) {
          data = (data || DotLedgerData);
    
          this.ui.repeat_period.empty();
    
    
    Severity: Major
    Found in app/assets/javascripts/dot_ledger/views/payments/form.js and 5 other locations - About 5 hrs to fix
    app/assets/javascripts/dot_ledger/views/accounts/form.js on lines 27..37
    app/assets/javascripts/dot_ledger/views/categories/form.js on lines 17..27
    app/assets/javascripts/dot_ledger/views/goals/list_item.js on lines 27..37
    app/assets/javascripts/dot_ledger/views/goals/list_item.js on lines 39..49
    app/assets/javascripts/dot_ledger/views/payments/form.js on lines 41..51

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

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

        renderPaymentTypes: function (data) {
          data = (data || DotLedgerData);
    
          this.ui.type.empty();
          _.each(data.payment_types, _.bind(function (option) {
    Severity: Major
    Found in app/assets/javascripts/dot_ledger/views/payments/form.js and 5 other locations - About 5 hrs to fix
    app/assets/javascripts/dot_ledger/views/accounts/form.js on lines 27..37
    app/assets/javascripts/dot_ledger/views/categories/form.js on lines 17..27
    app/assets/javascripts/dot_ledger/views/goals/list_item.js on lines 27..37
    app/assets/javascripts/dot_ledger/views/goals/list_item.js on lines 39..49
    app/assets/javascripts/dot_ledger/views/payments/form.js on lines 53..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 153.

    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

            receivedAmountSubTotal: _.bind(function (label) {
              var amount;
              amount = this.collection.chain().select(function (row) {
                return row.get('type') === label;
              }).map(function (row) {
    app/assets/javascripts/dot_ledger/views/reports/income_and_expenses/table.js on lines 23..33

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

    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

            spentAmountSubTotal: _.bind(function (label) {
              var amount;
              amount = this.collection.chain().select(function (row) {
                return row.get('type') === label;
              }).map(function (row) {
    app/assets/javascripts/dot_ledger/views/reports/income_and_expenses/table.js on lines 34..44

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

    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