Showing 779 of 1,157 total issues

File grammar-registry.js has 477 lines of code (exceeds 250 allowed). Consider refactoring.
Open

const _ = require('underscore-plus');
const Grim = require('grim');
const CSON = require('season');
const FirstMate = require('first-mate');
const { Disposable, CompositeDisposable } = require('event-kit');
Severity: Minor
Found in src/grammar-registry.js - About 7 hrs to fix

    exports has 51 functions (exceeds 20 allowed). Consider refactoring.
    Open

    module.exports = class AtomApplication extends EventEmitter {
      // Public: The entry point into the Atom application.
      static open(options) {
        StartupTime.addMarker('main-process:atom-application:open');
    
    
    Severity: Major
    Found in src/main-process/atom-application.js - About 7 hrs to fix

      Config has 50 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Config {
        static addSchemaEnforcer(typeName, enforcerFunction) {
          if (schemaEnforcers[typeName] == null) {
            schemaEnforcers[typeName] = [];
          }
      Severity: Minor
      Found in src/config.js - About 7 hrs to fix

        exports has 49 functions (exceeds 20 allowed). Consider refactoring.
        Open

        module.exports = class PaneContainer {
          constructor(params) {
            let applicationDelegate, deserializerManager, notificationManager;
            ({
              config: this.config,
        Severity: Minor
        Found in src/pane-container.js - About 6 hrs to fix

          Function openLocations has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
          Open

            async openLocations(locations) {
              const needsProjectPaths =
                this.project && this.project.getPaths().length === 0;
              const foldersToAddToProject = new Set();
              const fileLocationsToOpen = [];
          Severity: Minor
          Found in src/atom-environment.js - About 6 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 48 functions (exceeds 20 allowed). Consider refactoring.
          Open

          module.exports = class AtomWindow extends EventEmitter {
            constructor(atomApplication, fileRecoveryService, settings = {}) {
              StartupTime.addMarker('main-process:atom-window:start');
          
              super();
          Severity: Minor
          Found in src/main-process/atom-window.js - About 6 hrs to fix

            File guide-view.js has 444 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /** @babel */
            /** @jsx etch.dom **/
            
            import etch from 'etch';
            
            
            Severity: Minor
            Found in packages/welcome/lib/guide-view.js - About 6 hrs to fix

              Function seek has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
              Open

                seek(position) {
                  this.openScopeIds = [];
                  this.closeScopeIds = [];
                  this.tagIndex = null;
              
              
              Severity: Minor
              Found in src/text-mate-language-mode.js - About 6 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 164 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                constructor(params = {}) {
                  if (this.constructor.clipboard == null) {
                    throw new Error(
                      'Must call TextEditor.setClipboard at least once before creating TextEditor instances'
                    );
              Severity: Major
              Found in src/text-editor.js - About 6 hrs to fix

                Function getFoldableRangesAtIndentLevel has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                Open

                  getFoldableRangesAtIndentLevel(goalLevel) {
                    let result = [];
                    let stack = [{ node: this.tree.rootNode, level: 0 }];
                    while (stack.length > 0) {
                      const { node, level } = stack.pop();
                Severity: Minor
                Found in src/tree-sitter-language-mode.js - About 6 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 startEditorWindow has 158 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  async startEditorWindow() {
                    StartupTime.addMarker('window:environment:start-editor-window:start');
                
                    if (this.getLoadSettings().clearWindowState) {
                      await this.stateStore.clear();
                Severity: Major
                Found in src/atom-environment.js - About 6 hrs to fix

                  File atom-window.js has 429 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  const {
                    BrowserWindow,
                    app,
                    dialog,
                    ipcMain,
                  Severity: Minor
                  Found in src/main-process/atom-window.js - About 6 hrs to fix

                    Function render has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
                    Open

                      render() {
                        const {
                          rootComponent,
                          showLineNumbers,
                          height,
                    Severity: Minor
                    Found in src/text-editor-component.js - About 6 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

                    File workspace-element.js has 420 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    'use strict';
                    
                    const { ipcRenderer } = require('electron');
                    const path = require('path');
                    const fs = require('fs-plus');
                    Severity: Minor
                    Found in src/workspace-element.js - About 6 hrs to fix

                      exports has 44 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      module.exports = class Project extends Model {
                        /*
                        Section: Construction and Destruction
                        */
                      
                      
                      Severity: Minor
                      Found in src/project.js - About 6 hrs to fix

                        Function _populateInjections has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                        Open

                          _populateInjections(range, nodeRangeSet) {
                            const existingInjectionMarkers = this.languageMode.injectionsMarkerLayer
                              .findMarkers({ intersectsRange: range })
                              .filter(marker => marker.parentLanguageLayer === this);
                        
                        
                        Severity: Minor
                        Found in src/tree-sitter-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 open has 144 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          async open(itemOrURI, options = {}) {
                            let uri, item;
                            if (typeof itemOrURI === 'string') {
                              uri = this.project.resolvePath(itemOrURI);
                            } else if (itemOrURI) {
                        Severity: Major
                        Found in src/workspace.js - About 5 hrs to fix

                          Function init has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                          Open

                          Tooltip.prototype.init = function(element, options) {
                            this.enabled = true;
                            this.element = element;
                            this.options = this.getOptions(options);
                            this.disposables = new EventKit.CompositeDisposable();
                          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

                          Function constructor has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                          Open

                            constructor(params = {}) {
                              if (this.constructor.clipboard == null) {
                                throw new Error(
                                  'Must call TextEditor.setClipboard at least once before creating TextEditor instances'
                                );
                          Severity: Minor
                          Found in src/text-editor.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 openPaths has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                          Open

                            async openPaths({
                              pathsToOpen,
                              foldersToOpen,
                              executedFrom,
                              pidToKillWhenClosed,
                          Severity: Minor
                          Found in src/main-process/atom-application.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

                          Severity
                          Category
                          Status
                          Source
                          Language