ContainerHQ/arkis-api

View on GitHub

Showing 22 of 56 total issues

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

module.exports = function(sequelize, DataTypes) {
  let { attributes, options } = concerns.extend({
    attributes: {
      id: {
        type: DataTypes.UUID,
Severity: Major
Found in app/models/node.js - About 1 day to fix

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

    module.exports = function(sequelize, DataTypes) {
      let { attributes, options } = concerns.extend({
        attributes: {
          id: {
            type: DataTypes.UUID,
    Severity: Major
    Found in app/models/cluster.js - About 5 hrs to fix

      Function up has 117 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        up: function (queryInterface, DataTypes) {
          return queryInterface.createTable('Nodes', {
            id: {
              type: DataTypes.UUID,
              primaryKey: true,
      Severity: Major
      Found in migrations/20150617102839-create-nodes-migration.js - About 4 hrs to fix

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

        module.exports = function(sequelize, DataTypes) {
          let { attributes, options } = concerns.extend({
            attributes: {
              id: {
                type: DataTypes.INTEGER,
        Severity: Major
        Found in app/models/user.js - About 3 hrs to fix

          Function up has 62 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            up: function (queryInterface, DataTypes) {
              return queryInterface.createTable('Clusters', {
                id: {
                  type: DataTypes.UUID,
                  primaryKey: true,
          Severity: Major
          Found in migrations/20150616120728-create-clusters-migration.js - About 2 hrs to fix

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

            module.exports = function(sequelize, DataTypes) {
              let { attributes, options } = concerns.extend({
                attributes: {
                  id: {
                    type: DataTypes.UUID,
            Severity: Major
            Found in app/models/action.js - About 2 hrs to fix

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

              module.exports = function(sequelize, DataTypes) {
                let { attributes, options } = concerns.extend({
                  attributes: {
                    id: {
                      type: DataTypes.UUID,
              Severity: Minor
              Found in app/models/node.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 up has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                up: function (queryInterface, DataTypes) {
                  return queryInterface.createTable('Users', {
                    id: {
                      type: DataTypes.INTEGER,
                      primaryKey: true,
              Severity: Major
              Found in migrations/20150528143545-create-users-migration.js - About 2 hrs to fix

                Function up has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  up: function (queryInterface, DataTypes) {
                    return queryInterface.createTable('Actions', {
                      id: {
                        type: DataTypes.UUID,
                        primaryKey: true,
                Severity: Minor
                Found in migrations/20150831115051-create-actions-migration.js - About 1 hr to fix

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

                    getSizes() {
                      return Promise.resolve([{
                        slug: '48gb',
                        memory: 49152,
                        disk: 480,
                  Severity: Minor
                  Found in app/connectors/fakes/machine.js - About 1 hr to fix

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

                    module.exports = function(req, res, next) {
                      req.docker = CURRENT_DOCKER;
                      res.docker = function(opts={}, callback=opts) {
                        let stream = opts.stream || false,
                          type = opts.type || 'application/json',
                    Severity: Minor
                    Found in app/middlewares/docker.js - About 1 hr to fix

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

                        up: function (queryInterface, DataTypes) {
                          return queryInterface.createTable('Profiles', {
                            id: {
                              type: DataTypes.INTEGER,
                              primaryKey: true,
                      Severity: Minor
                      Found in migrations/20150604151434-create-profiles-migration.js - About 1 hr to fix

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

                          static _createCertificate({ type, key, ca }) {
                            return new Promise((resolve, reject) => {
                              let options = _.merge({
                                clientKey: key,
                                clientKeyPassword: config.secrets.ssl,
                        Severity: Minor
                        Found in app/connectors/cert.js - About 1 hr to fix

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

                          module.exports = function(req, res, next) {
                            req.pagination = {
                              limit:  parseInt(req.query.limit  || DEFAULT_LIMIT),
                              offset: parseInt(req.query.offset || DEFAULT_OFFSET),
                              group:  ['id']
                          Severity: Minor
                          Found in app/middlewares/pagination.js - About 1 hr to fix

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

                              up: function (queryInterface, DataTypes) {
                                return queryInterface.createTable('UserProviderLinks', {
                                  id: {
                                    type: DataTypes.INTEGER,
                                    primaryKey: true,
                            Severity: Minor
                            Found in migrations/20151006033215-create-user-provider-link-migration.js - About 1 hr to fix

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

                              module.exports = function(sequelize, DataTypes) {
                                let { attributes, options } = concerns.extend({
                                  attributes: {
                                   id: {
                                     type: DataTypes.INTEGER,
                              Severity: Minor
                              Found in app/models/profile.js - About 1 hr to fix

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

                                  infos() {
                                    return this.node.getCluster().then(cluster => {
                                      return {
                                        docker: {
                                          port:    config.agent.ports.docker,
                                Severity: Minor
                                Found in app/services/agent_manager.js - About 1 hr to fix

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

                                  module.exports = function(sequelize, DataTypes) {
                                    return sequelize.define('UserProviderLink', {
                                      id: {
                                        type: DataTypes.INTEGER,
                                        primaryKey: true,
                                  Severity: Minor
                                  Found in app/models/user_providers_link.js - About 1 hr to fix

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

                                    module.exports = function(req, res, next) {
                                      res.notFound = function() {
                                        res.status(404).json({
                                          name: 'not_found',
                                          message: 'The requested resource cannot be found.'
                                    Severity: Minor
                                    Found in app/middlewares/res_handler.js - About 1 hr to fix

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

                                        destroy() {
                                          return sequelize.transaction(t => {
                                            let options = { transaction: t }, deletionErrors = [];
                                      
                                            return this.getClusterManagers(options).then(managers => {
                                      Severity: Minor
                                      Found in app/services/account_manager.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language