Showing 85 of 714 total issues
Function generatePropType
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function generatePropType(type) {
switch (type.name) {
case 'func':
return 'function';
- 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 locate
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function locate(anchorBoundingBox, containerBoundingBox, contentDimension, options) {
const viewport = getViewportSize();
const { anchorBoundingBoxViewport, cushion } = options;
let horizontal;
Function render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { id, subtitle, avatar } = this.props;
let { title } = this.props;
title = (
<h2
Function locate
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function locate(anchorBoundingBox, containerBoundingBox, contentDimension, options) {
const viewport = getViewportSize();
const { anchorBoundingBoxViewport, cushion } = options;
let horizontal;
Function locate
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function locate(anchorBoundingBox, containerBoundingBox, contentDimension, options) {
const viewport = getViewportSize();
const { anchorBoundingBoxViewport, cushion } = options;
let horizontal;
Function locate
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function locate(anchorBoundingBox, containerBoundingBox, contentDimension, options) {
const viewport = getViewportSize();
const { anchorBoundingBoxViewport, cushion } = options;
let horizontal;
Function componentDidUpdate
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
componentDidUpdate() {
if (this._mountNode && this.state.visible) {
const arrowPlacement = {
top: 'bottom',
left: 'right',
Function getShowModifiers
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getShowModifiers = display => {
const isDefault = str => str === 'default';
if (typeof display === 'string') {
return { [`is-${display}`]: true };
}
Function render
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
render() {
const {
isLazy,
lazyDivideFactor,
src,
- 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 show
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
show() {
if (this.props.disabled) {
return;
}
if (this._unmounted) {
- 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 getModifier
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const getModifier = modifier => {
if (modifier === true) {
return { 'has-icons-left has-icons-right': true };
} else if (typeof modifier === 'string') {
return isDirection(modifier) ? { [`has-icons-${modifier}`]: true } : {};
- 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 handleClick
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
handleClick(key: string | number) {
let { activeItems } = this.state;
if (this.props.isAccordion) {
activeItems = activeItems[0] === key ? [] : [key];
} else {
- 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 render
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { zDepth } = this.state;
const {
className,
raise,
- 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 locate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function locate(anchorBoundingBox, containerBoundingBox, contentDimension, options) {
const viewport = getViewportSize();
const { anchorBoundingBoxViewport, cushion } = options;
let horizontal;
- 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 locate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function locate(anchorBoundingBox, containerBoundingBox, contentDimension, options) {
const viewport = getViewportSize();
const { anchorBoundingBoxViewport, cushion } = options;
let horizontal;
- 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 findPositionedParent
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function findPositionedParent(elem, inclusive = false) {
function isPositioned(node) {
const cs = getComputedStyle(node);
const pos = cs.getPropertyValue('position');
return pos && pos !== 'static';
- 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 getHideModifiers
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const getHideModifiers = platform => {
if (typeof platform === 'boolean') {
return platform ? { 'is-hidden': true } : {};
}
if (typeof platform === 'string') {
- 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 _updatePosition
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_updatePosition(ref) {
if (ref && this._childNode) {
const tooltipNode = ReactDOM.findDOMNode(ref);
const style = this._calculatePosition(ref, tooltipNode);
- 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 too many return
statements within this function. Open
return null;
Function locate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function locate(anchorBoundingBox, containerBoundingBox, contentDimension, options) {
const viewport = getViewportSize();
const { anchorBoundingBoxViewport, cushion } = options;
let horizontal;
- 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"