Showing 51 of 99 total issues
Function exports
has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (context, heroku) => ({
filesize: (size, opts = {}) => {
Object.assign(opts, {
decimalPlaces: 2,
fixedDecimals: true
- 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 29 (exceeds 5 allowed). Consider refactoring. Open
async function run (context, heroku) {
const debug = require('debug')('heroku-pg')
const fetcher = require('../lib/fetcher')(heroku)
const host = require('../lib/host')
const app = context.app
- 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 29 (exceeds 5 allowed). Consider refactoring. Open
function * run (context, heroku) {
const fetcher = require('../lib/fetcher')(heroku)
const host = require('../lib/host')
const util = require('../lib/util')
const {app, args} = 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 exports
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = heroku => {
function * attachment (app, passedDb, namespace = null) {
let db = passedDb || 'DATABASE_URL'
function matchesHelper (app, db) {
Function exports
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
module.exports = heroku => {
function * attachment (app, passedDb, namespace = null) {
let db = passedDb || 'DATABASE_URL'
function matchesHelper (app, db) {
- 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 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
function * run (context, heroku) {
const fetcher = require('../lib/fetcher')(heroku)
const {app, args} = context
const attachment = yield fetcher.attachment(app, args.database)
let current
Function list
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
function * list (context, heroku) {
const pgbackups = require('../../lib/pgbackups')(context, heroku)
const {sortBy} = require('lodash')
const host = require('../../lib/host')()
const app = context.app
Function run
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function * run (context, heroku) {
const pgbackups = require('../../lib/pgbackups')(context, heroku)
const fetcher = require('../../lib/fetcher')(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 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function run (context, heroku) {
const debug = require('debug')('heroku-pg')
const fetcher = require('../lib/fetcher')(heroku)
const host = require('../lib/host')
const app = context.app
Function run
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
function * run (context, heroku) {
const url = require('url')
const host = require('../lib/host')
const pgbackups = require('../lib/pgbackups')(context, heroku)
const fetcher = require('../lib/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 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
function * run (context, heroku) {
const url = require('url')
const host = require('../lib/host')
const pgbackups = require('../lib/pgbackups')(context, heroku)
const fetcher = require('../lib/fetcher')(heroku)
Function run
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
function * run (context, heroku) {
const fetcher = require('../lib/fetcher')(heroku)
const host = require('../lib/host')
const util = require('../lib/util')
const {app, args} = context
Function wait
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
wait: (action, transferID, interval, verbose, app) => {
if (app === undefined) {
app = context.app
}
const wait = require('co-wait')
Function run
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function * run (context, heroku) {
const pgbackups = require('../../lib/pgbackups')(context, heroku)
const {sortBy} = require('lodash')
const host = require('../../lib/host')()
const app = context.app
- 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 16 (exceeds 5 allowed). Consider refactoring. Open
function * run (context, heroku) {
const host = require('../../lib/host')
const fetcher = require('../../lib/fetcher')(heroku)
const util = require('../../lib/util')
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 attachment
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
function * attachment (app, passedDb, namespace = null) {
let db = passedDb || 'DATABASE_URL'
function matchesHelper (app, db) {
const {resolve} = require('@heroku-cli/plugin-addons')
Function waitFor
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
let waitFor = async function waitFor (db) {
let interval = parseInt(context.flags['wait-interval'])
if (!interval || interval < 0) interval = 5
let status
Function run
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function * run (context, heroku) {
const host = require('../../lib/host')
const fetcher = require('../../lib/fetcher')(heroku)
const util = require('../../lib/util')
const {app, args, flags} = context
Function run
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function * run (context, heroku) {
const pgbackups = require('../../lib/pgbackups')(context, heroku)
const fetcher = require('../../lib/fetcher')(heroku)
const host = require('../../lib/host')
const {sortBy} = require('lodash')
Function run
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function * run (context, heroku) {
const pgbackups = require('../../lib/pgbackups')(context, heroku)
const fetcher = require('../../lib/fetcher')(heroku)
const host = require('../../lib/host')