Showing 27 of 56 total issues
File walk.js
has 357 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use babel';
// AST walker module for Mozilla Parser API compatible trees
// A simple walk is one where you simply specify callbacks to be
Function _inspect
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
_inspect() {
let scopeId = 0;
let scope = new Scope(scopeId, this._ast);
let scopes = this._scopes = [];
File view.js
has 276 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use babel';
import { CompositeDisposable, Range } from 'atom';
import Inspector from './inspector/inspector.js';
import RenameDialog from './rename-dialog.js';
Function _getLiteralUsages
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
_getLiteralUsages(text) {
let result = [];
// ignore empty string literals
if (typeof text === 'string' && !text.trim()) {
Function _inspect
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
_inspect() {
let scopeId = 0;
let scope = new Scope(scopeId, this._ast);
let scopes = this._scopes = [];
- 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 _getLiteralUsages
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
_getLiteralUsages(text) {
let result = [];
// ignore empty string literals
if (typeof text === 'string' && !text.trim()) {
- 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 findNodeAt
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export function findNodeAt(node, start, end, test, base, state) {
test = makeTest(test);
if (!base) base = exports.base;
try {
(function c(node, st, override) {
- 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 constructor
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor() {
this._subscriptions = new CompositeDisposable();
this._editorSubscriptions = new CompositeDisposable();
this._subscriptions.add(
Function _highlightOccurrences
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
_highlightOccurrences() {
if (this._skipNextParse) {
this._skipNextParse = false;
return;
Function _getGlobalVarUsages
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
_getGlobalVarUsages(node) {
let result = [];
let name = node.name;
recursive(this.getProgramNode(), {}, {
Function _getVarUsages
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
_getVarUsages(def) {
let result = [];
recursive(def.scope.getNode(), {}, {
VariablePattern: skipThrough,
Function _refactor
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
_refactor(newName) {
let occ = this._occurences,
oldName = occ.definition.name;
if (newName === oldName) {
Function constructor
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(inspector) {
super(inspector);
inspector.registerHandler([
'Literal',
Function findNodeAfter
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function findNodeAfter(node, pos, test, base, state) {
test = makeTest(test);
if (!base) base = exports.base;
try {
(function c(node, st, override) {
- 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 findNodeAround
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function findNodeAround(node, pos, test, base, state) {
test = makeTest(test);
if (!base) base = exports.base;
try {
(function c(node, st, override) {
- 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 findNodeBefore
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function findNodeBefore(node, pos, test, base, state) {
test = makeTest(test);
if (!base) base = exports.base;
let max;
(function c(node, st, override) {
- 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 findNodeAt
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
export function findNodeAt(node, start, end, test, base, state) {
Function _getGlobalVarUsages
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
_getGlobalVarUsages(node) {
let result = [];
let name = node.name;
recursive(this.getProgramNode(), {}, {
- 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 ancestor
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function ancestor(node, visitors, base, state) {
if (!base) base = exports.base;
let ancestors = [];
(function c(node, st, override) {
let type = override || node.type, found = visitors[type];
- 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 _findVarDefinition
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
_findVarDefinition(node) {
let params = utils.getInspectorData(node);
if (!params) {
return false;
- 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"