Showing 1,157 of 1,157 total issues

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

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              } else {
                let bottom = horizontalScrollbarHeight || 0;
                outerStyle.right = 0;
                outerStyle.top = 0;
                outerStyle.bottom = bottom + 'px';
          Severity: Major
          Found in src/text-editor-component.js and 1 other location - About 4 hrs to fix
          src/text-editor-component.js on lines 3451..3462

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 131.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              if (orientation === 'horizontal') {
                let right = verticalScrollbarWidth || 0;
                outerStyle.bottom = 0;
                outerStyle.left = 0;
                outerStyle.right = right + 'px';
          Severity: Major
          Found in src/text-editor-component.js and 1 other location - About 4 hrs to fix
          src/text-editor-component.js on lines 3462..3473

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 131.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          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

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                  constructor(props) {
                    this.props = props;
                    etch.initialize(this);
                
                    this.element.addEventListener('click', event => {
                Severity: Major
                Found in packages/welcome/lib/welcome-view.js and 1 other location - About 4 hrs to fix
                packages/welcome/lib/sunsetting-view.js on lines 7..19

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 127.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                  constructor(props) {
                    this.props = props;
                    etch.initialize(this);
                
                    this.element.addEventListener('click', event => {
                Severity: Major
                Found in packages/welcome/lib/sunsetting-view.js and 1 other location - About 4 hrs to fix
                packages/welcome/lib/welcome-view.js on lines 7..19

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 127.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                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

                WorkspaceElement has 35 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class WorkspaceElement extends HTMLElement {
                  connectedCallback() {
                    this.focus();
                    this.htmlElement = document.querySelector('html');
                    this.htmlElement.addEventListener('mouseleave', this.handleCenterLeave);
                Severity: Minor
                Found in src/workspace-element.js - About 4 hrs to fix

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

                  module.exports = class WorkspaceCenter {
                    constructor(params) {
                      params.location = 'center';
                      this.paneContainer = new PaneContainer(params);
                      this.didActivate = params.didActivate;
                  Severity: Minor
                  Found in src/workspace-center.js - About 4 hrs to fix

                    Function constructor has 111 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      constructor(atomApplication, fileRecoveryService, settings = {}) {
                        StartupTime.addMarker('main-process:atom-window:start');
                    
                        super();
                    
                    
                    Severity: Major
                    Found in src/main-process/atom-window.js - About 4 hrs to fix

                      Function createView has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                      Open

                        createView(object) {
                          if (object instanceof HTMLElement) {
                            return object;
                          }
                      
                      
                      Severity: Minor
                      Found in src/view-registry.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 openLocations has 109 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        async openLocations(locations) {
                          const needsProjectPaths =
                            this.project && this.project.getPaths().length === 0;
                          const foldersToAddToProject = new Set();
                          const fileLocationsToOpen = [];
                      Severity: Major
                      Found in src/atom-environment.js - About 4 hrs to fix

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

                          render() {
                            return (
                              <div className="welcome">
                                <div className="welcome-container">
                                  <div className="header">
                        Severity: Major
                        Found in packages/welcome/lib/consent-view.js - About 4 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language