concon121/atom-maven

View on GitHub
lib/ui-utils.js

Summary

Maintainability
A
2 hrs
Test Coverage

Function log has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

UiUtils.prototype.log = function (message, fileLine, lineChar, path, pre, level) {
Severity: Minor
Found in lib/ui-utils.js - About 45 mins to fix

Function addLineMessage has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

UiUtils.prototype.addLineMessage = function (text, fileLine, lineChar, path, level, pre) {
Severity: Minor
Found in lib/ui-utils.js - About 45 mins to fix

Function error has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

UiUtils.prototype.error = function (message, fileLine, lineChar, path, pre) {
Severity: Minor
Found in lib/ui-utils.js - About 35 mins to fix

Function containsLine has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

UiUtils.prototype.containsLine = function (file, text) {
  const self = this;
  if (self.messages && file && text) {
    for (var message of self.messages.messages) {
      if (message && message.file === file && message.message === text) {
Severity: Minor
Found in lib/ui-utils.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 containsMessage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

UiUtils.prototype.containsMessage = function (text) {
  const self = this;
  if (self.messages && text) {
    for (var message of self.messages.messages) {
      if (message && message.html() === text) {
Severity: Minor
Found in lib/ui-utils.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

There are no issues that match your filters.

Category
Status