Function updateOptions
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
export function updateOptions(node, multiple, propValue, setDefaultSelected) {
var options = node.options;
if (multiple) {
var selectedValues = propValue;
- Read upRead up
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
File duplex.js
has 303 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { typeNumber, emptyObject } from "react-core/util";
function getSafeValue(value) {
switch (typeNumber(value)) {
case 2:
Function fireDuplex
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
export function fireDuplex() {
var radioMap = {};
if (duplexNodes.length) {
do {
let dom = duplexNodes.shift();
- Read upRead up
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
Function update
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
update(node, props) {
if (props.checked != null) {
syncValue(node, "checked", !!props.checked);
}
const isActive = node === node.ownerDocument.activeElement;
- Read upRead up
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
Function updateOptions
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function updateOptions(node, multiple, propValue, setDefaultSelected) {
var options = node.options;
if (multiple) {
var selectedValues = propValue;
Function update
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
update(node, props) {
if (props.checked != null) {
syncValue(node, "checked", !!props.checked);
}
const isActive = node === node.ownerDocument.activeElement;
Function fireDuplex
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function fireDuplex() {
var radioMap = {};
if (duplexNodes.length) {
do {
let dom = duplexNodes.shift();
Function update
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
update(node, props) {
// mount后这个属性没用
node._wrapperState.initialValue = void 666;
let wasMultiple = node._wrapperState.wasMultiple;
- Read upRead up
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
Avoid deeply nested control flow statements. Open
if (value != null) {
updateOptions(dom, !!props.multiple, value, false);
}
Avoid deeply nested control flow statements. Open
if (
props.type === "radio" &&
name != null &&
!radioMap[name]
) {
Function mount
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
mount(node, props, state) {
if (
props.hasOwnProperty("value") ||
props.hasOwnProperty("defaultValue")
) {
- Read upRead up
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
Function update
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
update(node, props) {
let value = props.value;
if (value != null) {
let newValue = "" + value;
if (newValue !== node.value) {
- Read upRead up
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"