Showing 779 of 1,157 total issues

Function render has 320 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    return (
      <div className="welcome is-guide">
        <div className="welcome-container">
          <section className="welcome-panel">
Severity: Major
Found in packages/welcome/lib/guide-view.js - About 1 day to fix

    Function open has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring.
    Open

      async open(itemOrURI, options = {}) {
        let uri, item;
        if (typeof itemOrURI === 'string') {
          uri = this.project.resolvePath(itemOrURI);
        } else if (itemOrURI) {
    Severity: Minor
    Found in src/workspace.js - About 1 day 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 config-schema.js has 658 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // This is loaded by atom-environment.coffee. See
    // https://atom.io/docs/api/latest/Config for more information about config
    // schemas.
    const configSchema = {
      core: {
    Severity: Major
    Found in src/config-schema.js - About 1 day to fix

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

      module.exports = class Package {
        /*
        Section: Construction
        */
      
      
      Severity: Major
      Found in src/package.js - About 1 day to fix

        Function populateTextDecorationsToRender has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring.
        Open

          populateTextDecorationsToRender() {
            // Sort all boundaries in ascending order of position
            this.textDecorationBoundaries.sort((a, b) =>
              a.position.compare(b.position)
            );
        Severity: Minor
        Found in src/text-editor-component.js - About 1 day 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 69 functions (exceeds 20 allowed). Consider refactoring.
        Open

        module.exports = class ApplicationDelegate {
          constructor() {
            this.pendingSettingsUpdateCount = 0;
            this._ipcMessageEmitter = null;
          }
        Severity: Major
        Found in src/application-delegate.js - About 1 day to fix

          Function toggleLineCommentsForBufferRows has a Cognitive Complexity of 64 (exceeds 5 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: Minor
          Found in src/text-editor.js - About 1 day 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 68 functions (exceeds 20 allowed). Consider refactoring.
          Open

          module.exports = class PackageManager {
            constructor(params) {
              ({
                config: this.config,
                styleManager: this.styleManager,
          Severity: Major
          Found in src/package-manager.js - About 1 day to fix

            File dock.js has 579 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            const etch = require('etch');
            const _ = require('underscore-plus');
            const { CompositeDisposable, Emitter } = require('event-kit');
            const PaneContainer = require('./pane-container');
            const TextEditor = require('./text-editor');
            Severity: Major
            Found in src/dock.js - About 1 day to fix

              File tooltip.js has 564 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              'use strict';
              
              const EventKit = require('event-kit');
              const tooltipComponentsByElement = new WeakMap();
              const listen = require('./delegated-listener');
              Severity: Major
              Found in src/tooltip.js - About 1 day to fix

                File project.js has 561 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                const path = require('path');
                
                const _ = require('underscore-plus');
                const fs = require('fs-plus');
                const { Emitter, Disposable, CompositeDisposable } = require('event-kit');
                Severity: Major
                Found in src/project.js - About 1 day to fix

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

                  module.exports = class Cursor extends Model {
                    // Instantiated by a {TextEditor}
                    constructor(params) {
                      super(params);
                      this.editor = params.editor;
                  Severity: Major
                  Found in src/cursor.js - About 1 day to fix

                    File deprecation-cop-view.js has 527 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /** @babel */
                    /** @jsx etch.dom */
                    
                    import _ from 'underscore-plus';
                    import { CompositeDisposable } from 'atom';
                    Severity: Major
                    Found in packages/deprecation-cop/lib/deprecation-cop-view.js - About 1 day to fix

                      Function getFoldableRangeForNode has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
                      Open

                        getFoldableRangeForNode(node, grammar, existenceOnly) {
                          const { children } = node;
                          const childCount = children.length;
                      
                          for (var i = 0, { length } = grammar.folds; i < length; i++) {
                      Severity: Minor
                      Found in src/tree-sitter-language-mode.js - About 1 day 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

                      TextEditorElement has 57 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class TextEditorElement extends HTMLElement {
                        initialize(component) {
                          this.component = component;
                          return this;
                        }
                      Severity: Major
                      Found in src/text-editor-element.js - About 1 day to fix

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

                        module.exports = class Dock {
                          constructor(params) {
                            this.handleResizeHandleDragStart = this.handleResizeHandleDragStart.bind(
                              this
                            );
                        Severity: Major
                        Found in src/dock.js - About 1 day to fix

                          TextMateLanguageMode has 57 functions (exceeds 20 allowed). Consider refactoring.
                          Open

                          class TextMateLanguageMode {
                            constructor(params) {
                              this.emitter = new Emitter();
                              this.disposables = new CompositeDisposable();
                              this.tokenIterator = new TokenIterator(this);
                          Severity: Major
                          Found in src/text-mate-language-mode.js - About 1 day to fix

                            File path-watcher.js has 505 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            const fs = require('fs');
                            const path = require('path');
                            
                            const { Emitter, Disposable, CompositeDisposable } = require('event-kit');
                            const nsfw = require('@atom/nsfw');
                            Severity: Major
                            Found in src/path-watcher.js - About 1 day to fix

                              Function parseCommandLine has 200 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              module.exports = function parseCommandLine(processArgs) {
                                // macOS Gatekeeper adds a flag ("-psn_0_[six or seven digits here]") when it intercepts Atom launches.
                                // (This happens for fresh downloads, new installs, or first launches after upgrading).
                                // We don't need this flag, and yargs interprets it as many short flags. So, we filter it out.
                                const filteredArgs = processArgs.filter(arg => !arg.startsWith('-psn_'));
                              Severity: Major
                              Found in src/main-process/parse-command-line.js - About 1 day to fix

                                File cursor.js has 497 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                const { Point, Range } = require('text-buffer');
                                const { Emitter } = require('event-kit');
                                const _ = require('underscore-plus');
                                const Model = require('./model');
                                
                                
                                Severity: Minor
                                Found in src/cursor.js - About 7 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language