Showing 112 of 188 total issues
File EventDelegator.ts
has 530 lines of code (exceeds 250 allowed). Consider refactoring. Open
import xs, {Stream, Subscription} from 'xstream';
import {ScopeChecker} from './ScopeChecker';
import {IsolateModule} from './IsolateModule';
import {getSelectors, isEqualNamespace} from './utils';
import {ElementFinder} from './ElementFinder';
Function makeCollection
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
export function makeCollection<S, So = any, Si = any>(
opts: CollectionOptions<S, So, Si>
) {
return function collectionComponent(sources: any) {
const name = opts.channel || 'state';
- 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
File hyperscript-helpers.ts
has 434 lines of code (exceeds 250 allowed). Consider refactoring. Open
// tslint:disable:max-file-line-count
import {h, VNode, VNodeData} from 'snabbdom';
function isValidString(param: any): boolean {
return typeof param === 'string' && param.length > 0;
File graphSerializer.ts
has 348 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* tslint:disable:max-file-line-count */
import xs, {Stream, Listener} from 'xstream';
import {DevToolEnabledSource} from '@cycle/run';
import debounce from 'xstream/extra/debounce';
import * as dagre from 'dagre';
Function checkEqual
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
function checkEqual(
completeStore: any,
assert: any,
interval: number,
comparator: any
Function optionsToSuperagent
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
export function optionsToSuperagent(rawReqOptions: RequestOptions) {
const reqOptions = preprocessReqOptions(rawReqOptions);
if (typeof reqOptions.url !== `string`) {
throw new Error(
`Please provide a \`url\` property in the request options.`
- 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 runRealtime
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
function runRealtime(
scheduler: any,
frameCallbacks: any,
currentTime: () => number,
setTime: (t: number) => void
- 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 makeClickListener
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
function makeClickListener(push: (p: string) => void) {
return function clickListener(event: MouseEvent) {
if (which(event) !== 1) {
return;
}
- 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 makeDOMDriver
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
function makeDOMDriver(
container: string | Element | DocumentFragment,
options: DOMDriverOptions = {}
): Driver<Stream<VNode>, MainDOMSource> {
checkValidContainer(container);
Function onEvent
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
private onEvent(
eventType: string,
event: Event,
passive: boolean,
bubbles = true
Function optionsToSuperagent
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function optionsToSuperagent(rawReqOptions: RequestOptions) {
const reqOptions = preprocessReqOptions(rawReqOptions);
if (typeof reqOptions.url !== `string`) {
throw new Error(
`Please provide a \`url\` property in the request options.`
Function makeCollection
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function makeCollection<S, So = any, Si = any>(
opts: CollectionOptions<S, So, Si>
) {
return function collectionComponent(sources: any) {
const name = opts.channel || 'state';
Function addEventListener
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
public addEventListener(
eventType: string,
namespace: Array<Scope>,
options: EventsFnOptions,
bubbles?: boolean
Function collectionComponent
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function collectionComponent(sources: any) {
const name = opts.channel || 'state';
const itemKey = opts.itemKey;
const itemScope = opts.itemScope || defaultItemScope;
const state$ = xs.fromObservable((sources[name] as StateSource<S>).stream);
Function renderNodeLabel
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
function renderNodeLabel(node: StreamGraphNode, zap: Zap | null, style: string): VNode {
let label = '';
if (zap) {
// MUTATION!
if (Array.isArray(zap.value)) {
- 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 createModule
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public createModule() {
const self = this;
return {
create(emptyVNode: VNode, vNode: VNode) {
const {elm, data = {}} = vNode;
- 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 comparator
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
const comparator = (a: any) => (b: any) => {
if (a.time < b.time) {
return -1;
}
- 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
File app.js
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
import xs from 'xstream'
import debounce from 'xstream/extra/debounce'
import dropUntil from 'xstream/extra/dropUntil'
import {ul, li, span, input, div, section, label} from '@cycle/dom'
import Immutable from 'immutable'
File view.ts
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {VNode, svg} from '@cycle/dom';
import {StreamGraphNode, StreamGraphEdge, Zap} from '../../graphSerializer';
import styles from './styles';
export const DIAGRAM_PADDING_H = 30;
Function DOMDriver
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function DOMDriver(vnode$: Stream<VNode>, name = 'DOM'): MainDOMSource {
domDriverInputGuard(vnode$);
const sanitation$ = xs.create<null>();
const firstRoot$ = domReady$.map(() => {