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({
Severity: Minor
Found in src/grammar-registry.js - About 5 hrs to fix

    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
    Severity: Minor
    Found in src/tooltip.js - About 5 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

    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();
    Severity: Minor
    Found in src/git-repository.js - About 5 hrs to fix

      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);
      Severity: Minor
      Found in src/text-mate-language-mode.js - About 5 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 constructor has 130 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        constructor(props) {
          this.props = props;
      
          if (!props.model) {
            props.model = new TextEditor({
      Severity: Major
      Found in src/text-editor-component.js - About 5 hrs to fix

        Function openPaths has 130 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          async openPaths({
            pathsToOpen,
            foldersToOpen,
            executedFrom,
            pidToKillWhenClosed,
        Severity: Major
        Found in src/main-process/atom-application.js - About 5 hrs to fix

          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' },
          Severity: Major
          Found in packages/about/lib/components/about-view.js - About 5 hrs to fix

            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))) ||
            Severity: Major
            Found in src/text-editor.js - About 5 hrs to fix

              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'
              Severity: Major
              Found in src/atom-environment.js - About 5 hrs to fix

                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) {
                Severity: Minor
                Found in src/initialize-test-window.js - About 5 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 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();
                
                
                Severity: Minor
                Found in src/text-editor-component.js - About 5 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

                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() {
                Severity: Minor
                Found in src/tree-sitter-language-mode.js - About 5 hrs to fix

                  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;
                  
                  
                  Severity: Minor
                  Found in src/text-editor-component.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 render has 121 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    render() {
                      const {
                        rootComponent,
                        showLineNumbers,
                        height,
                  Severity: Major
                  Found in src/text-editor-component.js - About 4 hrs to fix

                    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;
                    Severity: Major
                    Found in src/atom-environment.js - About 4 hrs to fix

                      Function updateLines has 120 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        updateLines(oldProps, newProps) {
                          const {
                            screenLines,
                            tileStartRow,
                            lineDecorations,
                      Severity: Major
                      Found in src/text-editor-component.js - About 4 hrs to fix

                        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">
                        Severity: Major
                        Found in packages/welcome/lib/welcome-view.js - About 4 hrs to fix

                          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/,
                          Severity: Major
                          Found in src/ripgrep-directory-searcher.js - About 4 hrs to fix

                            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');
                            Severity: Minor
                            Found in src/theme-manager.js - About 4 hrs to fix

                              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;
                              Severity: Minor
                              Found in src/text-editor-component.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

                              Severity
                              Category
                              Status
                              Source
                              Language