Showing 85 of 714 total issues
Function render
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
type,
onConfirm,
onCancel,
Function generatePropType
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function generatePropType(type) {
switch (type.name) {
case 'func':
return 'function';
Function openDialog
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function openDialog(options = {}) {
if (!isBrowser) {
return noop;
}
Function render
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
className,
src,
alt,
Function ContentPromo
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ContentPromo = props => {
const {
contentsClassName,
className,
children,
Function render
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const menuItems = React.Children.map(this.props.children, (child, i) => {
const { onClick, ...passThroughProps } = child.props;
const onClickWithHide = () => {
this.tooltip.hide();
Function render
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const ComponentClass = this.props.componentClass;
const classes = classNames(
{
Function hide
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
hide() {
this.setState({ hidden: true });
if (this._showTimeout) {
clearTimeout(this._showTimeout);
this._showTimeout = null;
- 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 componentWillReceiveProps
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
componentWillReceiveProps(nextProps) {
super.componentWillReceiveProps && super.componentWillReceiveProps(nextProps);
if (nextProps.isActive !== this.props.isActive) {
if (this.state.visible && this.props.hideTrigger === 'custom') {
if (!nextProps.isActive) {
- 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 generatePropDescription
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function generatePropDescription(required, description, type) {
let deprecated = '';
if (type.name === 'custom') {
const deprecatedInfo = getDeprecatedInfo(type);
- 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 getOptions
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
getOptions(state, props, item, i) {
const { value, index } = props;
if (Array.isArray(value) && value.indexOf(item.value) > -1) {
// rerender
if (!state.sItems.find(selected => selected.value === item.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"
Further reading
Function generateProps
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function generateProps(props) {
const header = '## Props';
let text = `${header}
| Name | Type | Default | Description |
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { closed } = this.state;
if (closed) {
return null;
}
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let { onClose, className, prefix, closeBtn, footer, mask, style, children } = this.props;
let Header = this.renderHeader();
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { id, children, thumb, removable, onRemove, size, wrap, disabled } = this.props;
const className = classNames({
'boldrui-tag': true,
Function componentWillReceiveProps
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
componentWillReceiveProps(nextProps) {
const { selectedItems } = this.props;
const { cid, text, value } = nextProps;
if (this.isDelete || this.isAdded) {
Function Flag
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Flag = props => {
const { className, children, asset, imageWidth, imageAlignment, ...rest } = props;
const finalClassName = cxN({
'boldrui-flag__wrapper': true,
[className]: className && className.length,
Function _adjustArrowPosition
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
_adjustArrowPosition(placement, moveTo) {
if (moveTo) {
const isPositive = moveTo > 0;
const pixels = isPositive ? moveTo : -moveTo;
if (['top', 'bottom'].includes(placement)) {
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
render() {
const {
iconClassName,
className,
children,
- 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 withCloseOnEsc
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export default function withCloseOnEsc(Closable) {
return class ESCToCloseWrapper extends Component {
static propTypes = {
visible: PropTypes.bool.isRequired,
onClose: PropTypes.func.isRequired,
- 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"