Showing 103 of 237 total issues
Function _processResponses
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_processResponses(controller) {
let form = new SettingsResponseForm(importedSettings);
let responses = form.getResponses();
let hasEmptyAnswers = false;
let errors = '';
- 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 constructor
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
constructor(opts = {}) {
/**
* The unique identifier for this TagDefinition.
* This is a version 4 UUID in hex string format.
*
- 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 validate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
validate() {
super.validate();
if (this.packageOp) {
this.packageOp.validate();
Object.assign(this.errors, this.packageOp.errors);
- 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 validate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
validate() {
this.errors = {};
if (!Util.looksLikeUUID(this.storageServiceId)) {
this.errors['UploadOperation.storageServiceId'] = Context.y18n.__('You must specify a storage service.');
}
- 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 postRenderCallback
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
postRenderCallback(fnName) {
let controller = this;
if (fnName == 'import') {
this._attachImportHandlers();
} else if (fnName == 'export') {
- 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 [ allowed[0] ];
Avoid too many return
statements within this function. Open
return true;
Avoid too many return
statements within this function. Open
return obj[this.field] || "";
Function run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
run() {
var creator = this;
if (!this.job.packageOp.validate()) {
return new Promise(function(resolve, reject) {
let errors = Object.values(creator.job.packageOp.errors);
- 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 initProgressBar
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
initProgressBar(dartProcess, section) {
let [_, progressBar] = this.getDivs(dartProcess, section);
if (progressBar) {
progressBar.removeClass("bg-success");
progressBar.removeClass("bg-danger");
- 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 inflateFrom
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static inflateFrom(data) {
let job = new Job();
Object.assign(job, data);
if (data.bagItProfile) {
job.bagItProfile = BagItProfile.inflateFrom(data.bagItProfile);
- 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 _makeUploadOps
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_makeUploadOps(job) {
if (!this._workflowObj.storageServiceIds || this._workflowObj.storageServiceIds.length == 0) {
// No storage services specified, so no uploads to perform.
return;
}
- 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 _jsonFilter
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_jsonFilter(key, value) {
let unsafe = ['login', 'password', 'userId', 'apiToken']
if (unsafe.includes(key)) {
if (!value.startsWith('env:')) {
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 _getPageLevelErrors
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_getPageLevelErrors(profile) {
let errors = [];
if (!Util.isEmpty(profile.errors["name"])) {
errors.push(Context.y18n.__("About Tab: %s", profile.errors["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 _importProfileObject
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_importProfileObject(json, profileUrl) {
let obj;
try {
obj = JSON.parse(json);
} catch (ex) {
- 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 pruneSourceFilesUnlessJobCompleted
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
pruneSourceFilesUnlessJobCompleted() {
if (this.result && this.result.succeeded()) {
return;
}
if (this.sourceFiles.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 copyResponseToObject
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
copyResponseToObject(response) {
let classToSet = this.getTargetClass();
if (classToSet == null) {
throw Context.y18n.__("Response must be assigned to an object");
}
- 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 checkPaths
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
checkPaths(jobParamsArray) {
let lineNumber = 2;
for (let params of jobParamsArray) {
for (let filePath of params.files) {
if (!fs.existsSync(filePath)) {
- 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 renderUploadInfo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
renderUploadInfo(data, dartProcess) {
let [detailDiv, progressBar] = this.getDivs(dartProcess, 'uploadInfo');
if (data.action == 'start') {
detailDiv.text(data.msg);
// We can have multiple uploads, so we re-initialize the
- 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 _validateNoExtraneousPayloadFiles
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_validateNoExtraneousPayloadFiles() {
//Context.logger.info(`Validator: Looking for extraneous payload files in ${this.pathToBag}`);
for(var manifest of this.payloadManifests()) {
for (var f of this.payloadFiles()) {
if (!manifest.keyValueCollection.first(f.relDestPath)) {
- 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"