APTrust/dart

View on GitHub

Showing 103 of 237 total issues

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