Showing 14 of 58 total issues
Function updateFunction
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function updateFunction (oldFunction, wantedFunction) {
debug('updateFunction', oldFunction, wantedFunction)
await loadRegion()
const lambda = new AWS.Lambda()
const { FunctionName } = oldFunction
Function runFunction
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function runFunction (opts) {
require('dotenv').config()
return async (name) => {
const env = opts.environment || 'development'
const performBuild = opts.build
Function default
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function (config) {
const id = uuid.v1()
const stream = uuid.v4().replace(/-/g, '')
const timeout = config.Timeout || 10
Function default
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export default async function ({ apiId, api: deployApi = true, functions = '*', env = 'development', region, bucket, build = true, logger = () => {} }) {
const api = await load.api()
let uploadFuncs, aliases
- 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 handler
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export async function handler (opts) {
const envs = await load.envs()
const questions = [
{
name: 'env',
- 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 webpack
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function webpack () {
return `/*
* WARNING: Tampering with how entry is populated could affect pattern matching
*/
Function updateFunction
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export async function updateFunction (oldFunction, wantedFunction) {
debug('updateFunction', oldFunction, wantedFunction)
await loadRegion()
const lambda = new AWS.Lambda()
const { FunctionName } = oldFunction
- 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 default
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function () {
let cur
const done = (body) => {
if (cur !== undefined) {
Function handler
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function handler (opts) {
const envs = await load.envs()
const questions = [
{
name: 'env',
Function handler
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function handler (opts) {
const logger = opts.quiet ? () => {} : reporter()
let envVars = {}
opts.vars.forEach(function (varPair) {
const [key, value] = varPair.match(/(.*?)=(.*)/).slice(1)
Function environmentCheck
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function environmentCheck (envs) {
const extractedEnvs = values(envs)
return Object.keys(envs).reduce(({ common, differences, conflicts }, func) => {
const env = envs[func]
Function addPath
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function addPath (api, path, method, accountId, functionName, region = 'us-east-1') {
Function deploy
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export async function deploy (id, env, attempts = 1) {
await loadRegion()
const apiGateway = new AWS.APIGateway()
try {
- 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 formatResponse
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function formatResponse ({ result, response }) {
if (response) {
if (result === results.success) {
return JSON.stringify(response)
} else if (result === results.error) {
- 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"