Showing 85 of 714 total issues
Function renderIcon
has 850 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderIcon(kind: string) {
switch (kind) {
default:
return null;
File Icon.js
has 874 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint-disable max-lines, max-len, react/no-unescaped-entities, complexity */
// @flow
import React, { PureComponent } from 'react';
import BaseIcon from './BaseIcon';
Function injectResetStyle
has 223 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const injectResetStyle = () => {
// eslint-disable-next-line no-unused-expressions
injectGlobal`
* {
font-size: inherit;
File Popover.test.js
has 515 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import { Simulate } from 'react-dom/test-utils';
import { mount } from 'enzyme';
import Button from '../Button';
import Popover from './';
File boldrui.test.js
has 403 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import { shallow, mount } from 'enzyme';
import * as BoldrUI from './boldrui';
File Tooltip.js
has 336 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint-disable react/no-find-dom-node, no-unused-expressions, no-return-assign */
import React, { cloneElement } from 'react';
import PropTypes from 'prop-types';
import ReactDOM from 'react-dom';
File Select.js
has 322 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* Select
*/
import React, { Component, Children } from 'react';
Function render
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
isLazy,
lazyDivideFactor,
src,
Function makeHoverLeaveRecognizer
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
Open
function makeHoverLeaveRecognizer({ leaveDelay, onLeave, isOutSide, quirk }) {
const state = makeState('leave', onLeave);
let recognizer;
let timerId;
- 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 Pop.js
has 288 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, { Component } from 'react';
import cx from 'classnames';
import noop from 'lodash.noop';
import isFunction from 'lodash.isfunction';
import PropTypes from 'prop-types';
Tooltip
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Tooltip extends BoldrComponent {
componentElements() {
const elements = super.componentElements();
return this._mountNode ? elements.concat(this._mountNode) : elements;
}
File validationRules.test.js
has 276 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import validationRules from '../validationRules';
describe('Validation-Rules', () => {
// values no use most of the time as arg[0] of validation functions
const values = {};
File Pop.test.js
has 271 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import { mount } from 'enzyme';
import { Simulate } from 'react-dom/test-utils';
import Button from '../Button';
import Pop from './';
Function render
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
cid,
selectedItems,
emptyText,
Function render
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { zDepth } = this.state;
const {
className,
raise,
Function render
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
placeholder,
maxToShow,
className,
File Popover.js
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* Design:
*
* Popover component is just a shell, responsible for assembling Trigger and Content.
*
File boldrui.js
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// @flow weak
/* eslint-disable */
import React from 'react';
import classNames from 'classnames';
import { combineModifiers, getDomSafeProps, isBetween, is, isOption } from './helpers';
Function render
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { imageSrc, onAddImage, onUpdateImage, onRemoveImage } = this.props;
const tooltipCommonProps = {
showDelay: 0,
Function withNoScroll
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function withNoScroll(Portal) {
let portalVisibleCount = 0;
let originalOverflow;
return class NonScrollableWrapper extends Component {