Showing 8 of 327 total issues
Function render
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { fields, meta: { touched, error, submitFailed } } = this.props;
const currentStep = fields.get(this.state.currentStep);
const limit = +_.get(currentStep, 'limit');
Function render
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { classwork, answers, students, classRoom } = this.props;
const getAnswersByStudent = (answers, student) => _.filter(answers, ['student._id', student._id]);
Function render
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const colSpan = (
1 +
(this.props.withCreatedAt ? 1 : 0) +
React.Children.count(this.props.children)
Function createEntityReducer
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
const createEntityReducer = entityName => (state = initialValue, { type, payload }) => {
if (type === `${entityName}_FETCH_REQUESTED`) {
return {
loaded: false,
isLoading: 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 render
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return (
<Fragment>
<AddButton className="mb-2 mr-1" onClick={this.toggle} />
<Modal isOpen={this.state.modal} toggle={this.toggle} backdrop="static">
Function solutionIsValid
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
const solutionIsValid = currentStep => solution => {
if (solution) {
const lettersFromSolution = symbolParser.parse(solution);
if (lettersFromSolution.some(letter => !currentStep.symbols.includes(letter))) {
- 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
Open
return state;
Avoid too many return
statements within this function. Open
Open
return {
...state,
entities: [
...entities,
{ ...entity, ...payload },