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;
- Read upRead up
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)) {
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'),
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 {
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;
- Read upRead up
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;
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, () => {
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.');
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}`);
- Read upRead up
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)) {
- Read upRead up
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)
- Read upRead up
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"