MitocGroup/deep-framework

View on GitHub

Showing 114 of 117 total issues

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

  log(message, callback) {
    if (!this.enabled) {
      callback(null, null);
      return;
    }
Severity: Minor
Found in src/deep-log/lib/Driver/RumSqsDriver.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 create has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  create(type, ...args) {
    var driver;

    switch (type.toLowerCase()) {
      case 'console':
Severity: Minor
Found in src/deep-log/lib/Log.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 _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 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

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 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 _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

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 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

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 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

    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 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 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 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 microservice has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

            microservice(identifier = null) {
              if (!identifier) {
                identifier = this._config.microserviceIdentifier;
              }
          
          
          Severity: Minor
          Found in src/deep-kernel/lib/Kernel.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