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();
- 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 _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);
- 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 _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);
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";
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();
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) {
- 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 _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) {
Avoid deeply nested control flow statements. Open
if (handler) handler.bind(this)(token);
Avoid deeply nested control flow statements. Open
} else if (token instanceof SakuraScriptToken.NotImplemented) {
return true;
} else {
return false;
}
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;
- 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 _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;
- 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
Avoid too many return
statements within this function. Open
return true;
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return true;
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;
- 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 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;
- 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 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 以降でサポート
- 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"