Showing 10 of 52 total issues
Function withForm
has 354 lines of code (exceeds 25 allowed). Consider refactoring. Open
const withForm = (input, handlers, errors) => BaseComponent => {
const factory = createFactory(BaseComponent);
class WithForm extends Component {
constructor(props) {
File WithForm.test.js
has 698 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import Enzyme, { mount } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import { compose, withState, withHandlers } from 'recompose';
File index.js
has 358 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { createFactory, Component } from 'react';
const withForm = (input, handlers, errors) => BaseComponent => {
const factory = createFactory(BaseComponent);
File withForm.js
has 270 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { compose, withState, withProps, pure } from 'recompose';
import { withForm } from '../src/index';
const WithForm = ({
Function withForm
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
const withForm = (input, handlers, errors) => BaseComponent => {
const factory = createFactory(BaseComponent);
class WithForm extends Component {
constructor(props) {
- 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 withErrors
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
const withErrors = (input = {}, component) => BaseComponent => {
const factoryError = createFactory(component);
const factory = createFactory(BaseComponent);
class withErrorClass extends Component {
Function waitFor
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
const waitFor = (input, loadingComponent) => BaseComponent => {
const factory = createFactory(BaseComponent);
const factoryLoading = createFactory(loadingComponent);
class WaitFor extends Component {
Function withErrors
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
const withErrors = (input = {}, component) => BaseComponent => {
const factoryError = createFactory(component);
const factory = createFactory(BaseComponent);
class withErrorClass extends Component {
- 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 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
form,
formError,
formFieldsWithErrors,
Function waitFor
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const waitFor = (input, loadingComponent) => BaseComponent => {
const factory = createFactory(BaseComponent);
const factoryLoading = createFactory(loadingComponent);
class WaitFor extends Component {
- 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"