crane-cloud/frontend

View on GitHub
src/pages/RegisterPage/index.js

Summary

Maintainability
A
3 hrs
Test Coverage
D
61%

Function render has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

  render() {
    const {
      name,
      email,
      password,
Severity: Minor
Found in src/pages/RegisterPage/index.js - About 1 hr to fix

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 handleSubmit has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  handleSubmit(e) {
    e.preventDefault();

    const {
      name,
Severity: Minor
Found in src/pages/RegisterPage/index.js - About 55 mins to fix

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

Consider simplifying this complex logical expression.
Open

    if (
      !email ||
      !password ||
      !name ||
      !username ||
Severity: Major
Found in src/pages/RegisterPage/index.js - About 40 mins to fix

    Parsing error: require() of ES Module /usr/local/node_modules/eslint/node_modules/eslint-scope/lib/definition.js from /usr/local/node_modules/babel-eslint/lib/require-from-eslint.js not supported. Instead change the require of definition.js in /usr/local/node_modules/babel-eslint/lib/require-from-eslint.js to a dynamic import() which is available in all CommonJS modules.
    Open

    import React, { Component } from "react";
    Severity: Minor
    Found in src/pages/RegisterPage/index.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    There are no issues that match your filters.

    Category
    Status