Showing 112 of 188 total issues
Function makeScheduler
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function makeScheduler<T>(): Schedule<T> {
let schedule: Array<any> = [];
function getSchedule() {
return schedule;
Function instances$
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(acc: InternalInstances<Si>, nextState: Array<any> | any) => {
const dict = acc.dict;
if (Array.isArray(nextState)) {
const nextInstArray = Array(nextState.length) as Array<
Si & {_key: string}
Function createModule
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public createModule() {
const self = this;
return {
create(emptyVNode: VNode, vNode: VNode) {
const {elm, data = {}} = vNode;
Function runRealtime
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function runRealtime(
scheduler: any,
frameCallbacks: any,
currentTime: () => number,
setTime: (t: number) => void
Function addEventListener
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
public addEventListener(
eventType: string,
namespace: Array<Scope>,
options: EventsFnOptions,
bubbles?: boolean
- 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 renderSourceOrSinkNode
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function renderSourceOrSinkNode(node: StreamGraphNode, zaps: Array<Zap>) {
const index = zaps.map(zap => zap.id).indexOf(node.id);
const zap = index === -1 ? null : zaps[index];
const P = 5; // text padding
const hook = {
Function scrollagent
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn.scrollagent = function(options, callback) {
// Account for $.scrollspy(function)
if (typeof callback === 'undefined') {
callback = options;
options = {};
Function main
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function main(sources: any) {
const {DOM, Time} = sources;
const speed$ = DOM.select('.speed')
.events('input')
Function bubble
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private bubble(
eventType: string,
elm: Element,
rootElement: Element | undefined,
event: CycleDOMEvent,
Function instanceLens
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
function instanceLens(
itemKey: ItemKeyFn<any>,
key: string
): Lens<Array<any>, any> {
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 timeDriver
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function timeDriver(sink: any): any {
let time = 0;
const frameCallbacks: Array<any> = [];
const scheduler = makeScheduler();
Function intent
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function intent(domSource, timeSource) {
const UP_KEYCODE = 38
const DOWN_KEYCODE = 40
const ENTER_KEYCODE = 13
const TAB_KEYCODE = 9
Function renderNodeLabel
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function renderNodeLabel(node: StreamGraphNode, zap: Zap | null, style: string): VNode {
let label = '';
if (zap) {
// MUTATION!
if (Array.isArray(zap.value)) {
Function reducers
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function reducers(actions) {
const moveHighlightReducer$ = actions.moveHighlight$
.map(delta => function moveHighlightReducer(state) {
const suggestions = state.get('suggestions')
const wrapAround = x => (x + suggestions.length) % suggestions.length
Function makeThrottleAnimation
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function makeThrottleAnimation(
timeSource: any,
schedule: any,
currentTime: () => number
) {
Function makeDiagram
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function makeDiagram(
schedule: any,
currentTime: () => number,
interval: number,
setMaxTime: any
Function renderCommonNode
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function renderCommonNode(node: StreamGraphNode, zaps: Array<Zap>): VNode {
const index = zaps.map(zap => zap.id).indexOf(node.id);
const zap = index === -1 ? null : zaps[index];
return svg.g([
Function setupNonBubblingListener
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private setupNonBubblingListener(
input: NonBubblingMeta
): void {
const [_, eventType, elementFinder, destination] = input;
if (!this.origin) {
Function diagram
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
return function diagram(diagramString: string, values = {}): Stream<any> {
const characters = diagramString.split('');
const stream = xs.create();
function valueFor(character: string) {
if (character in values) {
Function throttleAnimation
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
return function throttleAnimation<T>(inputStream: Stream<T>): Stream<T> {
const source = timeSource();
const stream = xs.fromObservable(inputStream);
let animationListener: any = null;