bitovi/canjs

View on GitHub

Showing 460 of 460 total issues

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

QUnit.asyncTest("Deposit", 6, function() {

    var card = new Card({
        number: "0123456789",
        pin: "1122"
Severity: Major
Found in docs/can-guides/experiment/atm/4-deposit-test/js.js and 7 other locations - About 1 day to fix
docs/can-guides/experiment/atm/10-deposit-info/js.js on lines 339..379
docs/can-guides/experiment/atm/13-printing/js.js on lines 355..395
docs/can-guides/experiment/atm/5-transactions-models/js.js on lines 256..296
docs/can-guides/experiment/atm/6-reading-card/js.js on lines 271..311
docs/can-guides/experiment/atm/7-reading-pin/js.js on lines 294..334
docs/can-guides/experiment/atm/8-choosing-transaction/js.js on lines 321..361
docs/can-guides/experiment/atm/9-picking-account/js.js on lines 332..372

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

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

QUnit.asyncTest("Deposit", 6, function() {

    var card = new Card({
        number: "0123456789",
        pin: "1122"
Severity: Major
Found in docs/can-guides/experiment/atm/13-printing/js.js and 7 other locations - About 1 day to fix
docs/can-guides/experiment/atm/10-deposit-info/js.js on lines 339..379
docs/can-guides/experiment/atm/4-deposit-test/js.js on lines 111..151
docs/can-guides/experiment/atm/5-transactions-models/js.js on lines 256..296
docs/can-guides/experiment/atm/6-reading-card/js.js on lines 271..311
docs/can-guides/experiment/atm/7-reading-pin/js.js on lines 294..334
docs/can-guides/experiment/atm/8-choosing-transaction/js.js on lines 321..361
docs/can-guides/experiment/atm/9-picking-account/js.js on lines 332..372

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

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

QUnit.asyncTest("Deposit", 6, function() {

    var card = new Card({
        number: "0123456789",
        pin: "1122"
Severity: Major
Found in docs/can-guides/experiment/atm/6-reading-card/js.js and 7 other locations - About 1 day to fix
docs/can-guides/experiment/atm/10-deposit-info/js.js on lines 339..379
docs/can-guides/experiment/atm/13-printing/js.js on lines 355..395
docs/can-guides/experiment/atm/4-deposit-test/js.js on lines 111..151
docs/can-guides/experiment/atm/5-transactions-models/js.js on lines 256..296
docs/can-guides/experiment/atm/7-reading-pin/js.js on lines 294..334
docs/can-guides/experiment/atm/8-choosing-transaction/js.js on lines 321..361
docs/can-guides/experiment/atm/9-picking-account/js.js on lines 332..372

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

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

QUnit.asyncTest("Deposit", 6, function() {

    var card = new Card({
        number: "0123456789",
        pin: "1122"
Severity: Major
Found in docs/can-guides/experiment/atm/8-choosing-transaction/js.js and 7 other locations - About 1 day to fix
docs/can-guides/experiment/atm/10-deposit-info/js.js on lines 339..379
docs/can-guides/experiment/atm/13-printing/js.js on lines 355..395
docs/can-guides/experiment/atm/4-deposit-test/js.js on lines 111..151
docs/can-guides/experiment/atm/5-transactions-models/js.js on lines 256..296
docs/can-guides/experiment/atm/6-reading-card/js.js on lines 271..311
docs/can-guides/experiment/atm/7-reading-pin/js.js on lines 294..334
docs/can-guides/experiment/atm/9-picking-account/js.js on lines 332..372

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

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

QUnit.asyncTest("Deposit", 6, function() {

    var card = new Card({
        number: "0123456789",
        pin: "1122"
Severity: Major
Found in docs/can-guides/experiment/atm/5-transactions-models/js.js and 7 other locations - About 1 day to fix
docs/can-guides/experiment/atm/10-deposit-info/js.js on lines 339..379
docs/can-guides/experiment/atm/13-printing/js.js on lines 355..395
docs/can-guides/experiment/atm/4-deposit-test/js.js on lines 111..151
docs/can-guides/experiment/atm/6-reading-card/js.js on lines 271..311
docs/can-guides/experiment/atm/7-reading-pin/js.js on lines 294..334
docs/can-guides/experiment/atm/8-choosing-transaction/js.js on lines 321..361
docs/can-guides/experiment/atm/9-picking-account/js.js on lines 332..372

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

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

QUnit.asyncTest("Deposit", 6, function() {

    var card = new Card({
        number: "0123456789",
        pin: "1122"
Severity: Major
Found in docs/can-guides/experiment/atm/7-reading-pin/js.js and 7 other locations - About 1 day to fix
docs/can-guides/experiment/atm/10-deposit-info/js.js on lines 339..379
docs/can-guides/experiment/atm/13-printing/js.js on lines 355..395
docs/can-guides/experiment/atm/4-deposit-test/js.js on lines 111..151
docs/can-guides/experiment/atm/5-transactions-models/js.js on lines 256..296
docs/can-guides/experiment/atm/6-reading-card/js.js on lines 271..311
docs/can-guides/experiment/atm/8-choosing-transaction/js.js on lines 321..361
docs/can-guides/experiment/atm/9-picking-account/js.js on lines 332..372

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

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

    fireEventForDropPosition: function(ev, drop, drag, eventName) {
        const dragData = domData.get(drag.element[0], "dragData");

        const sortables = $(this.element).children();

docs/can-guides/commitment/recipes/playlist-editor/7-revert.js on lines 30..63

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

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

    fireEventForDropPosition: function(ev, drop, drag, eventName) {
        const dragData = domData.get(drag.element[0], "dragData");

        const sortables = $(this.element).children();

docs/can-guides/commitment/recipes/playlist-editor/6-order.js on lines 21..54

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 269.

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

class BusTracker extends StacheElement {
  static view = `
    <div class="top">
      <div class="header">
        <h1>{{this.title}}</h1>
docs/can-guides/commitment/recipes/cta-bus-map/4-init-gmaps.js on lines 32..94
docs/can-guides/commitment/recipes/cta-bus-map/5-set-markers.js on lines 50..112
docs/can-guides/commitment/recipes/cta-bus-map/6-clean-markers.js on lines 53..115

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

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

class BusTracker extends StacheElement {
  static view = `
    <div class="top">
      <div class="header">
        <h1>{{this.title}}</h1>
docs/can-guides/commitment/recipes/cta-bus-map/3b-bus-loading.js on lines 9..71
docs/can-guides/commitment/recipes/cta-bus-map/4-init-gmaps.js on lines 32..94
docs/can-guides/commitment/recipes/cta-bus-map/6-clean-markers.js on lines 53..115

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

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

class BusTracker extends StacheElement {
  static view = `
    <div class="top">
      <div class="header">
        <h1>{{this.title}}</h1>
docs/can-guides/commitment/recipes/cta-bus-map/3b-bus-loading.js on lines 9..71
docs/can-guides/commitment/recipes/cta-bus-map/4-init-gmaps.js on lines 32..94
docs/can-guides/commitment/recipes/cta-bus-map/5-set-markers.js on lines 50..112

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

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

class BusTracker extends StacheElement {
  static view = `
    <div class="top">
      <div class="header">
        <h1>{{this.title}}</h1>
docs/can-guides/commitment/recipes/cta-bus-map/3b-bus-loading.js on lines 9..71
docs/can-guides/commitment/recipes/cta-bus-map/5-set-markers.js on lines 50..112
docs/can-guides/commitment/recipes/cta-bus-map/6-clean-markers.js on lines 53..115

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

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

    static props = {
        googleApiLoadedPromise: {
            get default() {
                return googleApiLoadedPromise;
            }
docs/can-guides/commitment/recipes/playlist-editor/4-drag.js on lines 39..82

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

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

    static props = {
        googleApiLoadedPromise: {
            get default() {
                return googleApiLoadedPromise;
            }
Severity: Major
Found in docs/can-guides/commitment/recipes/playlist-editor/4-drag.js and 1 other location - About 1 day to fix
docs/can-guides/commitment/recipes/playlist-editor/3-search.js on lines 37..80

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 249.

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

const makeEntities = function(parentId, depth) {
  if (depth > 5) {
    return [];
  }
  // The number of entities to create.
docs/can-guides/commitment/recipes/file-navigator/file-navigator-advanced-3.js on lines 8..41
docs/can-guides/commitment/recipes/file-navigator/file-navigator-advanced-4.js on lines 12..45
docs/can-guides/commitment/recipes/file-navigator/file-navigator-advanced-5.js on lines 13..46
docs/can-guides/commitment/recipes/file-navigator/file-navigator-advanced-6.js on lines 13..46
docs/can-guides/commitment/recipes/file-navigator/file-navigator-advanced-7.js on lines 13..46

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

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

const makeEntities = function(parentId, depth) {
  if (depth > 5) {
    return [];
  }
  // The number of entities to create.
docs/can-guides/commitment/recipes/file-navigator/file-navigator-advanced-2.js on lines 8..41
docs/can-guides/commitment/recipes/file-navigator/file-navigator-advanced-3.js on lines 8..41
docs/can-guides/commitment/recipes/file-navigator/file-navigator-advanced-4.js on lines 12..45
docs/can-guides/commitment/recipes/file-navigator/file-navigator-advanced-5.js on lines 13..46
docs/can-guides/commitment/recipes/file-navigator/file-navigator-advanced-6.js on lines 13..46

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

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

const makeEntities = function(parentId, depth) {
  if (depth > 5) {
    return [];
  }
  // The number of entities to create.
docs/can-guides/commitment/recipes/file-navigator/file-navigator-advanced-2.js on lines 8..41
docs/can-guides/commitment/recipes/file-navigator/file-navigator-advanced-4.js on lines 12..45
docs/can-guides/commitment/recipes/file-navigator/file-navigator-advanced-5.js on lines 13..46
docs/can-guides/commitment/recipes/file-navigator/file-navigator-advanced-6.js on lines 13..46
docs/can-guides/commitment/recipes/file-navigator/file-navigator-advanced-7.js on lines 13..46

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

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

const makeEntities = function(parentId, depth) {
  if (depth > 5) {
    return [];
  }
  // The number of entities to create.
docs/can-guides/commitment/recipes/file-navigator/file-navigator-advanced-2.js on lines 8..41
docs/can-guides/commitment/recipes/file-navigator/file-navigator-advanced-3.js on lines 8..41
docs/can-guides/commitment/recipes/file-navigator/file-navigator-advanced-4.js on lines 12..45
docs/can-guides/commitment/recipes/file-navigator/file-navigator-advanced-5.js on lines 13..46
docs/can-guides/commitment/recipes/file-navigator/file-navigator-advanced-7.js on lines 13..46

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

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

const makeEntities = function(parentId, depth) {
  if (depth > 5) {
    return [];
  }
  // The number of entities to create.
docs/can-guides/commitment/recipes/file-navigator/file-navigator-advanced-2.js on lines 8..41
docs/can-guides/commitment/recipes/file-navigator/file-navigator-advanced-3.js on lines 8..41
docs/can-guides/commitment/recipes/file-navigator/file-navigator-advanced-5.js on lines 13..46
docs/can-guides/commitment/recipes/file-navigator/file-navigator-advanced-6.js on lines 13..46
docs/can-guides/commitment/recipes/file-navigator/file-navigator-advanced-7.js on lines 13..46

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

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

const makeEntities = function(parentId, depth) {
  if (depth > 5) {
    return [];
  }
  // The number of entities to create.
docs/can-guides/commitment/recipes/file-navigator/file-navigator-advanced-2.js on lines 8..41
docs/can-guides/commitment/recipes/file-navigator/file-navigator-advanced-3.js on lines 8..41
docs/can-guides/commitment/recipes/file-navigator/file-navigator-advanced-4.js on lines 12..45
docs/can-guides/commitment/recipes/file-navigator/file-navigator-advanced-6.js on lines 13..46
docs/can-guides/commitment/recipes/file-navigator/file-navigator-advanced-7.js on lines 13..46

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

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