RubyLouvre/anu

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

Summary

Maintainability
F
6 days
Test Coverage

File ReactDOMFiber-test.js has 945 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

const React = require('react');
const ReactDOM = require('react-dom');
const ReactTestUtils = require('test-utils');
Severity: Major
Found in packages/render/dom/__tests__/ReactDOMFiber-test.js - About 2 days to fix

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

        it('should warn when doing an update to a container manually updated outside of React', () => {
            // when not messing with the DOM outside of React
            ReactDOM.render(<div>foo</div>, container);
            ReactDOM.render(<div>bar</div>, container);
            expect(container.innerHTML).toBe('<div>bar</div>');
    Severity: Major
    Found in packages/render/dom/__tests__/ReactDOMFiber-test.js and 1 other location - About 3 hrs to fix
    packages/render/dom/__tests__/ReactDOMFiber-test.js on lines 1084..1098

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

    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('should warn when doing an update to a container manually cleared outside of React', () => {
            // when not messing with the DOM outside of React
            ReactDOM.render(<div>foo</div>, container);
            ReactDOM.render(<div>bar</div>, container);
            expect(container.innerHTML).toBe('<div>bar</div>');
    Severity: Major
    Found in packages/render/dom/__tests__/ReactDOMFiber-test.js and 1 other location - About 3 hrs to fix
    packages/render/dom/__tests__/ReactDOMFiber-test.js on lines 1068..1082

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

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

            class Component extends React.Component {
                static contextTypes = {
                    foo: PropTypes.string.isRequired,
                    getFoo: PropTypes.func.isRequired,
                };
    Severity: Major
    Found in packages/render/dom/__tests__/ReactDOMFiber-test.js and 3 other locations - About 3 hrs to fix
    packages/render/dom/__tests__/ReactDOMFiber-test.js on lines 788..797
    packages/render/dom/__tests__/renderSubtreeIntoContainer-test.js on lines 96..105
    packages/render/dom/__tests__/renderSubtreeIntoContainer-test.js on lines 148..157

    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

            class ErrorBoundary extends React.Component {
                state = { error: null };
                componentDidCatch(error) {
                    this.setState({ error });
                }
    Severity: Major
    Found in packages/render/dom/__tests__/ReactDOMFiber-test.js and 1 other location - About 3 hrs to fix
    packages/render/dom/__tests__/ReactDOMFiber-test.js on lines 678..689

    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

            class ErrorBoundary extends React.Component {
                state = { error: null };
                componentDidCatch(error) {
                    this.setState({ error });
                }
    Severity: Major
    Found in packages/render/dom/__tests__/ReactDOMFiber-test.js and 1 other location - About 3 hrs to fix
    packages/render/dom/__tests__/ReactDOMFiber-test.js on lines 645..656

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

            class Component extends React.Component {
                static contextTypes = {
                    foo: PropTypes.string.isRequired,
                    getFoo: PropTypes.func.isRequired,
                };
    Severity: Major
    Found in packages/render/dom/__tests__/ReactDOMFiber-test.js and 3 other locations - About 3 hrs to fix
    packages/render/dom/__tests__/ReactDOMFiber-test.js on lines 744..753
    packages/render/dom/__tests__/renderSubtreeIntoContainer-test.js on lines 96..105
    packages/render/dom/__tests__/renderSubtreeIntoContainer-test.js on lines 148..157

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

                    setTimeout(() => {
                        console.log('current跟上次不一样,dom位置复原');
                        this.setState({ current: 2 }, ()=>{
                            expect(prev(this.refs.aaa).id).toBe("a2")
                        });
    Severity: Major
    Found in packages/render/dom/__tests__/ReactDOMFiber-test.js and 3 other locations - About 2 hrs to fix
    packages/render/dom/__tests__/ReactDOMFiber-test.js on lines 325..330
    packages/render/dom/__tests__/ReactDOMFiber-test.js on lines 331..336
    packages/render/dom/__tests__/ReactDOMFiber-test.js on lines 343..348

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

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

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

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

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

    Refactorings

    Further Reading

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

                    setTimeout(() => {
                        console.log('current跟上次一样,dom位置互换');
                        this.setState({ current: 1 }, ()=>{
                            expect(prev(this.refs.aaa).id).toBe("a2")
                        });
    Severity: Major
    Found in packages/render/dom/__tests__/ReactDOMFiber-test.js and 3 other locations - About 2 hrs to fix
    packages/render/dom/__tests__/ReactDOMFiber-test.js on lines 325..330
    packages/render/dom/__tests__/ReactDOMFiber-test.js on lines 337..342
    packages/render/dom/__tests__/ReactDOMFiber-test.js on lines 343..348

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

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

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

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

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

    Refactorings

    Further Reading

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

                    setTimeout(() => {
                        console.log('current跟上次不一样)');
                        this.setState({ current: 1 }, ()=>{
                            expect(prev(this.refs.aaa).id).toBe("a2")
                        });
    Severity: Major
    Found in packages/render/dom/__tests__/ReactDOMFiber-test.js and 3 other locations - About 2 hrs to fix
    packages/render/dom/__tests__/ReactDOMFiber-test.js on lines 331..336
    packages/render/dom/__tests__/ReactDOMFiber-test.js on lines 337..342
    packages/render/dom/__tests__/ReactDOMFiber-test.js on lines 343..348

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

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

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

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

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

    Refactorings

    Further Reading

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

                    setTimeout(() => {
                        console.log('current跟上次一样,dom位置互换');
                        this.setState({ current: 2 }, ()=>{
                            expect(prev(this.refs.aaa).id).toBe("a2")
                        });
    Severity: Major
    Found in packages/render/dom/__tests__/ReactDOMFiber-test.js and 3 other locations - About 2 hrs to fix
    packages/render/dom/__tests__/ReactDOMFiber-test.js on lines 325..330
    packages/render/dom/__tests__/ReactDOMFiber-test.js on lines 331..336
    packages/render/dom/__tests__/ReactDOMFiber-test.js on lines 337..342

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

    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

                            <foreignObject {...expectSVG}>
                                <p {...expectHTML} />
                                <math {...expectMath}>
                                    <mi {...expectMath} />
                                </math>
    Severity: Major
    Found in packages/render/dom/__tests__/ReactDOMFiber-test.js and 1 other location - About 1 hr to fix
    packages/render/dom/__tests__/ReactDOMFiber-test.js on lines 578..584

    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

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

                                <svg {...expectSVG}>
                                    <image {...expectSVG} />
                                    <svg {...expectSVG}>
                                        <image {...expectSVG} />
                                    </svg>
    Severity: Major
    Found in packages/render/dom/__tests__/ReactDOMFiber-test.js and 1 other location - About 1 hr to fix
    packages/render/dom/__tests__/ReactDOMFiber-test.js on lines 516..522

    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

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

            class Component extends React.Component {
                static contextTypes = {
                    foo: PropTypes.string.isRequired,
                };
    
    
    Severity: Major
    Found in packages/render/dom/__tests__/ReactDOMFiber-test.js and 4 other locations - About 1 hr to fix
    packages/render/dom/__tests__/ReactStatelessComponent-test.js on lines 54..62
    packages/render/dom/__tests__/renderSubtreeIntoContainer-test.js on lines 14..22
    packages/render/dom/__tests__/renderSubtreeIntoContainer-test.js on lines 236..243
    packages/render/dom/__tests__/renderSubtreeIntoContainer-test.js on lines 279..286

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

    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

            assertNamespacesMatch(
                <svg {...expectSVG}>
                    <image {...expectSVG} />
                    {usePortal(<div {...expectHTML} />)}
                    <image {...expectSVG} />
    Severity: Major
    Found in packages/render/dom/__tests__/ReactDOMFiber-test.js and 1 other location - About 1 hr to fix
    packages/render/dom/__tests__/ReactDOMFiber-test.js on lines 467..473

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

    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

            assertNamespacesMatch(
                <math {...expectMath}>
                    <mi {...expectMath} />
                    {usePortal(<div {...expectHTML} />)}
                    <mi {...expectMath} />
    Severity: Major
    Found in packages/render/dom/__tests__/ReactDOMFiber-test.js and 1 other location - About 1 hr to fix
    packages/render/dom/__tests__/ReactDOMFiber-test.js on lines 460..466

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

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

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

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

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

    Refactorings

    Further Reading

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

            ReactDOM.render(<div>{ReactDOM.createPortal(<div>portal:2</div>, portalContainer)}</div>, container);
    Severity: Major
    Found in packages/render/dom/__tests__/ReactDOMFiber-test.js and 3 other locations - About 30 mins to fix
    packages/render/dom/__tests__/ReactDOMFiber-test.js on lines 199..199
    packages/render/dom/__tests__/ReactDOMFiber-test.js on lines 434..434
    packages/render/dom/__tests__/ReactDOMFiber-test.js on lines 442..442

    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

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

            ReactDOM.render(<div>{ReactDOM.createPortal(<div>portal</div>, portalContainer)}</div>, container);
    Severity: Major
    Found in packages/render/dom/__tests__/ReactDOMFiber-test.js and 3 other locations - About 30 mins to fix
    packages/render/dom/__tests__/ReactDOMFiber-test.js on lines 434..434
    packages/render/dom/__tests__/ReactDOMFiber-test.js on lines 438..438
    packages/render/dom/__tests__/ReactDOMFiber-test.js on lines 442..442

    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

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

            ReactDOM.render(<div>{ReactDOM.createPortal(<p>portal:3</p>, portalContainer)}</div>, container);
    Severity: Major
    Found in packages/render/dom/__tests__/ReactDOMFiber-test.js and 3 other locations - About 30 mins to fix
    packages/render/dom/__tests__/ReactDOMFiber-test.js on lines 199..199
    packages/render/dom/__tests__/ReactDOMFiber-test.js on lines 434..434
    packages/render/dom/__tests__/ReactDOMFiber-test.js on lines 438..438

    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

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

            ReactDOM.render(<div>{ReactDOM.createPortal(<div>portal:1</div>, portalContainer)}</div>, container);
    Severity: Major
    Found in packages/render/dom/__tests__/ReactDOMFiber-test.js and 3 other locations - About 30 mins to fix
    packages/render/dom/__tests__/ReactDOMFiber-test.js on lines 199..199
    packages/render/dom/__tests__/ReactDOMFiber-test.js on lines 438..438
    packages/render/dom/__tests__/ReactDOMFiber-test.js on lines 442..442

    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