RubyLouvre/anu

View on GitHub

Showing 880 of 880 total issues

File ReactErrorBoundaries-test.internal.js has 1807 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

let PropTypes;
let React;
let ReactDOM;
Severity: Major
Found in packages/render/dom/__tests__/ReactErrorBoundaries-test.internal.js - About 4 days to fix

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

        var ReactInputSelection = {
            hasSelectionCapabilities: function (elem) {
                var nodeName = getNodeTag(elem || {});
                return nodeName && (nodeName === "input" && elem.type === "text" || nodeName === "textarea" || elem.contentEditable === "true");
            },
    Severity: Major
    Found in lib/ReactInputSelection.js and 1 other location - About 3 days to fix
    scripts/build/ReactSelection.js on lines 91..169

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

    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

    var ReactInputSelection = {
        hasSelectionCapabilities: function (elem) {
            var nodeName = getNodeTag(elem || {});
            return nodeName && (nodeName === "input" && elem.type === "text" || nodeName === "textarea" || elem.contentEditable === "true");
        },
    Severity: Major
    Found in scripts/build/ReactSelection.js and 1 other location - About 3 days to fix
    lib/ReactInputSelection.js on lines 67..145

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

    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

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

    "use strict";
    
    let ChildUpdates;
    let MorphingComponent;
    let React;
    Severity: Major
    Found in packages/render/dom/__tests__/ReactCompositeComponent-test.js - About 3 days to fix

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

      
      'use strict';
      
      const emptyFunction = function(){}
      
      
      Severity: Major
      Found in packages/render/dom/__tests__/ReactDOMInput-test.js - About 3 days to fix

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

        
        "use strict";
        
        describe("ReactChildren", () => {
            let React;
        Severity: Major
        Found in packages/core/__tests__/ReactChildren-test.js - About 2 days to fix

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

          
          'use strict';
          
          let React;
          let ReactDOM;
          Severity: Major
          Found in packages/render/dom/__tests__/ReactUpdates-test.js - About 2 days to fix

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

                it('should be called for each child in an iterable without keys', () => {
                    const threeDivIterable = {
                        '@@iterator': function () {
                            let i = 0;
                            return {
            Severity: Major
            Found in packages/core/__tests__/ReactChildren-test.js and 1 other location - About 2 days to fix
            packages/core/__tests__/ReactChildren-test.js on lines 666..715

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

            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 be called for each child in an iterable without keys', () => {
                    const threeDivIterable = {
                        '@@iterator': function () {
                            let i = 0;
                            return {
            Severity: Major
            Found in packages/core/__tests__/ReactChildren-test.js and 1 other location - About 2 days to fix
            packages/core/__tests__/ReactChildren-test.js on lines 614..663

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

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

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

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

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

            Refactorings

            Further Reading

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

            function getModernOffsets(node) {
                var selection = window.getSelection && window.getSelection();
            
                if (!selection || selection.rangeCount === 0) {
                    return null;
            Severity: Major
            Found in scripts/build/ReactSelection.js and 1 other location - About 2 days to fix
            lib/ReactInputSelection.js on lines 171..239

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

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

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

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

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

            Refactorings

            Further Reading

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

                function getModernOffsets(node) {
                    var selection = window.getSelection && window.getSelection();
            
                    if (!selection || selection.rangeCount === 0) {
                        return null;
            Severity: Major
            Found in lib/ReactInputSelection.js and 1 other location - About 2 days to fix
            scripts/build/ReactSelection.js on lines 195..263

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

            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

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

            'use strict';
            
            let React;
            let ReactDOM;
            let ReactTestUtils;
            Severity: Major
            Found in packages/render/dom/__tests__/ReactComponentLifeCycle-test.js - About 2 days to fix

              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 allow setting `value` with multiple", () => {
                    let stub = (
                      <select multiple={true} value={["giraffe", "gorilla"]} onChange={noop}>
                        <option value="monkey">A monkey!</option>
                        <option value="giraffe">A giraffe!</option>
                Severity: Major
                Found in packages/render/dom/__tests__/ReactDOMSelect-test.js and 1 other location - About 2 days to fix
                packages/render/dom/__tests__/ReactDOMSelect-test.js on lines 212..240

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

                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 allow setting `value` to __proto__ with multiple", () => {
                    let stub = (
                      <select multiple={true} value={["__proto__", "gorilla"]} onChange={noop}>
                        <option value="monkey">A monkey!</option>
                        <option value="__proto__">A __proto__!</option>
                Severity: Major
                Found in packages/render/dom/__tests__/ReactDOMSelect-test.js and 1 other location - About 2 days to fix
                packages/render/dom/__tests__/ReactDOMSelect-test.js on lines 182..210

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

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

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

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

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

                Refactorings

                Further Reading

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

                    function setModernOffsets(node, offsets) {
                        if (!window.getSelection) {
                            return;
                        }
                
                
                Severity: Major
                Found in lib/ReactInputSelection.js and 1 other location - About 1 day to fix
                scripts/build/ReactSelection.js on lines 307..343

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

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

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

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

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

                Refactorings

                Further Reading

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

                function setModernOffsets(node, offsets) {
                    if (!window.getSelection) {
                        return;
                    }
                
                
                Severity: Major
                Found in scripts/build/ReactSelection.js and 1 other location - About 1 day to fix
                lib/ReactInputSelection.js on lines 283..319

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

                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

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

                const React = require('react');
                const ReactDOM = require('react-dom');
                
                const stripEmptyValues = function(obj) {
                  const ret = {};
                Severity: Major
                Found in packages/render/dom/__tests__/ReactMultiChildReconcile-test.js - About 1 day to fix

                  Function resolve has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function resolve(child, context) {
                      while (isValidElement(child)) {
                          // Safe because we just checked it's an element.
                          let element = child;
                          let Component = element.type;
                  Severity: Minor
                  Found in packages/render/server/Renderer.js - About 1 day to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language