gmmorris/simmerjs

View on GitHub

Showing 54 of 62 total issues

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

        [
          {
            el: { nodeName: 'DIV' },
            getClasses: () => ['someAClass', 'someBClass']
          },
Severity: Major
Found in modules/methods/inspectNthChild.test.js and 1 other location - About 3 hrs to fix
modules/methods/inspectNthChild.test.js on lines 84..92

Duplicated Code

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

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

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

Tuning

This issue has a mass of 95.

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

        [
          {
            el: { nodeName: 'DIV' },
            getClasses: () => ['someAClass', 'someBClass']
          },
Severity: Major
Found in modules/methods/inspectNthChild.test.js and 1 other location - About 3 hrs to fix
modules/methods/inspectNthChild.test.js on lines 64..72

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

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

  'can analyze an element based only on child elements when specific enough at level 1': function (
    browser
  ) {
    browser
      .url('localhost:3993') // visit the local url
Severity: Major
Found in __tests__/e2e/index.js and 1 other location - About 2 hrs to fix
__tests__/e2e/index.js on lines 297..313

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

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

  'can analyze an element based only on child elements when specific enough at level 2': function (
    browser
  ) {
    browser
      .url('localhost:3993') // visit the local url
Severity: Major
Found in __tests__/e2e/index.js and 1 other location - About 2 hrs to fix
__tests__/e2e/index.js on lines 283..295

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

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

  'can analyze an element with a valid ID that ends with numbers in its ID': function (
    browser
  ) {
    browser
      .url('localhost:3993') // visit the local url
Severity: Major
Found in __tests__/e2e/index.js and 1 other location - About 2 hrs to fix
__tests__/e2e/index.js on lines 328..339

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

  'can analyze an element with a valid ID that has numbers in the middle of its ID': function (
    browser
  ) {
    browser
      .url('localhost:3993') // visit the local url
Severity: Major
Found in __tests__/e2e/index.js and 1 other location - About 2 hrs to fix
__tests__/e2e/index.js on lines 315..326

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

  test(`takes an child with a sibling and identifies it as having a unique tag`, function () {
    expect(
      analyzeElementSiblings(
        { el: { nodeName: 'DIV' }, getClasses: () => ['someClass'] },
        [{ el: { nodeName: 'P' }, getClasses: () => [] }]
Severity: Major
Found in modules/methods/inspectNthChild.test.js and 1 other location - About 2 hrs to fix
modules/methods/inspectNthChild.test.js on lines 31..38

Duplicated Code

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

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

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

Tuning

This issue has a mass of 83.

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

  test(`takes an child with a sibling and identifies it as having a unique class`, function () {
    expect(
      analyzeElementSiblings(
        { el: { nodeName: 'DIV' }, getClasses: () => ['someClass'] },
        [{ el: { nodeName: 'DIV' }, getClasses: () => [] }]
Severity: Major
Found in modules/methods/inspectNthChild.test.js and 1 other location - About 2 hrs to fix
modules/methods/inspectNthChild.test.js on lines 22..29

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

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

  A: (state, elm) => {
    const attribute = elm.el.getAttribute('href')
    if (attribute) {
      state.stack[0].push(`A[href="${attribute}"]`)
      state.specificity += 10
Severity: Major
Found in modules/methods/inspectSpecialAttributes.js and 1 other location - About 2 hrs to fix
modules/methods/inspectSpecialAttributes.js on lines 10..17

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

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

  IMG: (state, elm) => {
    const attribute = elm.el.getAttribute('src')
    if (attribute) {
      state.stack[0].push(`IMG[src="${attribute}"]`)
      state.specificity += 10
Severity: Major
Found in modules/methods/inspectSpecialAttributes.js and 1 other location - About 2 hrs to fix
modules/methods/inspectSpecialAttributes.js on lines 2..9

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

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

  app.get('/', function (req, res) {
      res.status(200).sendFile(`__tests__/e2e/test.html`, {root: path.resolve()});
  });
Severity: Major
Found in __tests__/server.js and 1 other location - About 1 hr to fix
__tests__/server.js on lines 9..11

Duplicated Code

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

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

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

Tuning

This issue has a mass of 57.

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

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

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

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

Refactorings

Further Reading

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

  app.get('/simmer.js', function (req, res) {
      res.status(200).sendFile(`dist/simmer.js`, {root: path.resolve()});
  });
Severity: Major
Found in __tests__/server.js and 1 other location - About 1 hr to fix
__tests__/server.js on lines 6..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 57.

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

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

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

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

Refactorings

Further Reading

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

export function attr (attribute) {
  if (
    typeof attribute === 'string' &&
    attribute.match(/^[0-9a-zA-Z][a-zA-Z_\-:0-9.]*$/gi) !== null
  ) {
Severity: Minor
Found in modules/methods/validationHelpers.js and 1 other location - About 50 mins to fix
modules/methods/validationHelpers.js on lines 7..15

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

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 function tagName (tagName) {
  if (
    typeof tagName === 'string' &&
    tagName.match(/^[a-zA-Z0-9]+$/gi) !== null
  ) {
Severity: Minor
Found in modules/methods/validationHelpers.js and 1 other location - About 50 mins to fix
modules/methods/validationHelpers.js on lines 20..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 51.

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

    function (result) {
      browser.assert.equal(result.value.wasUnselectable, true)
      onFinish(result.value.simmerSelector)
    }
Severity: Minor
Found in __tests__/e2e/index.js and 1 other location - About 35 mins to fix
__tests__/e2e/index.js on lines 20..23

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

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

  'can analyze an anchor (link) with a unique href attribute': function (
    browser
  ) {
    browser
      .url('localhost:3993') // visit the local url
Severity: Major
Found in __tests__/e2e/index.js and 17 other locations - About 35 mins to fix
__tests__/e2e/index.js on lines 94..100
__tests__/e2e/index.js on lines 102..108
__tests__/e2e/index.js on lines 110..118
__tests__/e2e/index.js on lines 120..128
__tests__/e2e/index.js on lines 130..136
__tests__/e2e/index.js on lines 138..146
__tests__/e2e/index.js on lines 148..156
__tests__/e2e/index.js on lines 168..174
__tests__/e2e/index.js on lines 176..182
__tests__/e2e/index.js on lines 184..190
__tests__/e2e/index.js on lines 192..200
__tests__/e2e/index.js on lines 212..220
__tests__/e2e/index.js on lines 222..230
__tests__/e2e/index.js on lines 232..240
__tests__/e2e/index.js on lines 242..250
__tests__/e2e/index.js on lines 273..281
__tests__/e2e/index.js on lines 353..364

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

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

  'can analyze anelement which has a class only (no IDs on it or its direct parent)': function (
    browser
  ) {
    browser
      .url('localhost:3993') // visit the local url
Severity: Major
Found in __tests__/e2e/index.js and 17 other locations - About 35 mins to fix
__tests__/e2e/index.js on lines 94..100
__tests__/e2e/index.js on lines 102..108
__tests__/e2e/index.js on lines 110..118
__tests__/e2e/index.js on lines 130..136
__tests__/e2e/index.js on lines 138..146
__tests__/e2e/index.js on lines 148..156
__tests__/e2e/index.js on lines 168..174
__tests__/e2e/index.js on lines 176..182
__tests__/e2e/index.js on lines 184..190
__tests__/e2e/index.js on lines 192..200
__tests__/e2e/index.js on lines 202..210
__tests__/e2e/index.js on lines 212..220
__tests__/e2e/index.js on lines 222..230
__tests__/e2e/index.js on lines 232..240
__tests__/e2e/index.js on lines 242..250
__tests__/e2e/index.js on lines 273..281
__tests__/e2e/index.js on lines 353..364

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

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

  'can analyze an element with identical siblings, no ID and different classes completely': function (
    browser
  ) {
    browser
      .url('localhost:3993') // visit the local url
Severity: Major
Found in __tests__/e2e/index.js and 17 other locations - About 35 mins to fix
__tests__/e2e/index.js on lines 94..100
__tests__/e2e/index.js on lines 102..108
__tests__/e2e/index.js on lines 110..118
__tests__/e2e/index.js on lines 120..128
__tests__/e2e/index.js on lines 130..136
__tests__/e2e/index.js on lines 138..146
__tests__/e2e/index.js on lines 148..156
__tests__/e2e/index.js on lines 168..174
__tests__/e2e/index.js on lines 176..182
__tests__/e2e/index.js on lines 184..190
__tests__/e2e/index.js on lines 192..200
__tests__/e2e/index.js on lines 202..210
__tests__/e2e/index.js on lines 212..220
__tests__/e2e/index.js on lines 222..230
__tests__/e2e/index.js on lines 232..240
__tests__/e2e/index.js on lines 273..281
__tests__/e2e/index.js on lines 353..364

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

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

  'can analyze an element with an ID': function (browser) {
    browser
      .url('localhost:3993') // visit the local url
      .waitForElementVisible('body') // wait for the body to be rendered

Severity: Major
Found in __tests__/e2e/index.js and 17 other locations - About 35 mins to fix
__tests__/e2e/index.js on lines 102..108
__tests__/e2e/index.js on lines 110..118
__tests__/e2e/index.js on lines 120..128
__tests__/e2e/index.js on lines 130..136
__tests__/e2e/index.js on lines 138..146
__tests__/e2e/index.js on lines 148..156
__tests__/e2e/index.js on lines 168..174
__tests__/e2e/index.js on lines 176..182
__tests__/e2e/index.js on lines 184..190
__tests__/e2e/index.js on lines 192..200
__tests__/e2e/index.js on lines 202..210
__tests__/e2e/index.js on lines 212..220
__tests__/e2e/index.js on lines 222..230
__tests__/e2e/index.js on lines 232..240
__tests__/e2e/index.js on lines 242..250
__tests__/e2e/index.js on lines 273..281
__tests__/e2e/index.js on lines 353..364

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

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

  'can analyze a link with a non unique href attribute and a heirarchy which has no unique IDs': function (
    browser
  ) {
    browser
      .url('localhost:3993') // visit the local url
Severity: Major
Found in __tests__/e2e/index.js and 17 other locations - About 35 mins to fix
__tests__/e2e/index.js on lines 94..100
__tests__/e2e/index.js on lines 102..108
__tests__/e2e/index.js on lines 110..118
__tests__/e2e/index.js on lines 120..128
__tests__/e2e/index.js on lines 130..136
__tests__/e2e/index.js on lines 138..146
__tests__/e2e/index.js on lines 148..156
__tests__/e2e/index.js on lines 168..174
__tests__/e2e/index.js on lines 176..182
__tests__/e2e/index.js on lines 184..190
__tests__/e2e/index.js on lines 192..200
__tests__/e2e/index.js on lines 202..210
__tests__/e2e/index.js on lines 222..230
__tests__/e2e/index.js on lines 232..240
__tests__/e2e/index.js on lines 242..250
__tests__/e2e/index.js on lines 273..281
__tests__/e2e/index.js on lines 353..364

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

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