bitovi/canjs

View on GitHub

Showing 380 of 460 total issues

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

class TodosApp extends StacheElement {
  static view = `
    <h1>Today’s to-dos</h1>
  `;

Severity: Major
Found in docs/can-guides/experiment/crud-beginner/4.js and 2 other locations - About 40 mins to fix
docs/can-guides/experiment/crud-beginner/5.js on lines 9..28
docs/can-guides/experiment/crud-beginner/6.js on lines 9..34

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

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

    get expiry() {
      return this.userExpiry.map(expiry => {
        if (expiry) {
          return expiry.split("-");
        }
docs/can-guides/commitment/recipes/credit-card-advanced/5-expiry.js on lines 81..87
docs/can-guides/commitment/recipes/credit-card-advanced/6-cvc.js on lines 100..106
docs/can-guides/commitment/recipes/credit-card-advanced/8-pay-button.js on lines 108..114
docs/can-guides/commitment/recipes/credit-card-advanced/9-disable-payments.js on lines 108..114

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

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

        get expiry() {
            return this.userExpiry.map(expiry => {
                if (expiry) {
                    return expiry.split("-");
                }
docs/can-guides/commitment/recipes/credit-card-advanced/5-expiry.js on lines 81..87
docs/can-guides/commitment/recipes/credit-card-advanced/6-cvc.js on lines 100..106
docs/can-guides/commitment/recipes/credit-card-advanced/7-disable-pay.js on lines 102..108
docs/can-guides/commitment/recipes/credit-card-advanced/8-pay-button.js on lines 108..114

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

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

    get expiry() {
      return this.userExpiry.map(expiry => {
        if (expiry) {
          return expiry.split("-");
        }
docs/can-guides/commitment/recipes/credit-card-advanced/5-expiry.js on lines 81..87
docs/can-guides/commitment/recipes/credit-card-advanced/7-disable-pay.js on lines 102..108
docs/can-guides/commitment/recipes/credit-card-advanced/8-pay-button.js on lines 108..114
docs/can-guides/commitment/recipes/credit-card-advanced/9-disable-payments.js on lines 108..114

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

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

class TodosApp extends StacheElement {
  static view = `
    <h1>Today’s to-dos</h1>
    {{# if(this.todosPromise.isPending) }}
      Loading todos…
Severity: Major
Found in docs/can-guides/experiment/crud-beginner/6.js and 2 other locations - About 40 mins to fix
docs/can-guides/experiment/crud-beginner/4.js on lines 9..19
docs/can-guides/experiment/crud-beginner/5.js on lines 9..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 49.

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

    get expiry() {
      return this.userExpiry.map(expiry => {
        if (expiry) {
          return expiry.split("-");
        }
docs/can-guides/commitment/recipes/credit-card-advanced/5-expiry.js on lines 81..87
docs/can-guides/commitment/recipes/credit-card-advanced/6-cvc.js on lines 100..106
docs/can-guides/commitment/recipes/credit-card-advanced/7-disable-pay.js on lines 102..108
docs/can-guides/commitment/recipes/credit-card-advanced/9-disable-payments.js on lines 108..114

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

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

        get cardNumber() {
            return this.userCardNumber.map(card => {
                if (card) {
                    return card.replace(/[\s-]/g, "");
                }
docs/can-guides/commitment/recipes/credit-card-advanced/2-read-card.js on lines 33..39
docs/can-guides/commitment/recipes/credit-card-advanced/3-card-error.js on lines 32..38
docs/can-guides/commitment/recipes/credit-card-advanced/4-card-blur.js on lines 42..48
docs/can-guides/commitment/recipes/credit-card-advanced/5-expiry.js on lines 61..67
docs/can-guides/commitment/recipes/credit-card-advanced/6-cvc.js on lines 80..86
docs/can-guides/commitment/recipes/credit-card-advanced/7-disable-pay.js on lines 82..88
docs/can-guides/commitment/recipes/credit-card-advanced/8-pay-button.js on lines 88..94

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

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

    get cardNumber() {
      return this.userCardNumber.map(card => {
        if (card) {
          return card.replace(/[\s-]/g, "");
        }
docs/can-guides/commitment/recipes/credit-card-advanced/2-read-card.js on lines 33..39
docs/can-guides/commitment/recipes/credit-card-advanced/3-card-error.js on lines 32..38
docs/can-guides/commitment/recipes/credit-card-advanced/4-card-blur.js on lines 42..48
docs/can-guides/commitment/recipes/credit-card-advanced/5-expiry.js on lines 61..67
docs/can-guides/commitment/recipes/credit-card-advanced/6-cvc.js on lines 80..86
docs/can-guides/commitment/recipes/credit-card-advanced/7-disable-pay.js on lines 82..88
docs/can-guides/commitment/recipes/credit-card-advanced/9-disable-payments.js on lines 88..94

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

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

    get cardNumber() {
      return this.userCardNumber.map(card => {
        if (card) {
          return card.replace(/[\s-]/g, "");
        }
docs/can-guides/commitment/recipes/credit-card-advanced/3-card-error.js on lines 32..38
docs/can-guides/commitment/recipes/credit-card-advanced/4-card-blur.js on lines 42..48
docs/can-guides/commitment/recipes/credit-card-advanced/5-expiry.js on lines 61..67
docs/can-guides/commitment/recipes/credit-card-advanced/6-cvc.js on lines 80..86
docs/can-guides/commitment/recipes/credit-card-advanced/7-disable-pay.js on lines 82..88
docs/can-guides/commitment/recipes/credit-card-advanced/8-pay-button.js on lines 88..94
docs/can-guides/commitment/recipes/credit-card-advanced/9-disable-payments.js on lines 88..94

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

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

connection.get({id: 5}).then((result) => {
    console.log(`Fetched A Todo: `, result);
});
Severity: Minor
Found in docs/can-guides/topics/data/customizing-connections/combine.js and 2 other locations - About 40 mins to fix
docs/can-guides/topics/data/customizing-connections/chain.js on lines 24..26
docs/can-guides/topics/data/customizing-connections/consume.js on lines 41..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 48.

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

connection.get({id: 5}).then((result) => {
    console.log(`Fetched A Todo: `, result);
});
Severity: Minor
Found in docs/can-guides/topics/data/customizing-connections/consume.js and 2 other locations - About 40 mins to fix
docs/can-guides/topics/data/customizing-connections/chain.js on lines 24..26
docs/can-guides/topics/data/customizing-connections/combine.js on lines 34..36

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

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

    get cardNumber() {
      return this.userCardNumber.map(card => {
        if (card) {
          return card.replace(/[\s-]/g, "");
        }
docs/can-guides/commitment/recipes/credit-card-advanced/2-read-card.js on lines 33..39
docs/can-guides/commitment/recipes/credit-card-advanced/3-card-error.js on lines 32..38
docs/can-guides/commitment/recipes/credit-card-advanced/5-expiry.js on lines 61..67
docs/can-guides/commitment/recipes/credit-card-advanced/6-cvc.js on lines 80..86
docs/can-guides/commitment/recipes/credit-card-advanced/7-disable-pay.js on lines 82..88
docs/can-guides/commitment/recipes/credit-card-advanced/8-pay-button.js on lines 88..94
docs/can-guides/commitment/recipes/credit-card-advanced/9-disable-payments.js on lines 88..94

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

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

    get cardNumber() {
      return this.userCardNumber.map(card => {
        if (card) {
          return card.replace(/[\s-]/g, "");
        }
docs/can-guides/commitment/recipes/credit-card-advanced/2-read-card.js on lines 33..39
docs/can-guides/commitment/recipes/credit-card-advanced/3-card-error.js on lines 32..38
docs/can-guides/commitment/recipes/credit-card-advanced/4-card-blur.js on lines 42..48
docs/can-guides/commitment/recipes/credit-card-advanced/5-expiry.js on lines 61..67
docs/can-guides/commitment/recipes/credit-card-advanced/7-disable-pay.js on lines 82..88
docs/can-guides/commitment/recipes/credit-card-advanced/8-pay-button.js on lines 88..94
docs/can-guides/commitment/recipes/credit-card-advanced/9-disable-payments.js on lines 88..94

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

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

    get cardNumber() {
      return this.userCardNumber.map(card => {
        if (card) {
          return card.replace(/[\s-]/g, "");
        }
docs/can-guides/commitment/recipes/credit-card-advanced/2-read-card.js on lines 33..39
docs/can-guides/commitment/recipes/credit-card-advanced/3-card-error.js on lines 32..38
docs/can-guides/commitment/recipes/credit-card-advanced/4-card-blur.js on lines 42..48
docs/can-guides/commitment/recipes/credit-card-advanced/6-cvc.js on lines 80..86
docs/can-guides/commitment/recipes/credit-card-advanced/7-disable-pay.js on lines 82..88
docs/can-guides/commitment/recipes/credit-card-advanced/8-pay-button.js on lines 88..94
docs/can-guides/commitment/recipes/credit-card-advanced/9-disable-payments.js on lines 88..94

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

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

    get cardNumber() {
      return this.userCardNumber.map(card => {
        if (card) {
          return card.replace(/[\s-]/g, "");
        }
docs/can-guides/commitment/recipes/credit-card-advanced/2-read-card.js on lines 33..39
docs/can-guides/commitment/recipes/credit-card-advanced/3-card-error.js on lines 32..38
docs/can-guides/commitment/recipes/credit-card-advanced/4-card-blur.js on lines 42..48
docs/can-guides/commitment/recipes/credit-card-advanced/5-expiry.js on lines 61..67
docs/can-guides/commitment/recipes/credit-card-advanced/6-cvc.js on lines 80..86
docs/can-guides/commitment/recipes/credit-card-advanced/8-pay-button.js on lines 88..94
docs/can-guides/commitment/recipes/credit-card-advanced/9-disable-payments.js on lines 88..94

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

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

    get cardNumber() {
      return this.userCardNumber.map(card => {
        if (card) {
          return card.replace(/[\s-]/g, "");
        }
docs/can-guides/commitment/recipes/credit-card-advanced/2-read-card.js on lines 33..39
docs/can-guides/commitment/recipes/credit-card-advanced/4-card-blur.js on lines 42..48
docs/can-guides/commitment/recipes/credit-card-advanced/5-expiry.js on lines 61..67
docs/can-guides/commitment/recipes/credit-card-advanced/6-cvc.js on lines 80..86
docs/can-guides/commitment/recipes/credit-card-advanced/7-disable-pay.js on lines 82..88
docs/can-guides/commitment/recipes/credit-card-advanced/8-pay-button.js on lines 88..94
docs/can-guides/commitment/recipes/credit-card-advanced/9-disable-payments.js on lines 88..94

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

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

connection.getData({id: 5}).then((result) => {
    console.log(`Fetched Todo JSON: `, result);
});
Severity: Minor
Found in docs/can-guides/topics/data/customizing-connections/chain.js and 2 other locations - About 40 mins to fix
docs/can-guides/topics/data/customizing-connections/combine.js on lines 34..36
docs/can-guides/topics/data/customizing-connections/consume.js on lines 41..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 48.

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

  updateCompleteTo(value) {
    this.forEach(function(todo) {
      todo.complete = value;
      todo.save();
    });
docs/can-guides/commitment/recipes/todomvc-with-steal/15-setter-toggle/todo.js on lines 51..56
docs/can-guides/experiment/todomvc/9-toggle/js.js on lines 46..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 47.

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

  updateCompleteTo(value) {
    this.forEach(function(todo) {
      todo.complete = value;
      todo.save();
    });
docs/can-guides/commitment/recipes/todomvc-with-steal/16-clear-all-completed/todo.js on lines 51..56
docs/can-guides/experiment/todomvc/9-toggle/js.js on lines 46..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 47.

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

  updateCompleteTo(value) {
    this.forEach(function(todo) {
      todo.complete = value;
      todo.save();
    });
Severity: Minor
Found in docs/can-guides/experiment/todomvc/9-toggle/js.js and 2 other locations - About 35 mins to fix
docs/can-guides/commitment/recipes/todomvc-with-steal/15-setter-toggle/todo.js on lines 51..56
docs/can-guides/commitment/recipes/todomvc-with-steal/16-clear-all-completed/todo.js on lines 51..56

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

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