dotledger/dotledger

View on GitHub

Showing 155 of 155 total issues

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

DotLedger.module('Collections', function () {
  this.Goals = this.Base.extend({
    url: '/api/goals',

    model: DotLedger.Models.Goal
Severity: Major
Found in app/assets/javascripts/dot_ledger/collections/goals.js and 11 other locations - About 1 hr to fix
app/assets/javascripts/dot_ledger/collections/account_groups.js on lines 1..7
app/assets/javascripts/dot_ledger/collections/accounts.js on lines 1..7
app/assets/javascripts/dot_ledger/collections/balances.js on lines 1..7
app/assets/javascripts/dot_ledger/collections/categories.js on lines 1..7
app/assets/javascripts/dot_ledger/collections/payments.js on lines 1..7
app/assets/javascripts/dot_ledger/collections/projected_balances.js on lines 1..7
app/assets/javascripts/dot_ledger/collections/saved_searches.js on lines 1..7
app/assets/javascripts/dot_ledger/collections/sorting_rules.js on lines 1..7
app/assets/javascripts/dot_ledger/collections/statements.js on lines 1..7
app/assets/javascripts/dot_ledger/collections/tags.js on lines 1..7
app/assets/javascripts/dot_ledger/collections/transactions.js on lines 1..7

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

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

DotLedger.module('Collections', function () {
  this.AccountGroups = this.Base.extend({
    url: '/api/account_groups',

    model: DotLedger.Models.AccountGroup
app/assets/javascripts/dot_ledger/collections/accounts.js on lines 1..7
app/assets/javascripts/dot_ledger/collections/balances.js on lines 1..7
app/assets/javascripts/dot_ledger/collections/categories.js on lines 1..7
app/assets/javascripts/dot_ledger/collections/goals.js on lines 1..7
app/assets/javascripts/dot_ledger/collections/payments.js on lines 1..7
app/assets/javascripts/dot_ledger/collections/projected_balances.js on lines 1..7
app/assets/javascripts/dot_ledger/collections/saved_searches.js on lines 1..7
app/assets/javascripts/dot_ledger/collections/sorting_rules.js on lines 1..7
app/assets/javascripts/dot_ledger/collections/statements.js on lines 1..7
app/assets/javascripts/dot_ledger/collections/tags.js on lines 1..7
app/assets/javascripts/dot_ledger/collections/transactions.js on lines 1..7

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

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

DotLedger.module('Collections', function () {
  this.ProjectedBalances = this.Base.extend({
    url: '/api/balances/projected',

    model: DotLedger.Models.Balance
app/assets/javascripts/dot_ledger/collections/account_groups.js on lines 1..7
app/assets/javascripts/dot_ledger/collections/accounts.js on lines 1..7
app/assets/javascripts/dot_ledger/collections/balances.js on lines 1..7
app/assets/javascripts/dot_ledger/collections/categories.js on lines 1..7
app/assets/javascripts/dot_ledger/collections/goals.js on lines 1..7
app/assets/javascripts/dot_ledger/collections/payments.js on lines 1..7
app/assets/javascripts/dot_ledger/collections/saved_searches.js on lines 1..7
app/assets/javascripts/dot_ledger/collections/sorting_rules.js on lines 1..7
app/assets/javascripts/dot_ledger/collections/statements.js on lines 1..7
app/assets/javascripts/dot_ledger/collections/tags.js on lines 1..7
app/assets/javascripts/dot_ledger/collections/transactions.js on lines 1..7

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

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

    onRender: function () {
      this.formErrors = new DotLedger.Helpers.FormErrors(this.model, this.$el);
      DotLedger.on('options:change', this.renderPeriodFrom, this);
      DotLedger.on('options:change', this.renderPeriodTo, this);
      this.ui.review.append('<option value="">Any</option>');
Severity: Minor
Found in app/assets/javascripts/dot_ledger/views/saved_searches/form.js - About 1 hr to fix

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

    DotLedger.module('Collections', function () {
      this.Categories = this.Base.extend({
        url: '/api/categories',
    
        model: DotLedger.Models.Category
    app/assets/javascripts/dot_ledger/collections/account_groups.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/accounts.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/balances.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/goals.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/payments.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/projected_balances.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/saved_searches.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/sorting_rules.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/statements.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/tags.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/transactions.js on lines 1..7

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

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

    DotLedger.module('Collections', function () {
      this.SavedSearches = this.Base.extend({
        url: '/api/saved_searches',
    
        model: DotLedger.Models.SavedSearch
    app/assets/javascripts/dot_ledger/collections/account_groups.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/accounts.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/balances.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/categories.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/goals.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/payments.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/projected_balances.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/sorting_rules.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/statements.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/tags.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/transactions.js on lines 1..7

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

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

    DotLedger.module('Collections', function () {
      this.Transactions = this.Base.extend({
        url: '/api/transactions',
    
        model: DotLedger.Models.Transaction
    app/assets/javascripts/dot_ledger/collections/account_groups.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/accounts.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/balances.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/categories.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/goals.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/payments.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/projected_balances.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/saved_searches.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/sorting_rules.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/statements.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/tags.js on lines 1..7

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

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

    DotLedger.module('Collections', function () {
      this.Payments = this.Base.extend({
        url: '/api/payments',
    
        model: DotLedger.Models.Payment
    Severity: Major
    Found in app/assets/javascripts/dot_ledger/collections/payments.js and 11 other locations - About 1 hr to fix
    app/assets/javascripts/dot_ledger/collections/account_groups.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/accounts.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/balances.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/categories.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/goals.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/projected_balances.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/saved_searches.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/sorting_rules.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/statements.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/tags.js on lines 1..7
    app/assets/javascripts/dot_ledger/collections/transactions.js on lines 1..7

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

    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

          form.on('save', function (model) {
            DotLedger.navigate.listSortingRules({}, {
              trigger: true
            });
            DotLedger.Helpers.SortTransactions.sort();
    Severity: Major
    Found in app/assets/javascripts/dot_ledger/routers/app.js and 1 other location - About 1 hr to fix
    app/assets/javascripts/dot_ledger/routers/app.js on lines 479..484

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

    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

            disableNext: _.bind(function () {
              if (this.collection.pagination && (this.collection.pagination.next_page == null)) {
                return 'disabled';
              }
            }, this)
    app/assets/javascripts/dot_ledger/views/application/pagination.js on lines 29..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 57.

    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

            disablePrevious: _.bind(function () {
              if (this.collection.pagination && (this.collection.pagination.previous_page == null)) {
                return 'disabled';
              }
            }, this),
    app/assets/javascripts/dot_ledger/views/application/pagination.js on lines 34..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 57.

    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 index has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        def index
          @transactions = Transaction.includes(sorted_transaction: :category)
    
          @transactions = @transactions.where(account_id: account_id) if account_id.present?
    
    
    Severity: Minor
    Found in app/controllers/api/transactions_controller.rb - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function listSortingRules has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        listSortingRules: function () {
          var list, sortingRules, updateSortingRules;
          if (!this.QueryParams.has('page')) {
            this.QueryParams.set({
              page: 1
    Severity: Minor
    Found in app/assets/javascripts/dot_ledger/routers/app.js - About 1 hr to fix

      Function listPayments has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          listPayments: function () {
            var balanceGraph, list, payments, paymentsView;
            this.QueryParams.on('change', _.bind(function () {
              DotLedger.navigate.listPayments(this.QueryParams.attributes, {
                replace: true
      Severity: Minor
      Found in app/assets/javascripts/dot_ledger/routers/app.js - About 1 hr to fix

        Function balanceGraphOptions has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            balanceGraphOptions: function () {
              return {
                series: {
                  shadowSize: 1,
                  lines: {

          Function balanceGraphOptions has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              balanceGraphOptions: function () {
                return {
                  series: {
                    shadowSize: 1,
                    lines: {
          Severity: Minor
          Found in app/assets/javascripts/dot_ledger/views/accounts/balance_graph.js - About 1 hr to fix

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

            DotLedger.module('Views.Transactions', function () {
              this.Details = Backbone.Marionette.ItemView.extend({
                template: 'transactions/details',
            
                className: 'modal'
            app/assets/javascripts/dot_ledger/views/statements/list_item.js on lines 1..7

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

            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.ui.repeat.prop('checked')) {
                    this.ui.repeat_period.parents('.form-group').show();
                    this.ui.repeat_interval.parents('.form-group').show();
                  } else {
            Severity: Major
            Found in app/assets/javascripts/dot_ledger/views/payments/form.js and 1 other location - About 1 hr to fix
            app/assets/javascripts/dot_ledger/views/payments/form.js on lines 89..92

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

            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

            DotLedger.module('Views.Statements', function () {
              this.ListItem = Backbone.Marionette.ItemView.extend({
                tagName: 'tr',
            
                template: 'statements/list_item'
            app/assets/javascripts/dot_ledger/views/transactions/details.js on lines 1..7

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

            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

                  } else {
                    this.ui.repeat_period.parents('.form-group').hide();
                    this.ui.repeat_interval.parents('.form-group').hide();
                  }
            Severity: Major
            Found in app/assets/javascripts/dot_ledger/views/payments/form.js and 1 other location - About 1 hr to fix
            app/assets/javascripts/dot_ledger/views/payments/form.js on lines 86..89

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

            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