RubyLouvre/anu

View on GitHub
packages/render/dom/__tests__/ReactDOMSVG-test.js

Summary

Maintainability
F
5 days
Test Coverage

Function render has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

          render() {
            inst = this;
            const {step} = this.state;
            if (step === 0) {
              return null;
Severity: Minor
Found in packages/render/dom/__tests__/ReactDOMSVG-test.js - About 1 hr to fix

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

                  <g ref={el => (g = el)} strokeWidth="5">
                    <svg ref={el => (svg2 = el)}>
                      <foreignObject ref={el => (foreignObject = el)}>
                        <svg ref={el => (svg3 = el)}>
                          <svg ref={el => (svg4 = el)} />
    Severity: Major
    Found in packages/render/dom/__tests__/ReactDOMSVG-test.js and 1 other location - About 1 day to fix
    packages/render/dom/__tests__/ReactDOMSVG-test.js on lines 130..150

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 269.

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

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

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

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

    Refactorings

    Further Reading

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

                  <g ref={el => (g = el)} strokeWidth="5">
                    <svg ref={el => (svg2 = el)}>
                      <foreignObject ref={el => (foreignObject = el)}>
                        <svg ref={el => (svg3 = el)}>
                          <svg ref={el => (svg4 = el)} />
    Severity: Major
    Found in packages/render/dom/__tests__/ReactDOMSVG-test.js and 1 other location - About 1 day to fix
    packages/render/dom/__tests__/ReactDOMSVG-test.js on lines 45..65

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 269.

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

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

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

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

    Refactorings

    Further Reading

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

          it('can render SVG into a non-React SVG tree', () => {
            const outerSVGRoot = document.createElementNS(
              'http://www.w3.org/2000/svg',
              'svg',
            );
    Severity: Major
    Found in packages/render/dom/__tests__/ReactDOMSVG-test.js and 1 other location - About 4 hrs to fix
    packages/render/dom/__tests__/ReactDOMSVG-test.js on lines 206..220

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

    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('can render HTML into a foreignObject in non-React SVG tree', () => {
            const outerSVGRoot = document.createElementNS(
              'http://www.w3.org/2000/svg',
              'svg',
            );
    Severity: Major
    Found in packages/render/dom/__tests__/ReactDOMSVG-test.js and 1 other location - About 4 hrs to fix
    packages/render/dom/__tests__/ReactDOMSVG-test.js on lines 190..204

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

    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

            [image, image2].forEach(el => {
              expect(el.namespaceURI).toBe('http://www.w3.org/2000/svg');
              expect(el.tagName).toBe('image');
              expect(el.getAttributeNS('http://www.w3.org/1999/xlink', 'href')).toBe(
                'http://i.imgur.com/w7GCRPb.png',
    Severity: Major
    Found in packages/render/dom/__tests__/ReactDOMSVG-test.js and 1 other location - About 1 hr to fix
    packages/render/dom/__tests__/ReactDOMSVG-test.js on lines 90..96

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

    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

            [image, image2, image3].forEach(el => {
              expect(el.namespaceURI).toBe('http://www.w3.org/2000/svg');
              expect(el.tagName).toBe('image');
              expect(el.getAttributeNS('http://www.w3.org/1999/xlink', 'href')).toBe(
                'http://i.imgur.com/w7GCRPb.png',
    Severity: Major
    Found in packages/render/dom/__tests__/ReactDOMSVG-test.js and 1 other location - About 1 hr to fix
    packages/render/dom/__tests__/ReactDOMSVG-test.js on lines 172..178

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

    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

            [svg, svg2, svg3, svg4].forEach(el => {
              expect(el.namespaceURI).toBe('http://www.w3.org/2000/svg');
              // SVG tagName is case sensitive.
              expect(el.tagName).toBe('svg');
            });
    Severity: Major
    Found in packages/render/dom/__tests__/ReactDOMSVG-test.js and 1 other location - About 1 hr to fix
    packages/render/dom/__tests__/ReactDOMSVG-test.js on lines 79..83

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

    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

            [svg, svg2, svg3, svg4].forEach(el => {
              expect(el.namespaceURI).toBe('http://www.w3.org/2000/svg');
              // SVG tagName is case sensitive.
              expect(el.tagName).toBe('svg');
            });
    Severity: Major
    Found in packages/render/dom/__tests__/ReactDOMSVG-test.js and 1 other location - About 1 hr to fix
    packages/render/dom/__tests__/ReactDOMSVG-test.js on lines 164..168

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

    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

            [foreignObject, foreignObject2].forEach(el => {
              expect(el.namespaceURI).toBe('http://www.w3.org/2000/svg');
              expect(el.tagName).toBe('foreignObject');
            });
    Severity: Major
    Found in packages/render/dom/__tests__/ReactDOMSVG-test.js and 1 other location - About 1 hr to fix
    packages/render/dom/__tests__/ReactDOMSVG-test.js on lines 179..182

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

    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

            [foreignObject, foreignObject2].forEach(el => {
              expect(el.namespaceURI).toBe('http://www.w3.org/2000/svg');
              expect(el.tagName).toBe('foreignObject');
            });
    Severity: Major
    Found in packages/render/dom/__tests__/ReactDOMSVG-test.js and 1 other location - About 1 hr to fix
    packages/render/dom/__tests__/ReactDOMSVG-test.js on lines 97..100

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

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

          beforeEach(() => {
            React = require('react');
            ReactDOM = require('react-dom');
            ReactDOMServer = require('react-server-renderer');
          });
    Severity: Major
    Found in packages/render/dom/__tests__/ReactDOMSVG-test.js and 4 other locations - About 30 mins to fix
    packages/render/dom/__tests__/ReactCompositeComponentNestedState-test.js on lines 8..12
    packages/render/dom/__tests__/ReactDOMOption-test.js on lines 7..11
    packages/render/dom/__tests__/ReactDOMTextComponent-test.js on lines 17..21
    packages/render/dom/__tests__/ReactUpdates-test.js on lines 9..13

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

    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