alietta/project-lvl2-s269

View on GitHub

Showing 28 of 29 total issues

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

test('difference json json', () => {
  const beforePath = getFixturePath('beforeJSON2.json');
  const afterPath = getFixturePath('afterJSON2.json');
  const diffPath = getFixturePath('diffJSON.json');
  const diff = JSON.parse(fs.readFileSync(diffPath, 'utf-8'));
Severity: Major
Found in __tests__/gendiff.test.js and 2 other locations - About 3 hrs to fix
__tests__/gendiff.test.js on lines 88..95
__tests__/gendiff.test.js on lines 97..104

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

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

test('difference ini json', () => {
  const beforePath = getFixturePath('beforeINI2.ini');
  const afterPath = getFixturePath('afterINI2.ini');
  const diffPath = getFixturePath('diffJSON.json');
  const diff = JSON.parse(fs.readFileSync(diffPath, 'utf-8'));
Severity: Major
Found in __tests__/gendiff.test.js and 2 other locations - About 3 hrs to fix
__tests__/gendiff.test.js on lines 79..86
__tests__/gendiff.test.js on lines 88..95

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

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

test('difference yaml json', () => {
  const beforePath = getFixturePath('beforeYAML2.yaml');
  const afterPath = getFixturePath('afterYAML2.yaml');
  const diffPath = getFixturePath('diffJSON.json');
  const diff = JSON.parse(fs.readFileSync(diffPath, 'utf-8'));
Severity: Major
Found in __tests__/gendiff.test.js and 2 other locations - About 3 hrs to fix
__tests__/gendiff.test.js on lines 79..86
__tests__/gendiff.test.js on lines 97..104

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

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

test('difference ini plain', () => {
  const beforePath = getFixturePath('beforeINI2.ini');
  const afterPath = getFixturePath('afterINI2.ini');
  const diffPath = getFixturePath('diffPlain.txt');
  const expected = fs.readFileSync(diffPath, 'utf-8');
Severity: Major
Found in __tests__/gendiff.test.js and 2 other locations - About 2 hrs to fix
__tests__/gendiff.test.js on lines 55..61
__tests__/gendiff.test.js on lines 63..69

Duplicated Code

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

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

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

Tuning

This issue has a mass of 92.

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

test('difference json plain', () => {
  const beforePath = getFixturePath('beforeJSON2.json');
  const afterPath = getFixturePath('afterJSON2.json');
  const diffPath = getFixturePath('diffPlain.txt');
  const expected = fs.readFileSync(diffPath, 'utf-8');
Severity: Major
Found in __tests__/gendiff.test.js and 2 other locations - About 2 hrs to fix
__tests__/gendiff.test.js on lines 63..69
__tests__/gendiff.test.js on lines 71..77

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

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

test('difference yaml plain', () => {
  const beforePath = getFixturePath('beforeYAML2.yaml');
  const afterPath = getFixturePath('afterYAML2.yaml');
  const diffPath = getFixturePath('diffPlain.txt');
  const expected = fs.readFileSync(diffPath, 'utf-8');
Severity: Major
Found in __tests__/gendiff.test.js and 2 other locations - About 2 hrs to fix
__tests__/gendiff.test.js on lines 55..61
__tests__/gendiff.test.js on lines 71..77

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

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

test('difference json2', () => {
  const beforePath = getFixturePath('beforeJSON2.json');
  const afterPath = getFixturePath('afterJSON2.json');
  const diffPath = getFixturePath('diffLevel.txt');
  const expected = fs.readFileSync(diffPath, 'utf-8');
Severity: Major
Found in __tests__/gendiff.test.js and 5 other locations - About 2 hrs to fix
__tests__/gendiff.test.js on lines 7..13
__tests__/gendiff.test.js on lines 23..29
__tests__/gendiff.test.js on lines 31..37
__tests__/gendiff.test.js on lines 39..45
__tests__/gendiff.test.js on lines 47..53

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

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

test('difference ini2', () => {
  const beforePath = getFixturePath('beforeINI2.ini');
  const afterPath = getFixturePath('afterINI2.ini');
  const diffPath = getFixturePath('diffLevel.txt');
  const expected = fs.readFileSync(diffPath, 'utf-8');
Severity: Major
Found in __tests__/gendiff.test.js and 5 other locations - About 2 hrs to fix
__tests__/gendiff.test.js on lines 7..13
__tests__/gendiff.test.js on lines 15..21
__tests__/gendiff.test.js on lines 23..29
__tests__/gendiff.test.js on lines 31..37
__tests__/gendiff.test.js on lines 39..45

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

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

test('difference json', () => {
  const beforePath = getFixturePath('before.json');
  const afterPath = getFixturePath('after.json');
  const diffPath = getFixturePath('diff.txt');
  const expected = fs.readFileSync(diffPath, 'utf-8');
Severity: Major
Found in __tests__/gendiff.test.js and 5 other locations - About 2 hrs to fix
__tests__/gendiff.test.js on lines 15..21
__tests__/gendiff.test.js on lines 23..29
__tests__/gendiff.test.js on lines 31..37
__tests__/gendiff.test.js on lines 39..45
__tests__/gendiff.test.js on lines 47..53

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

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

test('difference yaml2', () => {
  const beforePath = getFixturePath('beforeYAML2.yaml');
  const afterPath = getFixturePath('afterYAML2.yaml');
  const diffPath = getFixturePath('diffLevel.txt');
  const expected = fs.readFileSync(diffPath, 'utf-8');
Severity: Major
Found in __tests__/gendiff.test.js and 5 other locations - About 2 hrs to fix
__tests__/gendiff.test.js on lines 7..13
__tests__/gendiff.test.js on lines 15..21
__tests__/gendiff.test.js on lines 23..29
__tests__/gendiff.test.js on lines 39..45
__tests__/gendiff.test.js on lines 47..53

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

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

test('difference yaml', () => {
  const beforePath = getFixturePath('before.yaml');
  const afterPath = getFixturePath('after.yaml');
  const diffPath = getFixturePath('diffYaml.txt');
  const expected = fs.readFileSync(diffPath, 'utf-8');
Severity: Major
Found in __tests__/gendiff.test.js and 5 other locations - About 2 hrs to fix
__tests__/gendiff.test.js on lines 7..13
__tests__/gendiff.test.js on lines 15..21
__tests__/gendiff.test.js on lines 31..37
__tests__/gendiff.test.js on lines 39..45
__tests__/gendiff.test.js on lines 47..53

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

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

test('difference ini', () => {
  const beforePath = getFixturePath('before.ini');
  const afterPath = getFixturePath('after.ini');
  const diffPath = getFixturePath('diffIni.txt');
  const expected = fs.readFileSync(diffPath, 'utf-8');
Severity: Major
Found in __tests__/gendiff.test.js and 5 other locations - About 2 hrs to fix
__tests__/gendiff.test.js on lines 7..13
__tests__/gendiff.test.js on lines 15..21
__tests__/gendiff.test.js on lines 23..29
__tests__/gendiff.test.js on lines 31..37
__tests__/gendiff.test.js on lines 47..53

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

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

export default class JsonAddedNode {
  constructor(node) {
    this.node = node;
  }
  makeNodeObject() {
Severity: Major
Found in src/renderers/json/nodes/JsonAddedNode.js and 2 other locations - About 2 hrs to fix
src/renderers/json/nodes/JsonDeletedNode.js on lines 1..8
src/renderers/json/nodes/JsonUnchangedNode.js on lines 1..8

Duplicated Code

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

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

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

Tuning

This issue has a mass of 76.

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

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

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

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

Refactorings

Further Reading

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

export default class JsonUnchangedNode {
  constructor(node) {
    this.node = node;
  }
  makeNodeObject() {
Severity: Major
Found in src/renderers/json/nodes/JsonUnchangedNode.js and 2 other locations - About 2 hrs to fix
src/renderers/json/nodes/JsonAddedNode.js on lines 1..8
src/renderers/json/nodes/JsonDeletedNode.js on lines 1..8

Duplicated Code

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

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

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

Tuning

This issue has a mass of 76.

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

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

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

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

Refactorings

Further Reading

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

export default class JsonDeletedNode {
  constructor(node) {
    this.node = node;
  }
  makeNodeObject() {
Severity: Major
Found in src/renderers/json/nodes/JsonDeletedNode.js and 2 other locations - About 2 hrs to fix
src/renderers/json/nodes/JsonAddedNode.js on lines 1..8
src/renderers/json/nodes/JsonUnchangedNode.js on lines 1..8

Duplicated Code

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

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

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

Tuning

This issue has a mass of 76.

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

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

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

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

Refactorings

Further Reading

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

export default (node) => {
  const type = node.constructor.name;
  const JsonNode = jsonNodes[type];
  if (!JsonNode) {
    throw new Error(`unkown format: ${type}`);
Severity: Major
Found in src/renderers/json/nodes/index.js and 2 other locations - About 1 hr to fix
src/renderers/plain/nodes/index.js on lines 15..22
src/renderers/tree/nodes/index.js on lines 15..22

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

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

export default (node) => {
  const type = node.constructor.name;
  const PlainNode = PlainNodes[type];
  if (!PlainNode) {
    throw new Error(`unkown format: ${type}`);
Severity: Major
Found in src/renderers/plain/nodes/index.js and 2 other locations - About 1 hr to fix
src/renderers/json/nodes/index.js on lines 15..22
src/renderers/tree/nodes/index.js on lines 15..22

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

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

export default (node) => {
  const type = node.constructor.name;
  const TreeNode = treeNodes[type];
  if (!TreeNode) {
    throw new Error(`unkown format: ${type}`);
Severity: Major
Found in src/renderers/tree/nodes/index.js and 2 other locations - About 1 hr to fix
src/renderers/json/nodes/index.js on lines 15..22
src/renderers/plain/nodes/index.js on lines 15..22

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

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

export default class TreeDeletedNode extends TreeNodeRenderer {
  toString(level) {
    return `${this.getNewKey(level, '-')}: ${this.stringify(this.node.oldValue, level + 1)}`;
  }
}
Severity: Major
Found in src/renderers/tree/nodes/TreeDeletedNode.js and 1 other location - About 1 hr to fix
src/renderers/tree/nodes/TreeAddedNode.js on lines 3..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 65.

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

export default class TreeAddedNode extends TreeNodeRenderer {
  toString(level) {
    return `${this.getNewKey(level, '+')}: ${this.stringify(this.node.newValue, level + 1)}`;
  }
}
Severity: Major
Found in src/renderers/tree/nodes/TreeAddedNode.js and 1 other location - About 1 hr to fix
src/renderers/tree/nodes/TreeDeletedNode.js on lines 3..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 65.

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