Showing 19 of 32 total issues
Function _update
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
async _update(delta: number, tick: number): Promise<void> {
const { terrainInfo, npcInfo, gameInfo, eventTimeInfo } = this._storeData;
const rules = await this.getRules();
Function checkCondition
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const checkCondition = (
data: Object,
conditions: Object,
condition: string,
checkCallback: (Object, Object) => boolean,
- 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 commonReact
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const commonReact = (data: Object, reaction: Object, action:{type: string, triggerBy: any, triggerTo: any, stamp: { seed: string, time: number }}): void => {
const { peeledPropArray } = peelPropsString(reaction.attribute);
let value = data;
let accessProp = null;
Function getCorrectNode
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
static getCorrectNode(
paths: Array<PathNode>,
): {
node: PathNode | null,
closedPaths: Array<PathNode>,
Function getCorrectPath
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
getCorrectPath(startNode: PathNode): Array<Grid> {
const pathNodes = startNode.getNeighbors();
const scannedPaths: Array<PathNode> = [startNode];
const correctPath = [];
Function _initMouseEvent
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
_initMouseEvent() {
this._initControllerEvent();
this._renderer.stage.mousedown = (e) => {
Function getCorrectNode
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
static getCorrectNode(
paths: Array<PathNode>,
): {
node: PathNode | null,
closedPaths: Array<PathNode>,
- 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 commonReact
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const commonReact = (data: Object, reaction: Object, action:{type: string, triggerBy: any, triggerTo: any, stamp: { seed: string, time: number }}): void => {
const { peeledPropArray } = peelPropsString(reaction.attribute);
let value = data;
let accessProp = 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 deeply nested control flow statements. Open
if (
trigger.triggerLimit &&
!eventTimeInfo.dataSet[trigger.name]
) {
await this._store.dispatch({
Avoid deeply nested control flow statements. Open
if (trigger.triggerLimit) {
await this._store.dispatch({
type: RECORD_EVENT_TIME,
name: trigger.name,
time: tick + trigger.triggerLimit,
Avoid deeply nested control flow statements. Open
if (!conditionInfo) {
continue;
}
Avoid deeply nested control flow statements. Open
if(trigger.rate && !checkChanceByTicker({seed: gameInfo.seed, time: tick}, trigger.rate)){
continue;
}
Avoid deeply nested control flow statements. Open
if (
eventTimeInfo.dataSet[trigger.name] &&
tick <
eventTimeInfo.dataSet[trigger.name].time
) {
Consider simplifying this complex logical expression. Open
if (
(onlyDirect && triggerTo?.qinId !== data.qinId)
|| blockers.includes(triggerBy.qinId)
|| (!isAny && !types.includes(triggerBy.type) && !triggers.includes(triggerBy.qinId))
) {
Consider simplifying this complex logical expression. Open
if (
(onlyDirect && triggerTo?.qinId !== data.qinId)
|| blockers.includes(triggerBy.qinId)
|| (!isAny && !types.includes(triggerBy.type) && !triggers.includes(triggerBy.qinId))
) {
Consider simplifying this complex logical expression. Open
if (
(onlyDirect && triggerTo?.qinId !== data.qinId)
|| blockers.includes(triggerBy.qinId)
|| (!isAny && !types.includes(triggerBy.type) && !triggers.includes(triggerBy.qinId))
) {
Function getCorrectPath
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
getCorrectPath(startNode: PathNode): Array<Grid> {
const pathNodes = startNode.getNeighbors();
const scannedPaths: Array<PathNode> = [startNode];
const correctPath = [];
- 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 dynamicReact
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const dynamicReact = (data: Object, reaction: Object, action:{type: string, triggerBy: any, triggerTo: any, stamp: { seed: string, time: number }}): void => {
if (typeof reaction.rate !== 'undefined' && !checkChance(data, reaction, action.stamp)) {
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 _prepareAssets
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_prepareAssets(assetsSet: Array<AnimationAssetType>) {
let loader = PIXI.Loader.shared;
loader.reset();
for (let assetsData of assetsSet) {
- 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"