feathersjs/feathers-offline-realtime

View on GitHub

Showing 9 of 9 total issues

Function default has 358 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function (Replicator, desc) {
  describe(`${desc} - optimistic mutation online`, () => {
    let data;
    let fromService;
    let replicator;
Severity: Major
Found in test/commons/helpers/optimistic-mutator-online.test.js - About 1 day to fix

    Function default has 206 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function (Replicator, desc) {
      describe(`${desc} - emitters`, () => {
        let data;
        let fromService;
        let replicator;
    Severity: Major
    Found in test/commons/helpers/emitters.test.js - About 1 day to fix

      Function default has 204 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function (Replicator, desc, useUuid) {
        describe(`${desc} - mutations ${useUuid ? 'using uuid' : 'using id'}`, () => {
          let data;
          let fromService;
          let replicator;
      Severity: Major
      Found in test/commons/helpers/service-events.test.js - About 1 day to fix

        Function default has 198 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function (Replicator, desc) {
          describe(`${desc} - subscribers`, () => {
            let data;
            let fromService;
            let replicator;
        Severity: Major
        Found in test/commons/helpers/subscribers.test.js - About 7 hrs to fix

          Function default has 139 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function (Replicator, desc) {
            describe(`${desc} - snapshot`, () => {
              describe('sorts', () => {
                let dataOrder;
                let dataId;
          Severity: Major
          Found in test/commons/helpers/snapshot.test.js - About 5 hrs to fix

            File optimistic-mutator-online.test.js has 396 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            
            const assert = require('chai').assert;
            const feathers = require('feathers');
            const memory = require('feathers-memory');
            const hooks = require('feathers-hooks');
            Severity: Minor
            Found in test/commons/helpers/optimistic-mutator-online.test.js - About 5 hrs to fix

              Function _mutateStore has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                _mutateStore (eventName, remoteRecord, source) {
                  debug(`_mutateStore started: ${eventName}`);
                  const that = this;
              
                  const idName = this._useUuid ? 'uuid' : ('id' in remoteRecord ? 'id' : '_id');
              Severity: Minor
              Found in src/commons/base-engine.js - 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 default has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function (Replicator, desc, useUuid) {
                describe(`${desc} - replicator ${useUuid ? 'using uuid' : 'using id'}`, () => {
                  let data;
                  let fromService;
                  let replicator;
              Severity: Minor
              Found in test/commons/helpers/replicator.test.js - About 1 hr to fix

                Function _mutateStore has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  _mutateStore (eventName, remoteRecord, source) {
                    debug(`_mutateStore started: ${eventName}`);
                    const that = this;
                
                    const idName = this._useUuid ? 'uuid' : ('id' in remoteRecord ? 'id' : '_id');
                Severity: Minor
                Found in src/commons/base-engine.js - About 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language