cyclejs/cycle-core

View on GitHub

Showing 112 of 188 total issues

Function getVirtualListeners has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  private getVirtualListeners(
    eventType: string,
    namespace: Array<Scope>,
    exact = false,
    max?: number
Severity: Minor
Found in dom/src/EventDelegator.ts - About 45 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 showReport has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

function showReport(status) {
  var headerShown = false;
  for (var package in status) {
    if (status.hasOwnProperty(package) && status[package].increment > 0) {
      if (!headerShown) {
Severity: Minor
Found in .scripts/check-release.js - About 45 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 makeSetter has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

function makeSetter<T, R>(scope: Scope<T, R>): Setter<T, R> {
  if (typeof scope === 'string' || typeof scope === 'number') {
    return function lensSet(
      state: T | undefined,
      childState: R | undefined
Severity: Minor
Found in state/src/StateSource.ts - About 45 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 processEvent has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

function processEvent(args: any) {
  const {scheduler, done, currentTime, setTime, timeToRunTo} = args;
  const nextEvent = scheduler.peek();
  const outOfTime = nextEvent && timeToRunTo && nextEvent.time >= timeToRunTo;

Severity: Minor
Found in time/src/run-virtually.ts - About 45 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 call has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  public call(vnode: VNode | null): VNode {
    if (isDocFrag(this.rootElement)) {
      return this.wrapDocFrag(vnode === null ? [] : [vnode]);
    }
    if (vnode === null) {
Severity: Minor
Found in dom/src/VNodeWrapper.ts - About 45 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

Consider simplifying this complex logical expression.
Open

        if (
          !event.propagationHasBeenStopped &&
          dest.scopeChecker.isDirectlyInScope(elm) &&
          ((sel !== '' && elm.matches(sel)) ||
            (sel === '' && elm === rootElement))
Severity: Major
Found in dom/src/EventDelegator.ts - About 40 mins to fix

    Function makeThrottleListener has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      schedule: any,
      currentTime: () => number,
      period: number,
      listener: Listener<any>,
      state: any
    Severity: Minor
    Found in time/src/throttle.ts - About 35 mins to fix

      Function runVirtually has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        scheduler: any,
        done: any,
        currentTime: () => number,
        setTime: any,
        timeToRunTo = 0
      Severity: Minor
      Found in time/src/run-virtually.ts - About 35 mins to fix

        Function visitEdge has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          graph: dagre.graphlib.Graph,
          idTable: IdTable,
          inStream: Stream<any>,
          operator: InternalProducer,
          outStream: Stream<any>,
        Severity: Minor
        Found in devtool/src/graphSerializer.ts - About 35 mins to fix

          Function makeAssertEqual has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            timeSource: any,
            schedule: any,
            currentTime: () => number,
            interval: number,
            addAssert: any
          Severity: Minor
          Found in time/src/assert-equal.ts - About 35 mins to fix

            Function fromEvent has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              element: Element | Document,
              eventName: string,
              useCapture = false,
              preventDefault: PreventDefaultOpt = false,
              passive = false
            Severity: Minor
            Found in dom/src/fromEvent.ts - About 35 mins to fix

              Function makeDebounceListener has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                schedule: any,
                currentTime: () => number,
                debounceInterval: number,
                listener: any,
                state: any
              Severity: Minor
              Found in time/src/debounce.ts - About 35 mins to fix

                Function removeElement has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                  public removeElement(element: Element, namespace?: Array<Scope>): void {
                    if (namespace !== undefined) {
                      this.virtualListeners.delete(namespace);
                    }
                    const toRemove: Array<[string, Element]> = [];
                Severity: Minor
                Found in dom/src/EventDelegator.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 sinksAreXStream has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                function sinksAreXStream(sinks: Object | null): boolean {
                  if (sinks === null) {
                    return false;
                  }
                  for (const key in sinks) {
                Severity: Minor
                Found in devtool/src/graphSerializer.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 makeGetter has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                function makeGetter<T, R>(scope: Scope<T, R>): Getter<T, R> {
                  if (typeof scope === 'string' || typeof scope === 'number') {
                    return function lensGet(state) {
                      if (typeof state === 'undefined') {
                        return void 0;
                Severity: Minor
                Found in state/src/StateSource.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 makeThrottleAnimation has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                function makeThrottleAnimation(
                  timeSource: any,
                  schedule: any,
                  currentTime: () => number
                ) {
                Severity: Minor
                Found in time/src/throttle-animation.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 callDrivers has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                export function callDrivers<D extends Drivers>(
                  drivers: D,
                  sinkProxies: SinkProxies<D>
                ): Sources<D> {
                  const sources: Sources<D> = {} as Sources<D>;
                Severity: Minor
                Found in run/src/internals.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 _n has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                  public _n(inst: InternalInstances<Si>): void {
                    this.inst = inst;
                    const arrSinks = inst.arr;
                    const ils = this.ils;
                    const out = this.out;
                Severity: Minor
                Found in state/src/pickCombine.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

                Avoid too many return statements within this function.
                Open

                      return h(tagName, a);
                Severity: Major
                Found in dom/src/hyperscript-helpers.ts - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return;
                  Severity: Major
                  Found in history/src/captureClicks.ts - About 30 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language