concon121/atom-maven

View on GitHub

Showing 7 of 10 total issues

Function setup has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  setup: function () {
    var self = this;

    atom.workspace.scan(/<project.*/g, (match) => {
      if (match.filePath.endsWith('pom.xml')) {
Severity: Major
Found in lib/atom-maven.js - About 2 hrs to fix

Function Common has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

var Common = function () {
  const isWin = (/^win/.test(process.platform));
  const pathSeparator = (isWin) ? ';' : ':';
  const fileSeparator = (isWin) ? '\\' : '/';
  const homeDir = (isWin) ? process.env.HOMEPATH : process.env.HOME;
Severity: Minor
Found in lib/common.js - About 55 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 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

Severity
Category
Status
Source
Language