Showing 51 of 99 total issues
Function presentCredentialAttachments
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function presentCredentialAttachments (app, credAttachments, credentials, cred) {
let isForeignApp = (attOrAddon) => attOrAddon.app.name !== app
let atts = sortBy(credAttachments,
isForeignApp,
'name',
- 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 generate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
exports.generate = (name, convert, explain) => {
return co.wrap(function * run (context, heroku) {
const host = require('./host')
const util = require('./util')
const fetcher = require('./fetcher')(heroku)
- 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 run
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function * run (context, heroku) {
const host = require('../../lib/host')()
const pgbackups = require('../../lib/pgbackups')(context, heroku)
const {sortBy} = require('lodash')
- 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
Avoid too many return
statements within this function. Open
return 'Pending'
Avoid too many return
statements within this function. Open
return 'Pending'
Avoid too many return
statements within this function. Open
if (backup.started_at) return 'Running'
Function run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function * run (context, heroku) {
const pgbackups = require('../../lib/pgbackups')(context, heroku)
const host = require('../../lib/host')()
const {sortBy} = require('lodash')
- 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 run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function * run (context, heroku) {
const fetcher = require('../lib/fetcher')(heroku)
const {app, args, flags} = context
- 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 status
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function status (backup) {
if (backup.succeeded) {
if (backup.warnings > 0) return `Finished with ${backup.warnings} warnings`
else return 'Completed'
}
- 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 run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function * run (context, heroku) {
const fetcher = require('../lib/fetcher')
const {app, args, flags} = context
const {database} = args
- 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 parseURL
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function parseURL (db) {
const url = require('url')
db = url.parse(db.match(/:\/\//) ? db : `postgres:///${db}`)
let [user, password] = db.auth ? db.auth.split(':') : []
db.user = user
- 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"