crane-cloud/frontend

View on GitHub
src/components/CreateApp/index.js

Summary

Maintainability
C
1 day
Test Coverage
F
20%

CreateApp has 37 functions (exceeds 20 allowed). Consider refactoring.
Open

class CreateApp extends React.Component {
  constructor(props) {
    super(props);

    const {
Severity: Minor
Found in src/components/CreateApp/index.js - About 4 hrs to fix

    Function handleSubmit has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

      handleSubmit() {
        const {
          name,
          uri,
          envVars,
    Severity: Minor
    Found in src/components/CreateApp/index.js - About 4 hrs 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 render has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      render() {
        const {
          params: { projectID },
          data: { beta },
          clusters: { clusters },
    Severity: Minor
    Found in src/components/CreateApp/index.js - About 45 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

    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 from "react";
    Severity: Minor
    Found in src/components/CreateApp/index.js by eslint

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

    There are no issues that match your filters.

    Category
    Status