Showing 18 of 54 total issues
Function getSplitsStoreModule
has a Cognitive Complexity of 113 (exceeds 5 allowed). Consider refactoring. Open
export function getSplitsStoreModule(injector: Injector): Module<SplitsState, RootState> {
const electron = injector.get(ELECTRON_INTERFACE_TOKEN);
const validator = injector.get(VALIDATOR_SERVICE_TOKEN);
return {
- 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 getSplitsStoreModule
has 472 lines of code (exceeds 300 allowed). Consider refactoring. Open
export function getSplitsStoreModule(injector: Injector): Module<SplitsState, RootState> {
const electron = injector.get(ELECTRON_INTERFACE_TOKEN);
const validator = injector.get(VALIDATOR_SERVICE_TOKEN);
return {
Function getSettingsStoreModule
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
export function getSettingsStoreModule(): Module<SettingsState, RootState> {
return {
namespaced: true,
state: {
values: {
- 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 getTimerStoreModule
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
export function getTimerStoreModule(): Module<TimerState, RootState> {
return {
namespaced: true,
state: {
status: TimerStatus.STOPPED,
- 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 getGameInfoStoreModule
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
export function getGameInfoStoreModule(): Module<GameInfoState, RootState> {
return {
namespaced: true,
state: {
name: null,
- 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 loadSettingsFromFileToStore
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public async loadSettingsFromFileToStore(store: Store<RootState>) {
const loadedSettings = this.loadJSONFromFile(this.settingsFileName);
const parsedSettings: Settings = {
splitterino: {
core: {},
- 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 loadApplicationSettingsFromFile
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public async loadApplicationSettingsFromFile(
store: Store<RootState>,
splitsFile?: string
): Promise<ApplicationSettings> {
const appSettings = this.loadJSONFromFile(this.appSettingsFileName);
- 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 getClientStore
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function getClientStore(vueRef, injector: Injector) {
vueRef.use(Vuex);
const store = new Vuex.Store<RootState>({
plugins: [
- 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 saveSettingsToFile
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public saveSettingsToFile(store: Store<RootState>) {
const flattenedSettings = {};
const settings = store.state.splitterino.settings.values;
for (const [moduleKey, modulE] of Object.entries(settings)) {
- 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 deeply nested control flow statements. Open
if (loadedSettings != null && loadedSettings[path] !== undefined) {
value = loadedSettings[path];
} else {
usedDefaultValue = true;
}
Avoid deeply nested control flow statements. Open
if (!isEqual(setting, oldValue)) {
eventHub.$emit(`setting-changed:${path}`, setting);
}
Function convertToBoolean
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function convertToBoolean(
value: any,
defaultValue: boolean = false
): boolean {
if (value == null) {
- 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 defaultValue;
Avoid too many return
statements within this function. Open
return defaultValue;
Avoid too many return
statements within this function. Open
return group.settings;
Function keyToDisplayString
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function keyToDisplayString(keyCode: string) {
switch (keyCode.toLowerCase()) {
case 'super':
switch (type()) {
case 'Darwin':
- 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 convertToNumber
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function convertToNumber(
value: any,
allowDecimals: boolean = true,
defaultValue: number = null,
): number {
- 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 keyToAcceleratorString
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function keyToAcceleratorString(keyCode: string) {
switch (keyCode.toLowerCase()) {
case 'super':
switch (type()) {
case 'Darwin':
- 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"