Showing 1,157 of 1,157 total issues

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

            <details
              className="welcome-card"
              {...this.getSectionProps('packages')}
            >
              <summary className="welcome-summary icon icon-package">
Severity: Major
Found in packages/welcome/lib/guide-view.js and 1 other location - About 1 day to fix
packages/welcome/lib/guide-view.js on lines 33..67

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 204.

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

            <details
              className="welcome-card"
              {...this.getSectionProps('project')}
            >
              <summary className="welcome-summary icon icon-repo">
Severity: Major
Found in packages/welcome/lib/guide-view.js and 1 other location - About 1 day to fix
packages/welcome/lib/guide-view.js on lines 138..171

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 204.

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 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

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

            for (
              let row = nextRow, end = this.editor.getLastScreenRow();
              row <= end;
              row++
            ) {
        Severity: Major
        Found in src/selection.js and 1 other location - About 1 day to fix
        src/selection.js on lines 1064..1086

        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 198.

        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

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

            for (let row = previousRow; row >= 0; row--) {
              range.start.row = row;
              range.end.row = row;
              const clippedRange = this.editor.clipScreenRange(range, {
                skipSoftWrapIndentation: true
        Severity: Major
        Found in src/selection.js and 1 other location - About 1 day to fix
        src/selection.js on lines 1030..1056

        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 198.

        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

        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

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

                  if (autoPlace) {
                    const orgPlacement = placement;
                    const viewportDim = this.viewport.getBoundingClientRect();
              
                    placement =
              Severity: Major
              Found in src/tooltip.js and 1 other location - About 7 hrs to fix
              src/tooltip.js on lines 650..667

              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 189.

              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

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

                if (autoPlace) {
                  const orgPlacement = placement;
                  const viewportDim = this.viewport.getBoundingClientRect();
              
                  placement =
              Severity: Major
              Found in src/tooltip.js and 1 other location - About 7 hrs to fix
              src/tooltip.js on lines 306..323

              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 189.

              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 3 locations. Consider refactoring.
              Open

                screenPositionForBufferPosition(bufferPosition, options) {
                  if (options && options.clip) {
                    Grim.deprecate(
                      'The `clip` parameter has been deprecated and will be removed soon. Please, use `clipDirection` instead.'
                    );
              Severity: Major
              Found in src/text-editor.js and 2 other locations - About 7 hrs to fix
              src/text-editor.js on lines 2555..2582
              src/text-editor.js on lines 2669..2696

              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 187.

              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 3 locations. Consider refactoring.
              Open

                bufferPositionForScreenPosition(screenPosition, options) {
                  if (options && options.clip) {
                    Grim.deprecate(
                      'The `clip` parameter has been deprecated and will be removed soon. Please, use `clipDirection` instead.'
                    );
              Severity: Major
              Found in src/text-editor.js and 2 other locations - About 7 hrs to fix
              src/text-editor.js on lines 2518..2545
              src/text-editor.js on lines 2669..2696

              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 187.

              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 3 locations. Consider refactoring.
              Open

                clipScreenPosition(screenPosition, options) {
                  if (options && options.clip) {
                    Grim.deprecate(
                      'The `clip` parameter has been deprecated and will be removed soon. Please, use `clipDirection` instead.'
                    );
              Severity: Major
              Found in src/text-editor.js and 2 other locations - About 7 hrs to fix
              src/text-editor.js on lines 2518..2545
              src/text-editor.js on lines 2555..2582

              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 187.

              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

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

              module.exports = {
                activate(state) {
                  atom.config.observe(`${themeName}.fontSize`, setFontSize);
                  atom.config.observe(`${themeName}.tabSizing`, setTabSizing);
                  atom.config.observe(`${themeName}.tabCloseButton`, setTabCloseButton);
              Severity: Major
              Found in packages/one-light-ui/lib/main.js and 1 other location - About 7 hrs to fix
              packages/one-dark-ui/lib/main.js on lines 4..20

              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 186.

              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

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

              module.exports = {
                activate(state) {
                  atom.config.observe(`${themeName}.fontSize`, setFontSize);
                  atom.config.observe(`${themeName}.tabSizing`, setTabSizing);
                  atom.config.observe(`${themeName}.tabCloseButton`, setTabCloseButton);
              Severity: Major
              Found in packages/one-dark-ui/lib/main.js and 1 other location - About 7 hrs to fix
              packages/one-light-ui/lib/main.js on lines 4..20

              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 186.

              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

              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

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

                  setSelectedScreenRanges(screenRanges, options = {}) {
                    if (!screenRanges.length)
                      throw new Error('Passed an empty array to setSelectedScreenRanges');
                
                    const selections = this.getSelections();
                Severity: Major
                Found in src/text-editor.js and 1 other location - About 7 hrs to fix
                src/text-editor.js on lines 3490..3510

                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 183.

                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

                Severity
                Category
                Status
                Source
                Language