APTrust/dart

View on GitHub

Showing 166 of 237 total issues

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)) {
Severity: Minor
Found in core/workflow_batch.js - About 25 mins to fix

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
Severity: Minor
Found in ui/controllers/running_jobs_controller.js - About 25 mins to fix

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)) {
Severity: Minor
Found in bagit/validator.js - About 25 mins to fix

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 findById has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    static findById(id) {
        for (var pluginType of pluginTypes) {
            var modules = PluginManager.getModuleCollection(pluginType);
            for (var module of modules) {
                if (module.description().id == id) {
Severity: Minor
Found in plugins/plugin_manager.js - About 25 mins to fix

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 showDivs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    showDivs(job, dartProcess) {
        let processDiv = $('#dartProcessContainer');

        // If we're in the Jobs section, this is the job_run_controller
        // and we need to add some HTML to the page to display job status
Severity: Minor
Found in ui/controllers/running_jobs_controller.js - About 25 mins to fix

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 makeList has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    static makeList(items, selected, includeEmptyFirstOption) {
        if (!Array.isArray(selected)) {
            // Coerce to array
            selected = [selected];
        }
Severity: Minor
Found in ui/forms/choice.js - About 25 mins to fix

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

Severity
Category
Status
Source
Language