videsk/mongoose-dummy

View on GitHub

Showing 9 of 9 total issues

Avoid too many return statements within this function.
Open

        else if (schema instanceof Number || schema instanceof BigInt || schema instanceof Decimal128 || instance === 'Number') return this.randomNumber(min, max);
Severity: Major
Found in src/index.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            else if (schema instanceof Schema.Types.Date || instance === 'Date') return new Date();
    Severity: Major
    Found in src/index.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              else if (schema instanceof String || schema instanceof Buffer || instance === 'String') return this.generateStringBasedOnSchemaOptions(schema.options);
      Severity: Major
      Found in src/index.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                else if (schema instanceof Boolean || instance === 'Boolean') return Math.random() < 0.5;
        Severity: Major
        Found in src/index.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  else if (schema instanceof (Schema.Types.UUID || String)) return uuid();
          Severity: Major
          Found in src/index.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    else if (schema instanceof Types.Subdocument || schema.schema?.paths || instance === 'Embedded') return this.iterate(schema.schema, {}, iteration);
            Severity: Major
            Found in src/index.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return this.constructor.getFallbackValue(schema);
              Severity: Major
              Found in src/index.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        else if (schema instanceof Schema.Types.DocumentArray || schema instanceof Schema.Types.Array || instance === 'Array') return [...Array(length)].map(() => this.getArrayItem(schema, output, filter));
                Severity: Major
                Found in src/index.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return null;
                  Severity: Major
                  Found in src/index.js - About 30 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language