TyrealGray/Qin.js

View on GitHub
packages/qin.js/src/core/reactorCore/Reactor.js

Summary

Maintainability
B
6 hrs
Test Coverage
F
23%

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();

Severity: Major
Found in packages/qin.js/src/core/reactorCore/Reactor.js - About 2 hrs to fix

    Avoid deeply nested control flow statements.
    Open

                                if (
                                    eventTimeInfo.dataSet[trigger.name] &&
                                    tick <
                                    eventTimeInfo.dataSet[trigger.name].time
                                ) {
    Severity: Major
    Found in packages/qin.js/src/core/reactorCore/Reactor.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                  if(trigger.rate && !checkChanceByTicker({seed: gameInfo.seed, time: tick}, trigger.rate)){
                                      continue;
                                  }
      Severity: Major
      Found in packages/qin.js/src/core/reactorCore/Reactor.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                    if (
                                        trigger.triggerLimit &&
                                        !eventTimeInfo.dataSet[trigger.name]
                                    ) {
                                        await this._store.dispatch({
        Severity: Major
        Found in packages/qin.js/src/core/reactorCore/Reactor.js - About 45 mins to fix

          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,
          Severity: Major
          Found in packages/qin.js/src/core/reactorCore/Reactor.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                        if (!conditionInfo) {
                                            continue;
                                        }
            Severity: Major
            Found in packages/qin.js/src/core/reactorCore/Reactor.js - About 45 mins to fix

              There are no issues that match your filters.

              Category
              Status