MitocGroup/deep-framework

View on GitHub

Showing 117 of 117 total issues

Function _parseExternal has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

  _parseExternal() {
    let data = this._rawData;
    let error = this._rawError;

    if (error) {
Severity: Minor
Found in src/deep-resource/lib/Resource/SuperagentResponse.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 loadLambdaCredentials has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  loadLambdaCredentials() {
    return new Promise(
      (resolve, reject) => {
        this._cacheService.get('credentialsCache', (error, credentialsCache) => {
          if (error && error.name !== 'MissingCacheException') {
Severity: Minor
Found in src/deep-security/lib/Token.js - About 1 hr to fix

    Function _normalizeIdentityMetadata has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      _normalizeIdentityMetadata(providerName, identityMetadata) {
        let token = null;
        let expiresIn  = null;
        let expireTime = null;
        let userId = null;
    Severity: Minor
    Found in src/deep-security/lib/IdentityProvider.js - About 1 hr to fix

      Function listContents has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            listContents: (pathStr, marker, callback = null) => {
              let absPath = path.join(this.cwd, pathStr);
      
              let globResponseObj = {
                Marker: marker,
      Severity: Minor
      Found in src/deep-fs/lib/Local/S3FSRelativeFSExtender.js - About 1 hr to fix

        Function _parseLambda has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          _parseLambda() {
            this._parseExternal();
        
            // check if any Lambda response available
            if (this._data) {
        Severity: Minor
        Found in src/deep-resource/lib/Resource/SuperagentResponse.js - About 1 hr to fix

          Function getFolder has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            getFolder(name, msIdentifier = null) {
              if (FS.FOLDERS.indexOf(name) === -1) {
                throw new UnknownFolderException(name, FS.FOLDERS);
              }
          
          
          Severity: Minor
          Found in src/deep-fs/lib/FS.js - About 1 hr to fix

            Function _registerQueryWrappers has 37 lines of code (exceeds 25 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

              Function _rawModelsToSchemas has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                _rawModelsToSchemas(rawModels) {
                  let modelsSchema = {};
              
                  for (let modelKey in rawModels) {
                    if (!rawModels.hasOwnProperty(modelKey)) {
              Severity: Minor
              Found in src/deep-validation/lib/Validation.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 proxyOverride has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                proxyOverride(handler, ...explMethods) {
                  let methods = Object.keys(handler).concat(explMethods);
              
                  for (let i in methods) {
                    if (!methods.hasOwnProperty(i)) {
              Severity: Minor
              Found in src/deep-core/lib/Generic/MethodsProxy.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 run has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                run(event, context, lambdaCallback = null) {
                  this._context = new Context(context);
                  this._request = new Request(event);
              
                  if (lambdaCallback) {
              Severity: Minor
              Found in src/deep-core/lib/AWS/Lambda/Runtime.js - About 1 hr to fix

                Function boot has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  boot(kernel, callback) {
                    this._nonPartitionedModels = kernel.config.nonPartitionedModels || [];
                    this._schemas = this._rawModelsToSchemas(kernel.config.models);
                
                    let universalRequire = new Core.Generic.UniversalRequire();
                Severity: Minor
                Found in src/deep-validation/lib/Validation.js - About 1 hr to fix

                  Function bootstrap has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    bootstrap(callback) {
                      let rumEvent = {
                        service: 'deep-kernel',
                        resourceType: 'Lambda',
                        eventName: 'KernelLoad',
                  Severity: Minor
                  Found in src/deep-kernel/lib/Kernel.js - About 1 hr to fix

                    Function onload has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        request.onload = function (deps, count) {
                          if (request.status == 200 || module.t) {
                            // Should really use an object and then Object.keys to avoid
                            // duplicate dependencies. But that costs bytes.
                            deps = [];
                    Severity: Minor
                    Found in src/deep-core/lib/Generic/require1k.js - About 1 hr to fix

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

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

                          Function _findUntilLimit has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                _findUntilLimit(query, limit, _scannedCount = 0, _accumulator = [], _lastKey = null) {
                                  return new Promise((resolve, reject) => {
                                    if (_lastKey) {
                                      query.startKey(_lastKey);
                                    }
                          Severity: Minor
                          Found in src/deep-db/lib/Vogels/ExtendModel.js - About 1 hr to fix

                            Function _sendThroughApi has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              _sendThroughApi(callback = () => {}) {
                                let endpoint = this.action.source.api;
                                let headers = {};
                            
                                let sendRequestFunc = (request) => {
                            Severity: Minor
                            Found in src/deep-resource/lib/Resource/Request.js - About 1 hr to fix

                              Function boot has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                boot(kernel, callback) {
                                  let resourcesVector = [];
                              
                                  for (let microserviceKey in kernel.microservices) {
                                    if (!kernel.microservices.hasOwnProperty(microserviceKey)) {
                              Severity: Minor
                              Found in src/deep-resource/lib/Resource.js - About 1 hr to fix

                                Function _start has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  _start(cb) {
                                    let cbTriggered = false;
                                
                                    // avoid local-dynamo package issues...
                                    fse.ensureDirSync(this.path);
                                Severity: Minor
                                Found in src/deep-db/lib/Local/Driver/LocalDynamo.js - About 1 hr to fix

                                  Function _loadResponseFromCache has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    _loadResponseFromCache(driver, key, callback) {
                                      driver.has(key, (err, has) => {
                                        if(err) {
                                          callback(new CachedRequestException(`Error to check if has in cache key ${key}`));
                                          return;
                                  Severity: Minor
                                  Found in src/deep-resource/lib/Resource/Request.js - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language