Showing 22 of 56 total issues
Function exports
has 205 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(sequelize, DataTypes) {
let { attributes, options } = concerns.extend({
attributes: {
id: {
type: DataTypes.UUID,
Function exports
has 140 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(sequelize, DataTypes) {
let { attributes, options } = concerns.extend({
attributes: {
id: {
type: DataTypes.UUID,
Function up
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
up: function (queryInterface, DataTypes) {
return queryInterface.createTable('Nodes', {
id: {
type: DataTypes.UUID,
primaryKey: true,
Function exports
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(sequelize, DataTypes) {
let { attributes, options } = concerns.extend({
attributes: {
id: {
type: DataTypes.INTEGER,
Function up
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
up: function (queryInterface, DataTypes) {
return queryInterface.createTable('Clusters', {
id: {
type: DataTypes.UUID,
primaryKey: true,
Function exports
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(sequelize, DataTypes) {
let { attributes, options } = concerns.extend({
attributes: {
id: {
type: DataTypes.UUID,
Function exports
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function(sequelize, DataTypes) {
let { attributes, options } = concerns.extend({
attributes: {
id: {
type: DataTypes.UUID,
- Read upRead up
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
Open
up: function (queryInterface, DataTypes) {
return queryInterface.createTable('Users', {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
Function up
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
up: function (queryInterface, DataTypes) {
return queryInterface.createTable('Actions', {
id: {
type: DataTypes.UUID,
primaryKey: true,
Function getSizes
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getSizes() {
return Promise.resolve([{
slug: '48gb',
memory: 49152,
disk: 480,
Function exports
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
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',
Function up
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
up: function (queryInterface, DataTypes) {
return queryInterface.createTable('Profiles', {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
Function _createCertificate
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static _createCertificate({ type, key, ca }) {
return new Promise((resolve, reject) => {
let options = _.merge({
clientKey: key,
clientKeyPassword: config.secrets.ssl,
Function exports
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
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']
Function up
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
up: function (queryInterface, DataTypes) {
return queryInterface.createTable('UserProviderLinks', {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
Function exports
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(sequelize, DataTypes) {
let { attributes, options } = concerns.extend({
attributes: {
id: {
type: DataTypes.INTEGER,
Function infos
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
infos() {
return this.node.getCluster().then(cluster => {
return {
docker: {
port: config.agent.ports.docker,
Function exports
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(sequelize, DataTypes) {
return sequelize.define('UserProviderLink', {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
Function exports
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(req, res, next) {
res.notFound = function() {
res.status(404).json({
name: 'not_found',
message: 'The requested resource cannot be found.'
Function destroy
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
destroy() {
return sequelize.transaction(t => {
let options = { transaction: t }, deletionErrors = [];
return this.getClusterManagers(options).then(managers => {