Ikagaka/ghost-kernel.js

View on GitHub

Showing 17 of 118 total issues

Function _handle_other has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

  _handle_other(token: SakuraScriptToken) {
    const named = this.kernel.component(Named);
    const scope = named.scope();
    const surface = scope.surface();
    const blimp = scope.blimp();
Severity: Minor
Found in lib/controllers/SakuraScript.ts - About 4 hrs 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 _handle_balloon has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

  _handle_balloon(token: SakuraScriptToken) {
    const named = this.kernel.component(Named);
    const scope = named.scope();
    const blimp = scope.blimp();
    const shellState = this.kernel.component(ShellState);
Severity: Minor
Found in lib/controllers/SakuraScript.ts - About 4 hrs 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 _handle_balloon has 67 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  _handle_balloon(token: SakuraScriptToken) {
    const named = this.kernel.component(Named);
    const scope = named.scope();
    const blimp = scope.blimp();
    const shellState = this.kernel.component(ShellState);
Severity: Major
Found in lib/controllers/SakuraScript.ts - About 2 hrs to fix

    File SakuraScript.ts has 271 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { Named } from "cuttlebone";
    import { EventRoutingDefiner } from "lazy-event-router";
    import { SakuraScriptToken } from "sakurascript";
    import { SakuraScriptExecuter } from "sakurascript-executer";
    import { Shiorif } from "shiorif";
    Severity: Minor
    Found in lib/controllers/SakuraScript.ts - About 2 hrs to fix

      Function _handle_other has 58 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        _handle_other(token: SakuraScriptToken) {
          const named = this.kernel.component(Named);
          const scope = named.scope();
          const surface = scope.surface();
          const blimp = scope.blimp();
      Severity: Major
      Found in lib/controllers/SakuraScript.ts - About 2 hrs to fix

        Function _handle_view has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

          _handle_view(token: SakuraScriptToken) {
            const named = this.kernel.component(Named);
            const scope = named.scope();
            const surface = scope.surface();
            if (token instanceof SakuraScriptToken.Scope) {
        Severity: Minor
        Found in lib/controllers/SakuraScript.ts - About 1 hr 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 _handle_view has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          _handle_view(token: SakuraScriptToken) {
            const named = this.kernel.component(Named);
            const scope = named.scope();
            const surface = scope.surface();
            if (token instanceof SakuraScriptToken.Scope) {
        Severity: Minor
        Found in lib/controllers/SakuraScript.ts - About 1 hr to fix

          Avoid deeply nested control flow statements.
          Open

                if (handler) handler.bind(this)(token);
          Severity: Major
          Found in lib/controllers/SakuraScript.ts - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                } else if (token instanceof SakuraScriptToken.NotImplemented) {
                  return true;
                } else {
                  return false;
                }
            Severity: Major
            Found in lib/controllers/SakuraScript.ts - About 45 mins to fix

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

                _handle_wait(token: SakuraScriptToken) {
                  if (token instanceof SakuraScriptToken.SimpleWait) {
                    return true;
                  } else if (token instanceof SakuraScriptToken.PreciseWait) {
                    return true;
              Severity: Minor
              Found in lib/controllers/SakuraScript.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 _handle_state has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                _handle_state(token: SakuraScriptToken) {
                  const shellState = this.kernel.component(ShellState);
                  if (!shellState) return false;
                  if (token instanceof SakuraScriptToken.ToggleSynchronize) {
                    shellState.synchronized = shellState.synchronized ? false : token.scopes;
              Severity: Minor
              Found in lib/controllers/SakuraScript.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 true;
              Severity: Major
              Found in lib/controllers/SakuraScript.ts - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      return false;
                Severity: Major
                Found in lib/controllers/SakuraScript.ts - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return true;
                  Severity: Major
                  Found in lib/controllers/SakuraScript.ts - About 30 mins to fix

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

                      async perform() {
                        const kernelStartOperation = this.kernelStartOperation;
                        const nanikaGhostMasterDirectory = this.nanikaGhostMasterDirectory;
                        const profile = await nanikaGhostMasterDirectory.readProfile();
                        const bootCount = profile.bootCount as number || 0;
                    Severity: Minor
                    Found in lib/services/BootService.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 getShioriVersionInfo has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                      static async getShioriVersionInfo(shiorif: Shiorif) {
                        shiorif.autoConvertRequestVersion = "2.6";
                        // SHIORI/2.6 GET Versionを問い合わせる
                        const { response } = await shiorif.getVersion2();
                        const code = response.status_line.code;
                    Severity: Minor
                    Found in lib/services/VersionService.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 watchVisibility has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                      watchVisibility() {
                        if (!this.document) return;
                        // hidden プロパティおよび可視性の変更イベントの名前を設定
                        // tslint:disable-next-line strict-type-predicates
                        if (typeof this.document.hidden !== "undefined") { // Opera 12.10 や Firefox 18 以降でサポート
                    Severity: Minor
                    Found in lib/components/Visibility.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