apercova/atom-path-intellisense

View on GitHub

Showing 11 of 27 total issues

Function _resolveValidPathSync has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

  _resolveValidPathSync($self, req, testPath, basePath, searchPath, idx) {
    if (searchPath) {
      return new SearchPathDTO(basePath, searchPath, testPath);
    }
    let vPath = null;
Severity: Minor
Found in lib/providers/current-file-relative-path.provider.js - About 4 hrs 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 $resolveSuggestions has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  $resolveSuggestions(req, search) {
    const self = this;
    const promize = new Promise(resolve => {
      let result = new SuggestionsDTO();
      if (!(search instanceof SearchPathDTO)) {
Severity: Major
Found in lib/providers/base-path.provider.js - About 2 hrs to fix

    File atom-path-intellisense-impl.js has 257 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    'use strict';
    const consts = require('./config/consts'),
      config = require('./config/config'),
      selectors = require('atom-selectors-plus'),
      logger = require('./util/logger'),
    Severity: Minor
    Found in lib/atom-path-intellisense-impl.js - About 2 hrs to fix

      Function promize has 53 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          const promize = new Promise(resolve => {
            let result = new SuggestionsDTO();
            if (!(search instanceof SearchPathDTO)) {
              resolve(self.formatter.format(result));
            } else {
      Severity: Major
      Found in lib/providers/base-path.provider.js - About 2 hrs to fix

        Function setLevel has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        function setLevel(level, logger) {
          if (!logger) {
            _gconfig.level = level || _gconfig.level;
            winston.loggers.loggers.forEach(l => {
              l.level = level;
        Severity: Minor
        Found in lib/util/logger.js - About 1 hr 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 _resolveValidPathSync has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          _resolveValidPathSync($self, req, testPath, basePath, searchPath, idx) {
            if (searchPath) {
              return new SearchPathDTO(basePath, searchPath, testPath);
            }
            let vPath = null;
        Severity: Minor
        Found in lib/providers/current-file-relative-path.provider.js - About 1 hr to fix

          Function _registerConfObservers has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            _registerConfObservers() {
              const self = this;
              return new Promise(resolve => {
                self._subscriptions.push(
                  config.addObserver(consts.CF_MANUAL_SUGGEST, () => {
          Severity: Minor
          Found in lib/atom-path-intellisense-impl.js - About 1 hr to fix

            Function _registerPathProviders has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              _registerPathProviders() {
                const self = this;
                return new Promise((resolve, reject) => {
                  try {
                    self._logger.debug('Registering path providers.');
            Severity: Minor
            Found in lib/atom-path-intellisense-impl.js - About 1 hr to fix

              Function $resolveRelativeSearchPathSync has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                $resolveRelativeSearchPathSync(req, basePath, testPath) {
                  let fullPath = this.$normalizeRelativePath(basePath, testPath);
                  this._logger.debug(`trying path: ${testPath}`);
                  this._logger.debug(`base path resolved as: ${basePath}`);
                  this._logger.debug(`full path resolved as: ${fullPath}`);
              Severity: Minor
              Found in lib/providers/base-path.provider.js - About 1 hr 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 $resolveSuggestions has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                $resolveSuggestions(req, search) {
                  const self = this;
                  const promize = new Promise(resolve => {
                    let result = new SuggestionsDTO();
                    if (!(search instanceof SearchPathDTO)) {
              Severity: Minor
              Found in lib/providers/base-path.provider.js - About 45 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 $getCurrentProjectPath has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                $getCurrentProjectPath(req, unescape, home) {
                  const filePath = req.editor.getPath() || '';
                  let projectPath = atom.project
                    .getDirectories()
                    .filter(testpath => filePath.indexOf(testpath.path) > -1)
              Severity: Minor
              Found in lib/providers/base-path.provider.js - About 35 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