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
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.
- 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 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.
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';
Function render
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { messages, selected, active, replayedDeltas } = this.state;
return (
<div
- 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 _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) => {
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: []
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) => {
- 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 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: []
- 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 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;
- 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 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;
- 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 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);
}
- 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"