csballz/koala-puree

View on GitHub

Showing 50 of 580 total issues

Function pureecontrollers has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
Open

exports = module.exports = function pureecontrollers(){

    return {
        setup: function* (next) {
            debug("beginning controller middleware setup");
Severity: Minor
Found in lib/controllers.js - About 1 day 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

File models.js has 521 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * This module creates a wrapper around the orientose orm
 *
 * @module lib/models
 * @link OrientoseModelPlugin
Severity: Major
Found in lib/models.js - About 1 day to fix

    Function OrientoseModelPlugin has 199 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function OrientoseModelPlugin() {
        /**
         * @class OrientoseModelPlugin
         */
        var obj = {
    Severity: Major
    Found in lib/models.js - About 7 hrs to fix

      Function buildschema has 173 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          buildschema(parent) {
              var self = this;
              parent = parent || Schema.V;
              var schema = new parent(self._props, {
                  className: this._name
      Severity: Major
      Found in lib/models.js - About 6 hrs to fix

        Function pureecontrollers has 164 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        exports = module.exports = function pureecontrollers(){
        
            return {
                setup: function* (next) {
                    debug("beginning controller middleware setup");
        Severity: Major
        Found in lib/controllers.js - About 6 hrs to fix

          Function setup has 160 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  setup: function* (next) {
                      debug("beginning controller middleware setup");
                      var app = this;
                      function* overrideMethodMiddleware(next){
                          var body, parts;
          Severity: Major
          Found in lib/controllers.js - About 6 hrs to fix

            Function constructor has 123 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              constructor(mod, config) {
                  super();
                  var closestPath = closest.sync(require("path").dirname(mod.filename));
                  this._basePath = require("path").dirname(closestPath);
                  var pkginfo = require("@shekhei/pkginfo")(mod);
            Severity: Major
            Found in index.js - About 4 hrs to fix

              Function decorate has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
              Open

              function decorate(req){
              
                  /**
                   * Intiate a login session for `user`.
                   *
              Severity: Minor
              Found in lib/passport-req.js - About 4 hrs 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 106 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              exports = module.exports = function(){
                  return {
                      setup: function *setupSIO(next) {
                          const puree = this;
                          const koaApp = puree.app;
              Severity: Major
              Found in lib/sio.js - About 4 hrs to fix

                Function OrientoseModelPlugin has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                Open

                module.exports = function OrientoseModelPlugin() {
                    /**
                     * @class OrientoseModelPlugin
                     */
                    var obj = {
                Severity: Minor
                Found in lib/models.js - About 4 hrs 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 setupSIO has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        setup: function *setupSIO(next) {
                            const puree = this;
                            const koaApp = puree.app;
                            var nsp = puree.ns || "/";
                            function handler(origHeaders) {
                Severity: Major
                Found in lib/sio.js - About 3 hrs to fix

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

                  exports = module.exports = function(){
                      return {
                          setup: function *setupSIO(next) {
                              const puree = this;
                              const koaApp = puree.app;
                  Severity: Minor
                  Found in lib/sio.js - About 3 hrs 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 setupModel has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          setup: function * setupModel(next) {
                  
                              var app = this;
                              debug(`beginning model middleware`);
                              var dburl;
                  Severity: Major
                  Found in lib/models.js - About 3 hrs to fix

                    Function start has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      start(app, forConsole) {
                          var self = this;
                          self._forConsole = forConsole;
                    
                          return new Promise(function(resolve, reject){
                    Severity: Major
                    Found in index.js - About 3 hrs to fix

                      Function buildschema has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                      Open

                          buildschema(parent) {
                              var self = this;
                              parent = parent || Schema.V;
                              var schema = new parent(self._props, {
                                  className: this._name
                      Severity: Minor
                      Found in lib/models.js - About 2 hrs 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

                      File index.js has 276 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      "use strict";
                      require("any-promise/register")("bluebird");
                      var readYaml = require("read-yaml"), extend = require("extend");
                      
                      var debug = require("debug")("koala-puree");
                      Severity: Minor
                      Found in index.js - About 2 hrs to fix

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

                        exports = module.exports = function(){
                            function advertise(self) {
                                if ( self._ad ) { self._ad.stop(); }
                                debug("Starting mdns middleware");
                                debug(self._config);
                        Severity: Minor
                        Found in lib/mdns.js - About 2 hrs 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 request has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            request: function(method, path, data, headers) {
                                debug(`calling general request helper: start`);
                                var self = this;
                                function _request(sc, path, nsp, method, data, headers, resolve, reject) {
                                    var realPath = "";
                        Severity: Major
                        Found in lib/service.js - About 2 hrs to fix

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

                          exports = module.exports = function(){
                              function advertise(self) {
                                  if ( self._ad ) { self._ad.stop(); }
                                  debug("Starting mdns middleware");
                                  debug(self._config);
                          Severity: Major
                          Found in lib/mdns.js - About 2 hrs to fix

                            Function overrideMethodMiddleware has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                        function* overrideMethodMiddleware(next){
                                            var body, parts;
                                            debug("body middleware", this.req.url);
                                    // only parse if it is form, cause if not, this is not a problem
                                            if ( /application\/x-www-form-urlencoded/.test(this.req.headers["content-type"])) {
                            Severity: Major
                            Found in lib/controllers.js - About 2 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language