Showing 8 of 39 total issues
File ReactFlipContainer.test.js
has 357 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { Component } from 'react';
import { mount, shallow } from 'enzyme';
import toJson from 'enzyme-to-json';
import ReactFlipContainer, { STATIC } from './ReactFlipContainer';
import ReactFlipElement from './ReactFlipElement';
File Flip.test.js
has 276 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Flip from './Flip';
const createMock = () => {
let current;
return {
Function ReactFlipElement
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
const ReactFlipElement = (options = {}) =>
BaseComponent => {
const getOptions = props =>
typeof options === 'function' ? () => options(props()) : options;
- 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 invert
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
invert() {
if (!this._first || !this._last) {
if (process.env.NODE_ENV === 'development' && this.debug) {
console.warn(
this.options.id,
Function ReactFlipElement
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
BaseComponent => {
const getOptions = props =>
typeof options === 'function' ? () => options(props()) : options;
class ReactFlipElement extends Component {
Function componentDidUpdate
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
componentDidUpdate(prevProps, prevState) {
if (shouldAnimate(this.props)) {
if (this.props !== prevProps) {
if (this.props.defer || this.props.forceDefer) {
if (!this.props.forceDefer) {
- 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 invert
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
invert() {
if (!this._first || !this._last) {
if (process.env.NODE_ENV === 'development' && this.debug) {
console.warn(
this.options.id,
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
componentWillReceiveProps(nextProps) {
if (shouldAnimate(nextProps) && this.props !== nextProps) {
if (nextProps.defer || nextProps.forceDefer) {
if (!nextProps.forceDefer) {
this.first({ deferred: false });
- 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"