Showing 7 of 7 total issues
File pipes.flow.ts
has 443 lines of code (exceeds 350 allowed). Consider refactoring. Open
import { IQueryPositionDurationInternal, ITimeDurationInternal } from '@autoschedule/queries-fn';
import { intersect, split, substract } from 'intervals-fn';
import * as R from 'ramda';
import { BehaviorSubject } from 'rxjs';
import { IConfig } from '../data-structures/config.interface';
Function queriesToPipelineDebug$
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const queriesToPipelineDebug$ = (config: IConfig) => (stateManager: stateManagerType) => (
queries: ReadonlyArray<IQuery>
): [
Observable<any>,
ConnectableObservable<ReadonlyArray<IPotentiality>>,
Function findMaxFinitePlacement
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
const findMaxFinitePlacement = (
toPlace: IPotentiality,
updatePP: (m: IMaterial[]) => IPotentiality[],
pressure: IPressureChunk[],
error$: BehaviorSubject<any>
Function computeContiguousPressureChunk
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const computeContiguousPressureChunk = (
potential: IPotentialitySimul,
chunks: IPressureChunk[]
): IPressureChunk | null => {
if (!chunks.length) {
Function reducePlaceToRange
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const reducePlaceToRange = (kind: 'start' | 'end') => (places: ReadonlyArray<IPotRange>) =>
places.reduce(
(acc, cur) => ({
end: cur.kind === kind || cur.kind.endsWith('after') ? cur.end : acc.end,
start: cur.kind === kind || cur.kind.endsWith('before') ? cur.start : acc.start,
- 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 findMaxFinitePlacement
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const findMaxFinitePlacement = (
toPlace: IPotentiality,
updatePP: (m: IMaterial[]) => IPotentiality[],
pressure: IPressureChunk[],
error$: BehaviorSubject<any>
- 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 adjustAreaPressure
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const adjustAreaPressure = (pot: IPotentialitySimul, places: ReadonlyArray<IPotRange>) => (
chunk: IAreaPressureChunk
): IPressureChunk => {
return places.reduce((acc, cur) => {
const computePressureFactor = computePressureFactorFn(cur, pot.pressure);
- 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"