Showing 779 of 1,157 total issues
exports
has 41 functions (exceeds 20 allowed). Consider refactoring. Open
module.exports = class GrammarRegistry {
constructor({ config } = {}) {
this.config = config;
this.subscriptions = new CompositeDisposable();
this.textmateRegistry = new FirstMate.GrammarRegistry({
Function show
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
Tooltip.prototype.show = function() {
if (this.hasContent() && this.enabled) {
if (this.hideOnClickOutsideOfTooltip) {
window.addEventListener('click', this.hideOnClickOutsideOfTooltip, {
capture: true
- 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
exports
has 40 functions (exceeds 20 allowed). Consider refactoring. Open
module.exports = class GitRepository {
static exists(path) {
const git = this.open(path);
if (git) {
git.destroy();
Function bufferRangeForScopeAtPosition
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
bufferRangeForScopeAtPosition(selector, position) {
let endColumn, tag, tokenIndex;
position = Point.fromObject(position);
const { openScopes, tags } = this.tokenizedLineForRow(position.row);
- 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 130 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(props) {
this.props = props;
if (!props.model) {
props.model = new TextEditor({
Function openPaths
has 130 lines of code (exceeds 25 allowed). Consider refactoring. Open
async openPaths({
pathsToOpen,
foldersToOpen,
executedFrom,
pidToKillWhenClosed,
Function render
has 129 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return $.div(
{ className: 'pane-item native-key-bindings about' },
$.div(
{ className: 'about-container' },
Function toggleLineCommentsForBufferRows
has 129 lines of code (exceeds 25 allowed). Consider refactoring. Open
toggleLineCommentsForBufferRows(start, end, options = {}) {
const languageMode = this.buffer.getLanguageMode();
let { commentStartString, commentEndString } =
(languageMode.commentStringsForPosition &&
languageMode.commentStringsForPosition(new Point(start, 0))) ||
Function loadStatePromise
has 128 lines of code (exceeds 25 allowed). Consider refactoring. Open
const loadStatePromise = this.loadState().then(async state => {
this.windowDimensions = state && state.windowDimensions;
if (!this.getLoadSettings().headless) {
StartupTime.addMarker(
'window:environment:start-editor-window:display-window'
Function exports
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
module.exports = async function({ blobStore }) {
const { remote } = require('electron');
const getWindowLoadSettings = require('./get-window-load-settings');
const exitWithStatusCode = function(status) {
- 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 didMouseDownOnContent
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
didMouseDownOnContent(event) {
const { model } = this.props;
const { target, button, detail, ctrlKey, shiftKey, metaKey } = event;
const platform = this.getPlatform();
- 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
TreeSitterLanguageMode
has 38 functions (exceeds 20 allowed). Consider refactoring. Open
class TreeSitterLanguageMode {
static _patchSyntaxNode() {
if (!Parser.SyntaxNode.prototype.hasOwnProperty('range')) {
Object.defineProperty(Parser.SyntaxNode.prototype, 'range', {
get() {
Function shouldUpdate
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
shouldUpdate(newProps) {
const oldProps = this.props;
if (!newProps.hasInitialMeasurements) 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"
Further reading
Function render
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
rootComponent,
showLineNumbers,
height,
Function constructor
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(params = {}) {
this.id = params.id != null ? params.id : nextId++;
// Public: A {Clipboard} instance
this.clipboard = params.clipboard;
Function updateLines
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateLines(oldProps, newProps) {
const {
screenLines,
tileStartRow,
lineDecorations,
Function render
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<div className="welcome">
<div className="welcome-container">
<header className="welcome-header">
Function searchInDirectory
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
searchInDirectory(directory, regexp, options, numPathsFound) {
// Delay the require of vscode-ripgrep to not mess with the snapshot creation.
if (!this.rgPath) {
this.rgPath = require('vscode-ripgrep').rgPath.replace(
/\bapp\.asar\b/,
File theme-manager.js
has 361 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* global snapshotAuxiliaryData */
const path = require('path');
const _ = require('underscore-plus');
const { Emitter, CompositeDisposable } = require('event-kit');
Function shouldUpdate
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
shouldUpdate(newProps) {
const oldProps = this.props;
if (oldProps.showLineNumbers !== newProps.showLineNumbers) return true;
if (oldProps.height !== newProps.height) return true;
- 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"