RubyLouvre/anu

View on GitHub

Showing 594 of 880 total issues

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

CanvasContext.prototype.rect = function(x, y, width, height) {
    this.missions.push(() => {
        this.ctx.rect(x, y, width, height);
    });
};
Severity: Major
Found in packages/render/miniapp/apiForH5/canvas.js and 5 other locations - About 1 hr to fix
packages/render/miniapp/apiForH5/canvas.js on lines 90..94
packages/render/miniapp/apiForH5/canvas.js on lines 96..100
packages/render/miniapp/apiForH5/canvas.js on lines 102..106
packages/render/miniapp/apiForH5/canvas.js on lines 169..173
packages/render/miniapp/apiForH5/canvas.js on lines 199..203

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

CanvasContext.prototype.fillRect = function(x, y, width, height) {
    this.missions.push(() => {
        this.ctx.fillRect(x, y, width, height);
    });
};
Severity: Major
Found in packages/render/miniapp/apiForH5/canvas.js and 5 other locations - About 1 hr to fix
packages/render/miniapp/apiForH5/canvas.js on lines 84..88
packages/render/miniapp/apiForH5/canvas.js on lines 96..100
packages/render/miniapp/apiForH5/canvas.js on lines 102..106
packages/render/miniapp/apiForH5/canvas.js on lines 169..173
packages/render/miniapp/apiForH5/canvas.js on lines 199..203

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

CanvasContext.prototype.fillText = function(text, x, y, maxWidth) {
    this.missions.push(() => {
        this.ctx.fillText(text, x, y, maxWidth);
    });
};
Severity: Major
Found in packages/render/miniapp/apiForH5/canvas.js and 5 other locations - About 1 hr to fix
packages/render/miniapp/apiForH5/canvas.js on lines 84..88
packages/render/miniapp/apiForH5/canvas.js on lines 90..94
packages/render/miniapp/apiForH5/canvas.js on lines 96..100
packages/render/miniapp/apiForH5/canvas.js on lines 102..106
packages/render/miniapp/apiForH5/canvas.js on lines 169..173

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

      itRenders('unknown data- attributes with casing', async render => {
        const e = await render(<div data-fooBar="true" />, 1);
        expect(e.getAttribute('data-foobar')).toBe('true');
      });
Severity: Major
Found in packages/render/server/__tests2__/index.js and 2 other locations - About 1 hr to fix
packages/render/server/__tests2__/index.js on lines 542..545
packages/render/server/__tests2__/index.js on lines 606..609

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

      itRenders('badly cased reserved attributes', async render => {
        const e = await render(<div CHILDREN="5" />, 1);
        expect(e.getAttribute('CHILDREN')).toBe('5');
      });
Severity: Major
Found in packages/render/server/__tests2__/index.js and 2 other locations - About 1 hr to fix
packages/render/server/__tests2__/index.js on lines 558..561
packages/render/server/__tests2__/index.js on lines 606..609

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

    class B extends React.Component {
      constructor(props) {
        super(props);
        this.state = {};
      }
Severity: Major
Found in packages/render/dom/__tests__/ReactMount-test.js and 1 other location - About 1 hr to fix
packages/render/dom/__tests__/ReactMount-test.js on lines 348..356

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

    class C extends React.Component {
      constructor(props) {
        super(props);
        this.state = {};
      }
Severity: Major
Found in packages/render/dom/__tests__/ReactMount-test.js and 1 other location - About 1 hr to fix
packages/render/dom/__tests__/ReactMount-test.js on lines 339..347

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

      itRenders('cased custom attributes', async render => {
        const e = await render(<div fooBar="test" />, 1);
        expect(e.getAttribute('foobar')).toBe('test');
      });
Severity: Major
Found in packages/render/server/__tests2__/index.js and 2 other locations - About 1 hr to fix
packages/render/server/__tests2__/index.js on lines 542..545
packages/render/server/__tests2__/index.js on lines 558..561

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

      itRenders('htmlFor with an empty string', async render => {
        const e = await render(<div htmlFor="" />);
        expect(e.getAttribute('for')).toBe('');
      });
Severity: Major
Found in packages/render/server/__tests2__/index.js and 10 other locations - About 1 hr to fix
packages/render/server/__tests2__/index.js on lines 151..154
packages/render/server/__tests2__/index.js on lines 156..159
packages/render/server/__tests2__/index.js on lines 193..196
packages/render/server/__tests2__/index.js on lines 198..201
packages/render/server/__tests2__/index.js on lines 242..245
packages/render/server/__tests2__/index.js on lines 532..535
packages/render/server/__tests2__/index.js on lines 537..540
packages/render/server/__tests2__/index.js on lines 627..630
packages/render/server/__tests2__/index.js on lines 656..659
packages/render/server/__tests2__/index.js on lines 661..664

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

      itRenders('unknown attributes', async render => {
        const e = await render(<div foo="bar" />);
        expect(e.getAttribute('foo')).toBe('bar');
      });
Severity: Major
Found in packages/render/server/__tests2__/index.js and 10 other locations - About 1 hr to fix
packages/render/server/__tests2__/index.js on lines 151..154
packages/render/server/__tests2__/index.js on lines 156..159
packages/render/server/__tests2__/index.js on lines 193..196
packages/render/server/__tests2__/index.js on lines 198..201
packages/render/server/__tests2__/index.js on lines 242..245
packages/render/server/__tests2__/index.js on lines 253..256
packages/render/server/__tests2__/index.js on lines 537..540
packages/render/server/__tests2__/index.js on lines 627..630
packages/render/server/__tests2__/index.js on lines 656..659
packages/render/server/__tests2__/index.js on lines 661..664

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

    itRenders('unknown attributes for custom elements', async render => {
      const e = await render(<custom-element foo="bar" />);
      expect(e.getAttribute('foo')).toBe('bar');
    });
Severity: Major
Found in packages/render/server/__tests2__/index.js and 10 other locations - About 1 hr to fix
packages/render/server/__tests2__/index.js on lines 151..154
packages/render/server/__tests2__/index.js on lines 156..159
packages/render/server/__tests2__/index.js on lines 193..196
packages/render/server/__tests2__/index.js on lines 198..201
packages/render/server/__tests2__/index.js on lines 242..245
packages/render/server/__tests2__/index.js on lines 253..256
packages/render/server/__tests2__/index.js on lines 532..535
packages/render/server/__tests2__/index.js on lines 537..540
packages/render/server/__tests2__/index.js on lines 627..630
packages/render/server/__tests2__/index.js on lines 661..664

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

      itRenders('download prop with string value', async render => {
        const e = await render(<a download="myfile" />);
        expect(e.getAttribute('download')).toBe('myfile');
      });
Severity: Major
Found in packages/render/server/__tests2__/index.js and 10 other locations - About 1 hr to fix
packages/render/server/__tests2__/index.js on lines 156..159
packages/render/server/__tests2__/index.js on lines 193..196
packages/render/server/__tests2__/index.js on lines 198..201
packages/render/server/__tests2__/index.js on lines 242..245
packages/render/server/__tests2__/index.js on lines 253..256
packages/render/server/__tests2__/index.js on lines 532..535
packages/render/server/__tests2__/index.js on lines 537..540
packages/render/server/__tests2__/index.js on lines 627..630
packages/render/server/__tests2__/index.js on lines 656..659
packages/render/server/__tests2__/index.js on lines 661..664

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

      itRenders('unknown data- attributes', async render => {
        const e = await render(<div data-foo="bar" />);
        expect(e.getAttribute('data-foo')).toBe('bar');
      });
Severity: Major
Found in packages/render/server/__tests2__/index.js and 10 other locations - About 1 hr to fix
packages/render/server/__tests2__/index.js on lines 151..154
packages/render/server/__tests2__/index.js on lines 156..159
packages/render/server/__tests2__/index.js on lines 193..196
packages/render/server/__tests2__/index.js on lines 198..201
packages/render/server/__tests2__/index.js on lines 242..245
packages/render/server/__tests2__/index.js on lines 253..256
packages/render/server/__tests2__/index.js on lines 532..535
packages/render/server/__tests2__/index.js on lines 627..630
packages/render/server/__tests2__/index.js on lines 656..659
packages/render/server/__tests2__/index.js on lines 661..664

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

    itRenders('unknown `on*` attributes for custom elements', async render => {
      const e = await render(<custom-element onunknown="bar" />);
      expect(e.getAttribute('onunknown')).toBe('bar');
    });
Severity: Major
Found in packages/render/server/__tests2__/index.js and 10 other locations - About 1 hr to fix
packages/render/server/__tests2__/index.js on lines 151..154
packages/render/server/__tests2__/index.js on lines 156..159
packages/render/server/__tests2__/index.js on lines 193..196
packages/render/server/__tests2__/index.js on lines 198..201
packages/render/server/__tests2__/index.js on lines 242..245
packages/render/server/__tests2__/index.js on lines 253..256
packages/render/server/__tests2__/index.js on lines 532..535
packages/render/server/__tests2__/index.js on lines 537..540
packages/render/server/__tests2__/index.js on lines 627..630
packages/render/server/__tests2__/index.js on lines 656..659

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

    itRenders('custom attribute named `on`', async render => {
      const e = await render(<div on="tap:do-something" />);
      expect(e.getAttribute('on')).toEqual('tap:do-something');
    });
Severity: Major
Found in packages/render/server/__tests2__/index.js and 10 other locations - About 1 hr to fix
packages/render/server/__tests2__/index.js on lines 151..154
packages/render/server/__tests2__/index.js on lines 156..159
packages/render/server/__tests2__/index.js on lines 193..196
packages/render/server/__tests2__/index.js on lines 198..201
packages/render/server/__tests2__/index.js on lines 242..245
packages/render/server/__tests2__/index.js on lines 253..256
packages/render/server/__tests2__/index.js on lines 532..535
packages/render/server/__tests2__/index.js on lines 537..540
packages/render/server/__tests2__/index.js on lines 656..659
packages/render/server/__tests2__/index.js on lines 661..664

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

      itRenders('className prop with empty string value', async render => {
        const e = await render(<div className="" />);
        expect(e.getAttribute('class')).toBe('');
      });
Severity: Major
Found in packages/render/server/__tests2__/index.js and 10 other locations - About 1 hr to fix
packages/render/server/__tests2__/index.js on lines 151..154
packages/render/server/__tests2__/index.js on lines 156..159
packages/render/server/__tests2__/index.js on lines 193..196
packages/render/server/__tests2__/index.js on lines 242..245
packages/render/server/__tests2__/index.js on lines 253..256
packages/render/server/__tests2__/index.js on lines 532..535
packages/render/server/__tests2__/index.js on lines 537..540
packages/render/server/__tests2__/index.js on lines 627..630
packages/render/server/__tests2__/index.js on lines 656..659
packages/render/server/__tests2__/index.js on lines 661..664

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

      itRenders('download prop with string "false" value', async render => {
        const e = await render(<a download="false" />);
        expect(e.getAttribute('download')).toBe('false');
      });
Severity: Major
Found in packages/render/server/__tests2__/index.js and 10 other locations - About 1 hr to fix
packages/render/server/__tests2__/index.js on lines 151..154
packages/render/server/__tests2__/index.js on lines 193..196
packages/render/server/__tests2__/index.js on lines 198..201
packages/render/server/__tests2__/index.js on lines 242..245
packages/render/server/__tests2__/index.js on lines 253..256
packages/render/server/__tests2__/index.js on lines 532..535
packages/render/server/__tests2__/index.js on lines 537..540
packages/render/server/__tests2__/index.js on lines 627..630
packages/render/server/__tests2__/index.js on lines 656..659
packages/render/server/__tests2__/index.js on lines 661..664

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

      itRenders('htmlFor with string value', async render => {
        const e = await render(<div htmlFor="myFor" />);
        expect(e.getAttribute('for')).toBe('myFor');
      });
Severity: Major
Found in packages/render/server/__tests2__/index.js and 10 other locations - About 1 hr to fix
packages/render/server/__tests2__/index.js on lines 151..154
packages/render/server/__tests2__/index.js on lines 156..159
packages/render/server/__tests2__/index.js on lines 193..196
packages/render/server/__tests2__/index.js on lines 198..201
packages/render/server/__tests2__/index.js on lines 253..256
packages/render/server/__tests2__/index.js on lines 532..535
packages/render/server/__tests2__/index.js on lines 537..540
packages/render/server/__tests2__/index.js on lines 627..630
packages/render/server/__tests2__/index.js on lines 656..659
packages/render/server/__tests2__/index.js on lines 661..664

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

      itRenders('className prop with string value', async render => {
        const e = await render(<div className="myClassName" />);
        expect(e.getAttribute('class')).toBe('myClassName');
      });
Severity: Major
Found in packages/render/server/__tests2__/index.js and 10 other locations - About 1 hr to fix
packages/render/server/__tests2__/index.js on lines 151..154
packages/render/server/__tests2__/index.js on lines 156..159
packages/render/server/__tests2__/index.js on lines 198..201
packages/render/server/__tests2__/index.js on lines 242..245
packages/render/server/__tests2__/index.js on lines 253..256
packages/render/server/__tests2__/index.js on lines 532..535
packages/render/server/__tests2__/index.js on lines 537..540
packages/render/server/__tests2__/index.js on lines 627..630
packages/render/server/__tests2__/index.js on lines 656..659
packages/render/server/__tests2__/index.js on lines 661..664

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

    let inst = ReactDOM.render(
      <div>
        <span />
        {'bar'}
        <span />
Severity: Major
Found in packages/render/dom/__tests__/ReactDOMTextComponent-test.js and 1 other location - About 1 hr to fix
packages/render/dom/__tests__/ReactDOMTextComponent-test.js on lines 261..272

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

Severity
Category
Status
Source
Language