18F/cg-dashboard

View on GitHub

Showing 107 of 108 total issues

Avoid too many return statements within this function.
Open

  return entityHealth.unknown;
Severity: Major
Found in static_src/util/health.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

          return { message: `Total exceeds ${max}`, type: "NUMBER_MAX" };
    Severity: Major
    Found in static_src/util/validators.js - About 30 mins to fix

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

        render() {
          const space = this.props.space;
          const appsContent =
            space.apps && space.apps.length > 0 ? (
              <ComplexList>
      Severity: Minor
      Found in static_src/components/space_quicklook.jsx - About 25 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

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

        render() {
          const app = this.props.app;
          const info = [];
      
          if (this.props.extraInfo.includes("state")) {
      Severity: Minor
      Found in static_src/components/app_quicklook.jsx - About 25 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

      Function emptyState has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

        get emptyState() {
          let content;
          let callout;
      
          if (this.state.currentUserCanViewSpace) {
      Severity: Minor
      Found in static_src/components/org_container.jsx - About 25 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

      Function getRouteURLForApp has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

        getRouteURLForApp(app) {
          const allRoutes = this.getAll();
          const boundRoutes = allRoutes.filter(route => route.app_guid === app.guid);
          let url;
          if (boundRoutes.length) {
      Severity: Minor
      Found in static_src/stores/route_store.js - About 25 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

      Function getInstanceState has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

        getInstanceState(serviceInstance) {
          const lastOp = serviceInstance.last_operation;
          if (!lastOp) return OPERATION_RUNNING;
      
          if (lastOp.state === "failed") {
      Severity: Minor
      Found in static_src/stores/service_instance_store.js - About 25 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

      Severity
      Category
      Status
      Source
      Language