Webfreshener/datamatic

View on GitHub

Showing 51 of 111 total issues

File search_index.js has 1754 lines of code (exceeds 250 allowed). Consider refactoring.
Open

window.esdocSearchIndex = [
  [
    "datamatic/src/model/_ajvwrapper.js~ajvwrapper",
    "class/src/Model/_ajvWrapper.js~AjvWrapper.html",
    "<span>AjvWrapper</span> <span class=\"search-result-import-path\">datamatic/src/Model/_ajvWrapper.js</span>",
Severity: Major
Found in docs/script/search_index.js - About 4 days to fix

    File SwaggerV2.js has 1607 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    export default {
        title: "A JSON Schema for Swagger 2.0 API.",
        $id: "http://swagger.io/v2/schema.json#",
        schema: "http://json-schema.org/draft-04/schema#",
        type: "object",
    Severity: Major
    Found in fixtures/SwaggerV2.js - About 4 days to fix

      File OpenAPIv3.js has 1254 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      export default {
          title: "A JSON Schema for OpenAPI 3.0.",
          $id: "http://openapis.org/v3/schema.json#",
          // schema: "http://json-schema.org/draft-04/schema#",
          type: "object",
      Severity: Major
      Found in fixtures/OpenAPIv3.js - About 3 days to fix

        File Pipe-api.test.js has 512 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import {Validator} from "./Validator";
        import {Pipeline} from "./Pipeline";
        import {basicCollection} from "../../fixtures/PropertiesModel.schemas";
        import {default as data} from "../../fixtures/pipes-test.data";
        import {default as _pipesOrSchemas} from "../../fixtures/pipes-or-schema";
        Severity: Major
        Found in src/Pipeline/Pipe-api.test.js - About 1 day to fix

          Function init has 117 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              static init(pipe, properties) {
                  const {callbacks, pipesOrVOsOrSchemas, pipes} = properties;
                  const _txP = {};
          
                  const _inPipe = (
          Severity: Major
          Found in src/Pipeline/Properties.js - About 4 hrs to fix

            File Pipeline.js has 332 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /* ############################################################################
            The MIT License (MIT)
            
            Copyright (c) 2019 Van Schroeder
            Copyright (c) 2019 Webfreshener, LLC
            Severity: Minor
            Found in src/Pipeline/Pipeline.js - About 4 hrs to fix

              Function handler has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
              Open

                  get handler() {
                      return Object.assign(super.handler, {
                          get: (t, idx) => {
                              // TODO: review for removal
                              // if (typeof idx === "symbol") {
              Severity: Minor
              Found in src/Model/itemsModel.js - About 3 hrs 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

              File itemsModel.test.js has 302 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import {Model} from "./index";
              import {default as deepEqual} from "deep-equal";
              import {
                  stringsCollection,
                  stringsMinMaxCollection,
              Severity: Minor
              Found in src/Model/itemsModel.test.js - About 3 hrs to fix

                Function next has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                    next(data) {
                        // enforces JSON formatting if feature is present
                        data = data && data.toJSON ? data.toJSON() : data;
                        const _targetProps = _pipes.get(this.target);
                        // tests for presence of rate-limit timeout
                Severity: Minor
                Found in src/Pipeline/Pipeline.js - About 3 hrs 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 init has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                    static init(pipe, properties) {
                        const {callbacks, pipesOrVOsOrSchemas, pipes} = properties;
                        const _txP = {};
                
                        const _inPipe = (
                Severity: Minor
                Found in src/Pipeline/Properties.js - About 3 hrs 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 constructor has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                    constructor(owner, schemas, options = {}) {
                        // ensures that we are given something that represents a Model object
                        if ((!owner) || !(owner instanceof Model)) {
                            throw "Model is required at arguments[0]";
                        }
                Severity: Minor
                Found in src/Model/_ajvWrapper.js - About 2 hrs 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

                BaseModel has 24 functions (exceeds 20 allowed). Consider refactoring.
                Open

                export class BaseModel {
                    constructor() {
                        createMetaDataRef(this, ...arguments);
                    }
                
                
                Severity: Minor
                Found in src/Model/base-model.js - About 2 hrs to fix

                  Function createAjv has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                  Open

                  const createAjv = (inst, schemas, opts) => {
                      const _ajv = new Ajv(opts);
                      addFormats(_ajv);
                  
                      if (schemas) {
                  Severity: Minor
                  Found in src/Model/_ajvWrapper.js - About 2 hrs 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 next has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      next(data) {
                          // enforces JSON formatting if feature is present
                          data = data && data.toJSON ? data.toJSON() : data;
                          const _targetProps = _pipes.get(this.target);
                          // tests for presence of rate-limit timeout
                  Severity: Major
                  Found in src/Pipeline/Pipeline.js - About 2 hrs to fix

                    Pipeline has 23 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    export class Pipeline {
                        static getExecs(..._pvs) {
                            return _pvs.map((_p) => {
                                _p = Array.isArray(_p) ? _p[0] : _p;
                                return (d) => {
                    Severity: Minor
                    Found in src/Pipeline/Pipeline.js - About 2 hrs to fix

                      Function castToExec has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const castToExec = (obj) => {
                          if (!obj) {
                              return DefaultPipeTx;
                          }
                      
                      
                      Severity: Major
                      Found in src/Pipeline/Utils.js - About 2 hrs to fix

                        Function constructor has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                        Open

                            constructor(schemas, ajvOptions = {}) {
                                if (_validators.get(this) === void (0)) {
                                    _validators.set(this, {});
                                }
                        
                        
                        Severity: Minor
                        Found in src/Pipeline/_ajvWrapper.js - About 2 hrs 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 toJSON has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                        Open

                            toJSON() {
                                let _derive = (itm) => {
                                    // uses toJSON impl if defined
                                    if (itm.hasOwnProperty("toJSON") &&
                                        (typeof this.toJSON) === "function") {
                        Severity: Minor
                        Found in src/Model/base-model.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 constructor has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            constructor(owner, schemas, options = {}) {
                                // ensures that we are given something that represents a Model object
                                if ((!owner) || !(owner instanceof Model)) {
                                    throw "Model is required at arguments[0]";
                                }
                        Severity: Minor
                        Found in src/Model/_ajvWrapper.js - About 1 hr to fix

                          Function handler has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              get handler() {
                                  return Object.assign(super.handler, {
                                      get: (t, idx) => {
                                          // TODO: review for removal
                                          // if (typeof idx === "symbol") {
                          Severity: Minor
                          Found in src/Model/itemsModel.js - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language