Showing 131 of 363 total issues
Avoid too many return
statements within this function. Open
return { modified: true, version: newVersion };
Avoid too many return
statements within this function. Open
return new Problem(500, { detail: message });
Function fetchMetadata
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async fetchMetadata(req, res, next) {
try {
const versionIds = mixedQueryToArray(req.query.versionId);
const s3VersionIds = mixedQueryToArray(req.query.s3VersionId);
const metadata = getMetadata(req.headers);
- 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 update
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
update: async (data = {}, userId = SYSTEM_USER, etrx = undefined) => {
let trx;
try {
trx = etrx ? etrx : await Version.startTransaction();
// update version record
- 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 fetchTags
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async fetchTags(req, res, next) {
try {
const versionIds = mixedQueryToArray(req.query.versionId);
const s3VersionIds = mixedQueryToArray(req.query.s3VersionId);
const tagging = req.query.tagset;
- 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 modifiers
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static get modifiers() {
return {
filterDeleteMarker(query, value) {
if (value !== undefined) query.where('version.deleteMarker', value);
},
- 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 listInheritedObjectIds
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
listInheritedObjectIds: async (userIds = [], bucketIds = [], permCodes = []) => {
return BucketPermission.query()
.distinct('object.id AS objectId')
.rightJoin('object', 'bucket_permission.bucketId', '=', 'object.bucketId')
.modify((query) => {
- 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 listAllObjectVersions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async listAllObjectVersions({
filePath = undefined, bucketId = undefined, precisePath = true, filterLatest = false
} = {}) {
const key = filePath ?? (await utils.getBucket(bucketId)).key;
const path = key !== DELIMITER ? key : '';
- 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 removeDuplicateLatest
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
removeDuplicateLatest: async (versionId, objectId, etrx = undefined) => {
let trx;
try {
trx = etrx ? etrx : await Version.startTransaction();
- 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 createIdp
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
createIdp: async (idp, etrx = undefined) => {
let trx;
try {
trx = etrx ? etrx : await IdentityProvider.startTransaction();
- 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 dequeue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async dequeue(etrx = undefined) {
let trx;
try {
trx = etrx ? etrx : await ObjectQueue.startTransaction();
- 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"