ai-labs-team/casium-devtools

View on GitHub

Showing 12 of 16 total issues

Function render has 166 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    const { messages, selected, active, replayedDeltas } = this.state;

    return (
      <div
Severity: Major
Found in src/App.tsx - About 6 hrs to fix

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

    export const dependencyTrace = (context: string, name: string, model: {}, message = {}, relay = {}) => {
    
      /**
       * Symbols cannot cross the `eval` boundary, so they need to be coerced to
       * their string equivalent.
    Severity: Minor
    Found in src/dependency-trace.ts - 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 dependencyTrace has 82 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const dependencyTrace = (context: string, name: string, model: {}, message = {}, relay = {}) => {
    
      /**
       * Symbols cannot cross the `eval` boundary, so they need to be coerced to
       * their string equivalent.
    Severity: Major
    Found in src/dependency-trace.ts - About 3 hrs to fix

      File App.tsx has 301 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import * as React from 'react';
      
      import { GenericObject } from 'casium/core';
      import * as FontAwesome from 'react-fontawesome';
      import { concat, contains, equals, head, last, isNil, merge, omit, pipe, prop, slice, takeWhile, where, nth } from 'ramda';
      Severity: Minor
      Found in src/App.tsx - About 3 hrs to fix

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

          render() {
            const { messages, selected, active, replayedDeltas } = this.state;
        
            return (
              <div
        Severity: Minor
        Found in src/App.tsx - 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 _renderMessages has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          protected _renderMessages() {
            const { selected, useDependencyTrace } = this.props;
            const { relativeTime, dependencyTraces } = this.state;
        
            const items = selected.map((msg, index) => {
        Severity: Minor
        Found in src/MessageView.tsx - About 1 hr to fix

          Function generateUnitTest has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const generateUnitTest = (messages: SerializedMessage[], initialState: GenericObject, finalState: GenericObject, traces: DependencyTrace[]) => {
            const aggregateTrace = traces.length ? traces.reduce(mergeUniquePaths, {
              model: [],
              relay: [],
              message: []
          Severity: Minor
          Found in src/test-generator.ts - About 1 hr to fix

            Function _renderMessages has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

              protected _renderMessages() {
                const { selected, useDependencyTrace } = this.props;
                const { relativeTime, dependencyTraces } = this.state;
            
                const items = selected.map((msg, index) => {
            Severity: Minor
            Found in src/MessageView.tsx - 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 generateUnitTest has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            export const generateUnitTest = (messages: SerializedMessage[], initialState: GenericObject, finalState: GenericObject, traces: DependencyTrace[]) => {
              const aggregateTrace = traces.length ? traces.reduce(mergeUniquePaths, {
                model: [],
                relay: [],
                message: []
            Severity: Minor
            Found in src/test-generator.ts - About 35 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 messageNames has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            const messageNames = (pairs: MessageTracePair[]) =>
              countConsecutive(pairs.map(([msg]) => msg.message))
                .reduce((result, [message, count], index, list) => {
                  const append = count > 1 ? `${message} (x${count})` : message;
            
            
            Severity: Minor
            Found in src/test-generator.ts - 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 timeSince has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            export const timeSince = (ts: number) => {
              const now = new Date(),
                timeStamp = new Date(ts),
                secondsPast = (now.getTime() - timeStamp.getTime()) / 1000;
            
            
            Severity: Minor
            Found in src/MessageHeading.tsx - 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 componentWillReceiveProps has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

              componentWillReceiveProps(nextProps: Props) {
                const shouldUpdateNext = nextProps.selected !== this.props.selected;
                if (shouldUpdateNext) {
                  this._updateNext(nextProps.initialState, nextProps.selected);
                }
            Severity: Minor
            Found in src/MessageView.tsx - 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