alekzonder/maf

View on GitHub

Showing 51 of 90 total issues

Function insertOne has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    insertOne (data/*, options*/) {

        return new Promise((resolve, reject) => {

            var timer = this._createTimer('insertOne');
Severity: Minor
Found in src/Model/Mongodb/index.js - About 1 hr to fix

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

    module.exports = function (di, config) {
    
        var app = express();
    
        app.di = di;
    Severity: Minor
    Found in src/Service/Application.js - About 1 hr to fix

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

          load () {
              return new Promise((resolve, reject) => {
      
                  getConfigFromConsul(this._logger, this._options)
                      .then((config) => {
      Severity: Minor
      Found in src/Service/Config/index.js - About 1 hr to fix

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

            _init () {
                var that = this;
        
                var makeSimpleStep = function (stepName) {
                    return function (value) {
        Severity: Minor
        Found in src/Chain.js - About 1 hr to fix

          Function create has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              create (data, options) {
          
                  return new Promise((resolve, reject) => {
          
                      var timer = this._createTimer(this.entity + ':create');
          Severity: Minor
          Found in src/Api/Abstract.js - About 1 hr to fix

            Function exports has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

            module.exports = function (logger) {
            
                return function (error, req, res, next) {
            
                    if (error) {
            Severity: Minor
            Found in src/express/body-parser/json-error.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 exports has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

            module.exports = function (logger, di, apiClasses, createFunctions) {
            
            
                var original = {
                    di: di,
            Severity: Minor
            Found in src/Api/createCollection/createProxy.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 insertOne has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                insertOne (data, options) {
            
                    return new Promise((resolve, reject) => {
            
                        var timer = this._createTimer('insertOne');
            Severity: Minor
            Found in src/Model/Tingodb/index.js - About 1 hr to fix

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

                  check (logger) {
              
                      if (this._entity && this._error.entity !== this._entity) {
                          return false;
                      }
              Severity: Minor
              Found in src/Error/CheckChain.js - About 1 hr to fix

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

                        helpers.badRequest = function (error) {
                
                            var message = 'Bad Request';
                            var code = null;
                            var list = [];
                Severity: Minor
                Found in src/express/response/helpers/index.js - About 1 hr to fix

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

                  module.exports = function (init) {
                  
                      return function (logger, config, originalDi) {
                  
                          return new Promise((resolve, reject) => {
                  Severity: Minor
                  Found in src/Service/Init/Di.js - About 1 hr to fix

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

                        findOneAndUpdate (filter, update, options) {
                    
                            var timer = this._createTimer('findOneAndUpdate');
                    
                            if (!options) {
                    Severity: Minor
                    Found in src/Model/Mongodb/index.js - About 1 hr to fix

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

                          findOne (filters, fields) {
                      
                              var timer = this._createTimer(this.entity + ':findOne');
                      
                              timer.data = {
                      Severity: Minor
                      Found in src/Api/Abstract.js - About 1 hr to fix

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

                        var getConsulKey = function (logger, key, options) {
                        
                            return new Promise((resolve, reject) => {
                                var url = `http://${options.host}:${options.port}/v1/kv/${key}`;
                        
                        
                        Severity: Minor
                        Found in src/Service/Config/getConfigFromConsul.js - About 1 hr to fix

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

                              post (url, body, options) {
                          
                                  return new Promise((resolve, reject) => {
                          
                                      var timer = this._createTimer('post');
                          Severity: Minor
                          Found in src/Rest/Client/index.js - About 1 hr to fix

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

                                ensureIndexes () {
                            
                                    return new Promise((resolve, reject) => {
                            
                                        if (!this._indexes) {
                            Severity: Minor
                            Found in src/Model/Tingodb/index.js - About 1 hr to fix

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

                                      helpers.forbidden = function (message, code, entity) {
                              
                                          if (message instanceof Error) {
                                              var error = message;
                              
                              
                              Severity: Minor
                              Found in src/express/response/helpers/index.js - About 1 hr to fix

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

                                    get (url, query, options) {
                                
                                        return new Promise((resolve, reject) => {
                                
                                            var timer = this._createTimer('get');
                                Severity: Minor
                                Found in src/Rest/Client/index.js - About 1 hr to fix

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

                                  module.exports = function (logger) {
                                  
                                      return function (error, req, res, next) {
                                  
                                          if (error) {
                                  Severity: Minor
                                  Found in src/express/body-parser/json-error.js - About 1 hr to fix

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

                                        find (filters, fields) {
                                    
                                            var timer = this._createTimer(this.entity + ':find');
                                    
                                            timer.data = {filters: filters, fields};
                                    Severity: Minor
                                    Found in src/Api/Abstract.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language