cyclejs/cycle-core

View on GitHub

Showing 188 of 188 total issues

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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

        const changeHeight$ = sources.DOM.select('#height').events('input')
          .map(ev => ev.target.value);
      Severity: Minor
      Found in examples/basic/bmi-naive/src/main.js and 1 other location - About 35 mins to fix
      examples/basic/bmi-naive/src/main.js on lines 6..7

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 47.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

        const changeWeight$ = sources.DOM.select('#weight').events('input')
          .map(ev => ev.target.value);
      Severity: Minor
      Found in examples/basic/bmi-naive/src/main.js and 1 other location - About 35 mins to fix
      examples/basic/bmi-naive/src/main.js on lines 8..9

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 47.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

        if (typeof drivers !== `object` || drivers === null) {
          throw new Error(
            `Second argument given to Cycle must be an object ` +
              `with driver functions as properties.`
          );
      Severity: Minor
      Found in run/src/index.ts and 1 other location - About 35 mins to fix
      run/src/index.ts on lines 141..146

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 47.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

        if (typeof drivers !== `object` || drivers === null) {
          throw new Error(
            `Argument given to setupReusable must be an object ` +
              `with driver functions as properties.`
          );
      Severity: Minor
      Found in run/src/index.ts and 1 other location - About 35 mins to fix
      run/src/index.ts on lines 77..82

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 47.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

        const vdom$ = sources.DOM
          .select('.myinput').events('input')
          .map(ev => ev.target.value)
          .startWith('')
      Severity: Minor
      Found in examples/basic/hello-world/src/main.js and 1 other location - About 35 mins to fix
      examples/basic/checkbox/src/main.js on lines 5..8

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 46.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

        const vdom$ = sources.DOM
          .select('input').events('change')
          .map(ev => ev.target.checked)
          .startWith(false)
      Severity: Minor
      Found in examples/basic/checkbox/src/main.js and 1 other location - About 35 mins to fix
      examples/basic/hello-world/src/main.js on lines 5..8

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 46.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      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

          Avoid too many return statements within this function.
          Open

                return h(tagName, a, b);
          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

              Avoid too many return statements within this function.
              Open

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

                Avoid too many return statements within this function.
                Open

                      return h(tagName, {});
                Severity: Major
                Found in dom/src/hyperscript-helpers.ts - About 30 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language