Showing 51 of 75 total issues
Function exports
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (job, settings, { input, output, useJobId }, type) => {
if (type != 'postrender') {
throw new Error(`Action ${name} can be only run in postrender mode, you provided: ${type}.`)
}
- 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 getCredentials
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const getCredentials = params => {
if (params && params.profile) {
// will throw if the profile is not configured
return new AWS.SharedIniFileCredentials({ profile: params.profile })
} else if (params && params.accessKeyId && params.secretAccessKey) {
- 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 a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
module.exports = actionType => (job, settings) => {
settings.logger.log(`[${job.uid}] applying ${actionType} actions...`);
return PromiseSerial((job.actions[actionType] || []).map(action => () => {
settings.track(`Job Action Started`, {
- 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 { accessKeyId: process.env.AWS_ACCESS_KEY, secretAccessKey: process.env.AWS_SECRET_KEY }
Avoid too many return
statements within this function. Open
return requireg('@nexrender/provider-' + protocol).download(job, settings, asset.src, asset.dest, asset.params || {});
Avoid too many return
statements within this function. Open
return new Promise((resolve, reject) => {
file.on('error', (err) => reject(err))
const awsParams = {
Bucket: params.bucket,
Avoid too many return
statements within this function. Open
return Promise.reject(new Error(`Couldn't find module @nexrender/provider-${protocol}, Unknown protocol provided.`))
Function predownload
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const predownload = async (job, settings, { cacheDirectory, ttl, cacheAssets }) => {
// Job template
await findValidateCache(job.template, settings, cacheDirectory, ttl);
if(cacheAssets){
- 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 getBinary
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const getBinary = (job, settings) => {
return new Promise((resolve, reject) => {
const {version} = pkg['ffmpeg-static']
const filename = `ffmpeg-${version}${process.platform == 'win32' ? '.exe' : ''}`
const fileurl = `https://github.com/eugeneware/ffmpeg-static/releases/download/${version}/${process.platform}-x64`
- 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 parseMethodWithArgs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
EnhancedScript.prototype.parseMethodWithArgs = function (parameter) {
let value = parameter.value;
const methodArgs = [...parameter.value.matchAll(getSearchUsageByMethodRegex(this.keyword, 'arg', "gm"))];
if (methodArgs.length > 0 ) {
- 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 postdownload
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const postdownload = async (job, settings, { cacheDirectory, cacheAssets }) => {
// Job template
await saveCache(job.template, settings, job.workpath, cacheDirectory);
if(cacheAssets){
- 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"