MitocGroup/deep-framework

View on GitHub

Showing 114 of 117 total issues

Function _load has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  _load(endpoint = null) {
    this._endpoint = endpoint || this._endpoint;

    if (this._enforceRoot && !/^http|\//i.test(this._endpoint)) {
      this._endpoint = `/${this._endpoint}`;
Severity: Minor
Found in src/deep-kernel/lib/Config/Driver/HttpDriver.js - About 55 mins 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 boot has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  boot(kernel, callback) {
    this._buildId = kernel.buildId;

    if (kernel.isFrontend) {
      let loadVector = [];
Severity: Minor
Found in src/deep-asset/lib/Asset.js - About 55 mins 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 _transform has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  static _transform(obj) {
    let transObj = {};

    for (let property in obj) {
      if (!obj.hasOwnProperty(property)) {
Severity: Minor
Found in src/deep-validation/lib/ObjectToJoi.js - About 55 mins 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 proxy has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  proxy() {
    let proxy = {};

    for (let property in this._originalInstance) {
      if (typeof this._originalInstance[property] === 'function') {
Severity: Minor
Found in src/deep-fs/lib/S3FsRumProxy.js - About 45 mins 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 _decodePayload has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  _decodePayload() {
    let decodedPayload = null;

    if (this._rawData) {
      if (this._rawData.Payload) {
Severity: Minor
Found in src/deep-resource/lib/Resource/LambdaResponse.js - About 45 mins 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 8 (exceeds 5 allowed). Consider refactoring.
Open

  constructor(...abstractMethods) {
    let methods = abstractMethods.length === 1 && abstractMethods[0] instanceof Array
      ? abstractMethods[0]
      : abstractMethods;

Severity: Minor
Found in src/deep-core/lib/OOP/Interface.js - About 45 mins 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 getSitePlatform has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  getSitePlatform(defaultValue = 'custom') {
    const metaGenerator = this._findMetaContent('generator');
    
    if (metaGenerator.length <= 0) {
      return defaultValue;
Severity: Minor
Found in src/deep-event/lib/Context/Frontend/ClientSession.js - About 45 mins 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 _isEnabledForTable has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  _isEnabledForTable(tableName) {
    for (let modelName in this._modelsToExtend) {
      if (!this._modelsToExtend.hasOwnProperty(modelName)) {
        continue;
      }
Severity: Minor
Found in src/deep-db/lib/DynamoDB/EventualConsistency.js - About 45 mins 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

Avoid deeply nested control flow statements.
Open

          if (this.kernel && this.kernel.isRumEnabled) {
            s3Fs = new S3FsRumProxy(s3Fs, this.kernel.get('log')).proxy();
          }
Severity: Major
Found in src/deep-fs/lib/FS.js - About 45 mins to fix

    Function _rawModelsVector has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      _rawModelsVector(rawModels) {
        let modelsVector = [];
    
        for (let modelKey in rawModels) {
          if (!rawModels.hasOwnProperty(modelKey)) {
    Severity: Minor
    Found in src/deep-db/lib/DB.js - About 45 mins 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 getAppropriateAwsRegion has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      static getAppropriateAwsRegion(defaultRegion, availableRegions) {
        if (availableRegions.indexOf(defaultRegion) !== -1) {
          return defaultRegion;
        }
    
    
    Severity: Minor
    Found in src/deep-core/lib/AWS/Region.js - About 45 mins 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 extract has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      extract() {
        let actions = this._action.count() > 0 ? this._action.extract() : Policy.ANY;
        let resources = this._resource.count() > 0 ? this._resource.extract() : null;
    
        let statement = {
    Severity: Minor
    Found in src/deep-core/lib/AWS/IAM/Statement.js - About 45 mins 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 find has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      find(thing, strict = false) {
        for (let objectKey in this._vector) {
          if (!this._vector.hasOwnProperty(objectKey)) {
            continue;
          }
    Severity: Minor
    Found in src/deep-core/lib/Generic/ObjectStorage.js - About 45 mins 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

    Consider simplifying this complex logical expression.
    Open

          if (this._error && typeof this._error === 'object' 
            && this._error.crossDomain 
            && typeof this._error.crossDomain.status === 'undefined') {
              
            this._statusCode = 403;
    Severity: Major
    Found in src/deep-resource/lib/Resource/SuperagentResponse.js - About 40 mins to fix

      Function findAllByPaginated has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

            findAllByPaginated: function(fieldName, value, startKey, limit, cb) {
      Severity: Minor
      Found in src/deep-db/lib/Vogels/ExtendModel.js - About 35 mins to fix

        Function _findUntilLimit has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

              _findUntilLimit(query, limit, _scannedCount = 0, _accumulator = [], _lastKey = null) {
        Severity: Minor
        Found in src/deep-db/lib/Vogels/ExtendModel.js - About 35 mins to fix

          Function getUser has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

            getUser(callback) {
              // @todo: backward compatibility hook, remove on next major release
              let argsHandler = (error, user) => {
                if (callback.length === 1) {
                  if (error) {
          Severity: Minor
          Found in src/deep-security/lib/Token.js - About 35 mins 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 createErrorObject has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

            static createErrorObject(error) {
              let errorObj = {};
              let errorCode = Exception.DEFAULT_CODE;
          
              if (error.name === 'ValidationError') { // we assume it's a joi validation error
          Severity: Minor
          Found in src/deep-core/lib/AWS/Lambda/ErrorResponse.js - About 35 mins 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 getProviderDomain has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

            getProviderDomain(providerName, providers) {
              let domainRegexp;
          
              switch(providerName) {
                case IdentityProvider.AMAZON_PROVIDER:
          Severity: Minor
          Found in src/deep-security/lib/IdentityProvider.js - About 35 mins 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 generate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

            static generate(ensureUnique = true) {
              this._uuids = this._uuids || [];
          
              let date = new Date().getTime();
          
          
          Severity: Minor
          Found in src/deep-event/lib/Driver/Kinesis/UUID.js - About 25 mins 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

          Severity
          Category
          Status
          Source
          Language