packages/miew/src/chem/selectors/selectOps.test.js

Summary

Maintainability
D
1 day
Test Coverage

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

    it('constructs string for lower priority prefix operator from higher priority...', () => {
      const lowPriorityPO = new PrefixOperator(simplePO)
      lowPriorityPO.priority += 1
      lowPriorityPO.keyword = 'lowerPO'
      expect(lowPriorityPO.toString()).to.equal('lowerPO simplePO selector')
Severity: Major
Found in packages/miew/src/chem/selectors/selectOps.test.js and 1 other location - About 1 hr to fix
packages/miew/src/chem/selectors/selectOps.test.js on lines 21..26

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

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

    it('constructs string for higher priority prefix operator from lower priority...', () => {
      const highPriorityPO = new PrefixOperator(simplePO)
      highPriorityPO.priority -= 1
      highPriorityPO.keyword = 'higherPO'
      expect(highPriorityPO.toString()).to.equal('higherPO (simplePO selector)')
Severity: Major
Found in packages/miew/src/chem/selectors/selectOps.test.js and 1 other location - About 1 hr to fix
packages/miew/src/chem/selectors/selectOps.test.js on lines 27..32

Duplicated Code

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

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

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

Tuning

This issue has a mass of 72.

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

    it('constructs string for complex infix operator with follow priorities: middle(low, high)', () => {
      const complexIO = new InfixOperator(lowPriorityIO, highPriorityIO)
      complexIO.keyword = '*'
      expect(complexIO.toString()).to.equal(
        '(lSelector + rSelector) * lSelector ^ rSelector'
Severity: Major
Found in packages/miew/src/chem/selectors/selectOps.test.js and 3 other locations - About 1 hr to fix
packages/miew/src/chem/selectors/selectOps.test.js on lines 71..77
packages/miew/src/chem/selectors/selectOps.test.js on lines 85..91
packages/miew/src/chem/selectors/selectOps.test.js on lines 92..98

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

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

    it('constructs string for complex infix operator with follow priorities: middle(high, high)', () => {
      const complexIO = new InfixOperator(highPriorityIO, highPriorityIO)
      complexIO.keyword = '*'
      expect(complexIO.toString()).to.equal(
        'lSelector ^ rSelector * lSelector ^ rSelector'
Severity: Major
Found in packages/miew/src/chem/selectors/selectOps.test.js and 3 other locations - About 1 hr to fix
packages/miew/src/chem/selectors/selectOps.test.js on lines 71..77
packages/miew/src/chem/selectors/selectOps.test.js on lines 78..84
packages/miew/src/chem/selectors/selectOps.test.js on lines 85..91

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

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

    it('constructs string for complex infix operator with follow priorities: middle(high, low)', () => {
      const complexIO = new InfixOperator(highPriorityIO, lowPriorityIO)
      complexIO.keyword = '*'
      expect(complexIO.toString()).to.equal(
        'lSelector ^ rSelector * (lSelector + rSelector)'
Severity: Major
Found in packages/miew/src/chem/selectors/selectOps.test.js and 3 other locations - About 1 hr to fix
packages/miew/src/chem/selectors/selectOps.test.js on lines 78..84
packages/miew/src/chem/selectors/selectOps.test.js on lines 85..91
packages/miew/src/chem/selectors/selectOps.test.js on lines 92..98

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

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

    it('constructs string for complex infix operator with follow priorities: middle(low, low)', () => {
      const complexIO = new InfixOperator(lowPriorityIO, lowPriorityIO)
      complexIO.keyword = '*'
      expect(complexIO.toString()).to.equal(
        '(lSelector + rSelector) * (lSelector + rSelector)'
Severity: Major
Found in packages/miew/src/chem/selectors/selectOps.test.js and 3 other locations - About 1 hr to fix
packages/miew/src/chem/selectors/selectOps.test.js on lines 71..77
packages/miew/src/chem/selectors/selectOps.test.js on lines 78..84
packages/miew/src/chem/selectors/selectOps.test.js on lines 92..98

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

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

    it('constructs JSON for infix operator with no arguments', () => {
      expect(noneSelectorIO.toJSON()).to.deep.equal([
        'Error',
        noneSelector.toJSON(),
        noneSelector.toJSON()
Severity: Major
Found in packages/miew/src/chem/selectors/selectOps.test.js and 2 other locations - About 1 hr to fix
packages/miew/src/chem/selectors/selectOps.test.js on lines 109..115
packages/miew/src/chem/selectors/selectOps.test.js on lines 116..122

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

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

    it('constructs JSON for infix operator with one argument', () => {
      expect(halfSelectorIO.toJSON()).to.deep.equal([
        'Error',
        leftSelector.toJSON(),
        noneSelector.toJSON()
Severity: Major
Found in packages/miew/src/chem/selectors/selectOps.test.js and 2 other locations - About 1 hr to fix
packages/miew/src/chem/selectors/selectOps.test.js on lines 102..108
packages/miew/src/chem/selectors/selectOps.test.js on lines 116..122

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

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

    it('constructs JSON for simple infix operator', () => {
      expect(selectorIO.toJSON()).to.deep.equal([
        'Error',
        leftSelector.toJSON(),
        rightSelector.toJSON()
Severity: Major
Found in packages/miew/src/chem/selectors/selectOps.test.js and 2 other locations - About 1 hr to fix
packages/miew/src/chem/selectors/selectOps.test.js on lines 102..108
packages/miew/src/chem/selectors/selectOps.test.js on lines 109..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 61.

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

There are no issues that match your filters.

Category
Status