MitocGroup/deep-framework

View on GitHub

Showing 114 of 117 total issues

Function _applyRumDecorator has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  _applyRumDecorator(method, eventName) {
    return (...args) => {
      if (!this.model.logService) {
        return method(...args);
      }
Severity: Minor
Found in src/deep-db/lib/Vogels/ExtendModel.js - About 1 hr to fix

    Function saveToken has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      saveToken(token) {
        return new Promise(
          (resolve, reject) => {
            this._createOrGetDataset((error, dataset) => {
              if (error) {
    Severity: Minor
    Found in src/deep-security/lib/TokenManager.js - About 1 hr to fix

      Function list has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        static list() {
          return [
            Service.ANY,
            Service.LAMBDA,
            Service.SIMPLE_STORAGE_SERVICE,
      Severity: Minor
      Found in src/deep-core/lib/AWS/Service.js - About 1 hr to fix

        Function getPayloadError has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

          static getPayloadError(payload) {
            if (payload.hasOwnProperty('errorMessage')) {
              let error = null;
        
              if (LambdaResponse.isValidationError(payload)) {
        Severity: Minor
        Found in src/deep-resource/lib/Resource/LambdaResponse.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 _registerQueryWrappers has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

          _registerQueryWrappers() {
            this._model.setPartition = function(partition) {
              this[ExtendModel.PARTITION_KEY] = partition;
            };
        
        
        Severity: Minor
        Found in src/deep-db/lib/Vogels/ExtendModel.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 _createAws4SignedRequest has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

          _createAws4SignedRequest(url, httpMethod, payload, headers, callback) {
            let parsedUrl = urlParse(url, qs);
            let apiHost = parsedUrl.hostname;
            let apiPath = parsedUrl.pathname ? parsedUrl.pathname : '/';
        
        
        Severity: Minor
        Found in src/deep-resource/lib/Resource/Request.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 getPayloadError has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          static getPayloadError(payload) {
            if (payload.hasOwnProperty('errorMessage')) {
              let error = null;
        
              if (LambdaResponse.isValidationError(payload)) {
        Severity: Minor
        Found in src/deep-resource/lib/Resource/LambdaResponse.js - About 1 hr to fix

          Function _createClient has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            _createClient(domainName, callback) {
              if (!this._domains.hasOwnProperty(domainName)) {
                callback(new UnknownSearchDomainException(domainName, Object.keys(this._domains)));
                return;
              }
          Severity: Minor
          Found in src/deep-search/lib/Search.js - About 1 hr to fix

            Function loadAsyncConfig has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              loadAsyncConfig(cb) {
                if (this._asyncConfigCache) {
                  cb(this._asyncConfigCache);
            
                  return this;
            Severity: Minor
            Found in src/deep-kernel/lib/Kernel.js - About 1 hr to fix

              Function log has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                log(msg, level, context) {
                  let nativeMethod = 'log';
              
                  switch (level) {
                    case Log.EMERGENCY:
              Severity: Minor
              Found in src/deep-log/lib/Driver/ConsoleDriver.js - About 1 hr to fix

                Function _saveResponseToCache has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  _saveResponseToCache(response, callback = () => {}) {
                    if (!this.isCached || this.async || (this.cacheTtl === Request.TTL_INVALIDATE) || response.isError) {
                      callback(null, response);
                      return;
                    }
                Severity: Minor
                Found in src/deep-resource/lib/Resource/Request.js - About 1 hr to fix

                  Function _push has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    _push(events) {
                      if (events.length <= 0) {
                        return Promise.resolve();
                      } else if (events.length > KinesisDriver.MAX_PUT_LENGTH) {
                        return Promise.all(
                  Severity: Minor
                  Found in src/deep-event/lib/Driver/KinesisDriver.js - About 1 hr to fix

                    Function _readS3Object has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      _readS3Object(key, cb, lastModified = null) {
                        let payload = {
                          Bucket: this._bucket,
                          Key: key,
                        };
                    Severity: Minor
                    Found in src/deep-fs/lib/Registry.js - About 1 hr to fix

                      Function createErrorObject has 26 lines of code (exceeds 25 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 1 hr to fix

                        Function create has 26 lines of code (exceeds 25 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 1 hr to fix

                          Function login has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            login(providerName, identityMetadata, callback) {
                              let TokenImplementation = LocalToken;
                              let IdentityProviderImplementation = LocalIdentityProvider;
                          
                              if (!this._localBackend) {
                          Severity: Minor
                          Found in src/deep-security/lib/Security.js - About 1 hr to fix

                            Consider simplifying this complex logical expression.
                            Open

                                if (this._kernel.isBackend) {
                                  let runtimeContext = this._kernel.runtimeContext;
                            
                                  event.depthLevel = runtimeContext.getDeepFrameworkOption('lambdaDepthLevel') || 0;
                                  event.mainRequestId = runtimeContext.getDeepFrameworkOption('mainRequestId') || runtimeContext.awsRequestId;
                            Severity: Major
                            Found in src/deep-log/lib/Driver/RUM/AbstractEvent.js - About 1 hr to fix

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

                                _decodeToken(rawToken) {
                                  if (rawToken && typeof rawToken === 'string') {
                                    try {
                                      let tokenObj = JSON.parse(rawToken);
                              
                              
                              Severity: Minor
                              Found in src/deep-security/lib/TokenManager.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

                              Severity
                              Category
                              Status
                              Source
                              Language