cyclejs/cycle-core

View on GitHub

Showing 188 of 188 total issues

Avoid too many return statements within this function.
Open

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

    Function createResponse$ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    export function createResponse$(reqInput: RequestInput): Stream<Response> {
      let request: any;
      return xs.create<Response>({
        start: function startResponseStream(listener) {
          try {
    Severity: Minor
    Found in http/src/http-driver.ts - About 25 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 schedule has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

      private schedule() {
        const u = this.out;
        if (!u) {
          return;
        }
    Severity: Minor
    Found in devtool/src/utils/timeSpread.ts - About 25 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 setup has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    export function setup<
      D extends MatchingDrivers<D, M>,
      M extends MatchingMain<D, M>
    >(main: M, drivers: D): CycleProgram<D, M> {
      if (typeof main !== `function`) {
    Severity: Minor
    Found in run/src/index.ts - About 25 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 scheduleAsInstant has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

      private scheduleAsInstant(instantPeriod: number) {
        this.clearInterval();
        const u = this.out;
        const q = this.queue;
    
    
    Severity: Minor
    Found in devtool/src/utils/timeSpread.ts - About 25 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 transform has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        transform: function(commit, cb) {
          if (packagesWithChangelog.indexOf(commit.scope) === -1) {
            cb();
            return;
          }
    Severity: Minor
    Found in .scripts/check-release.js - About 25 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 isDirectlyInScope has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

      public isDirectlyInScope(leaf: Element): boolean {
        const namespace = this.isolateModule.getNamespace(leaf);
        if (!namespace) {
          return false;
        }
    Severity: Minor
    Found in dom/src/ScopeChecker.ts - About 25 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 makeHTMLDriver has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    export function makeHTMLDriver(
      effect: EffectCallback,
      options: HTMLDriverOptions = {}
    ): Driver<Stream<VNode>, HTMLSource> {
      const modules = options.modules || defaultModules;
    Severity: Minor
    Found in html/src/makeHTMLDriver.ts - About 25 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

    Severity
    Category
    Status
    Source
    Language