src/atom-environment.js

Summary

Maintainability
F
1 wk
Test Coverage

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

const crypto = require('crypto');
const path = require('path');
const util = require('util');
const { ipcRenderer } = require('electron');

Severity: Major
Found in src/atom-environment.js - About 3 days to fix

    AtomEnvironment has 98 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class AtomEnvironment {
      /*
      Section: Properties
      */
    
    
    Severity: Major
    Found in src/atom-environment.js - About 1 day 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

      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

        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 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 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 attemptRestoreProjectStateForPaths has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
              Open

                async attemptRestoreProjectStateForPaths(
                  state,
                  projectPaths,
                  filesToOpen = []
                ) {
              Severity: Minor
              Found in src/atom-environment.js - About 3 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 initialize has 77 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                initialize(params = {}) {
                  // This will force TextEditorElement to register the custom element, so that
                  // using `document.createElement('atom-text-editor')` works if it's called
                  // before opening a buffer.
                  require('./text-editor-element');
              Severity: Major
              Found in src/atom-environment.js - About 3 hrs to fix

                Function deserialize has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                Open

                  async deserialize(state) {
                    if (!state) return Promise.resolve();
                
                    this.setFullScreen(state.fullScreen);
                
                
                Severity: Minor
                Found in src/atom-environment.js - About 2 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 attemptRestoreProjectStateForPaths has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  async attemptRestoreProjectStateForPaths(
                    state,
                    projectPaths,
                    filesToOpen = []
                  ) {
                Severity: Major
                Found in src/atom-environment.js - About 2 hrs to fix

                  Function deserialize has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    async deserialize(state) {
                      if (!state) return Promise.resolve();
                  
                      this.setFullScreen(state.fullScreen);
                  
                  
                  Severity: Minor
                  Found in src/atom-environment.js - About 2 hrs to fix

                    Function startEditorWindow has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                    Open

                      async startEditorWindow() {
                        StartupTime.addMarker('window:environment:start-editor-window:start');
                    
                        if (this.getLoadSettings().clearWindowState) {
                          await this.stateStore.clear();
                    Severity: Minor
                    Found in src/atom-environment.js - About 1 hr 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 loadState has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                      loadState(stateKey) {
                        if (this.enablePersistence) {
                          if (!stateKey)
                            stateKey = this.getStateKey(this.getLoadSettings().initialProjectRoots);
                          if (stateKey) {
                    Severity: Minor
                    Found in src/atom-environment.js - About 35 mins 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 saveState has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                      async saveState(options, storageKey) {
                        if (this.enablePersistence && this.project) {
                          const state = this.serialize(options);
                          if (!storageKey)
                            storageKey = this.getStateKey(this.project && this.project.getPaths());
                    Severity: Minor
                    Found in src/atom-environment.js - About 35 mins 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 assert has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                      assert(condition, message, callbackOrMetadata) {
                        if (condition) return true;
                    
                        const error = new Error(`Assertion failed: ${message}`);
                        Error.captureStackTrace(error, this.assert);
                    Severity: Minor
                    Found in src/atom-environment.js - About 25 mins 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

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

                          if (
                            process.platform === 'darwin' &&
                            this.config.get('core.titleBar') === 'custom'
                          ) {
                            this.workspace.addHeaderPanel({
                    Severity: Major
                    Found in src/atom-environment.js and 1 other location - About 3 hrs to fix
                    src/atom-environment.js on lines 971..983

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

                    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 (
                            process.platform === 'darwin' &&
                            this.config.get('core.titleBar') === 'custom-inset'
                          ) {
                            this.workspace.addHeaderPanel({
                    Severity: Major
                    Found in src/atom-environment.js and 1 other location - About 3 hrs to fix
                    src/atom-environment.js on lines 958..970

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

                    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

                        this.packages = new PackageManager({
                          config: this.config,
                          styleManager: this.styles,
                          commandRegistry: this.commands,
                          keymapManager: this.keymaps,
                    Severity: Major
                    Found in src/atom-environment.js and 1 other location - About 2 hrs to fix
                    src/workspace.js on lines 281..291

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

                    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

                        this.themes = new ThemeManager({
                          packageManager: this.packages,
                          config: this.config,
                          styleManager: this.styles,
                          notificationManager: this.notifications,
                    Severity: Major
                    Found in src/atom-environment.js and 1 other location - About 1 hr to fix
                    src/atom-environment.js on lines 163..169

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

                    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

                        this.project = new Project({
                          notificationManager: this.notifications,
                          packageManager: this.packages,
                          grammarRegistry: this.grammars,
                          config: this.config,
                    Severity: Major
                    Found in src/atom-environment.js and 1 other location - About 1 hr to fix
                    src/atom-environment.js on lines 141..147

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

                    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

                        registerDefaultCommands({
                          commandRegistry: this.commands,
                          config: this.config,
                          commandInstaller: this.commandInstaller,
                          notificationManager: this.notifications,
                    Severity: Major
                    Found in src/atom-environment.js and 1 other location - About 1 hr to fix
                    src/dock.js on lines 47..54

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

                    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

                      onWillThrowError(callback) {
                        return this.emitter.on('will-throw-error', callback);
                      }
                    Severity: Minor
                    Found in src/atom-environment.js and 1 other location - About 50 mins to fix
                    src/text-editor.js on lines 962..964

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

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

                      isFirstLoad() {
                        if (this.firstLoad == null)
                          this.firstLoad = this.getLoadSettings().firstLoad;
                        return this.firstLoad;
                      }
                    Severity: Major
                    Found in src/atom-environment.js and 5 other locations - About 30 mins to fix
                    src/atom-environment.js on lines 533..536
                    src/atom-environment.js on lines 539..542
                    src/atom-environment.js on lines 545..548
                    src/atom-environment.js on lines 561..564
                    src/atom-environment.js on lines 569..573

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

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

                      getAppName() {
                        if (this.appName == null) this.appName = this.getLoadSettings().appName;
                        return this.appName;
                      }
                    Severity: Major
                    Found in src/atom-environment.js and 5 other locations - About 30 mins to fix
                    src/atom-environment.js on lines 533..536
                    src/atom-environment.js on lines 539..542
                    src/atom-environment.js on lines 545..548
                    src/atom-environment.js on lines 552..556
                    src/atom-environment.js on lines 569..573

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

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

                      inSafeMode() {
                        if (this.safeMode == null) this.safeMode = this.getLoadSettings().safeMode;
                        return this.safeMode;
                      }
                    Severity: Major
                    Found in src/atom-environment.js and 5 other locations - About 30 mins to fix
                    src/atom-environment.js on lines 533..536
                    src/atom-environment.js on lines 545..548
                    src/atom-environment.js on lines 552..556
                    src/atom-environment.js on lines 561..564
                    src/atom-environment.js on lines 569..573

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

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

                      inSpecMode() {
                        if (this.specMode == null) this.specMode = this.getLoadSettings().isSpec;
                        return this.specMode;
                      }
                    Severity: Major
                    Found in src/atom-environment.js and 5 other locations - About 30 mins to fix
                    src/atom-environment.js on lines 533..536
                    src/atom-environment.js on lines 539..542
                    src/atom-environment.js on lines 552..556
                    src/atom-environment.js on lines 561..564
                    src/atom-environment.js on lines 569..573

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

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

                      inDevMode() {
                        if (this.devMode == null) this.devMode = this.getLoadSettings().devMode;
                        return this.devMode;
                      }
                    Severity: Major
                    Found in src/atom-environment.js and 5 other locations - About 30 mins to fix
                    src/atom-environment.js on lines 539..542
                    src/atom-environment.js on lines 545..548
                    src/atom-environment.js on lines 552..556
                    src/atom-environment.js on lines 561..564
                    src/atom-environment.js on lines 569..573

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

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

                      getVersion() {
                        if (this.appVersion == null)
                          this.appVersion = this.getLoadSettings().appVersion;
                        return this.appVersion;
                      }
                    Severity: Major
                    Found in src/atom-environment.js and 5 other locations - About 30 mins to fix
                    src/atom-environment.js on lines 533..536
                    src/atom-environment.js on lines 539..542
                    src/atom-environment.js on lines 545..548
                    src/atom-environment.js on lines 552..556
                    src/atom-environment.js on lines 561..564

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

                    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

                      setDocumentEdited(edited) {
                        if (
                          typeof this.applicationDelegate.setWindowDocumentEdited === 'function'
                        ) {
                          this.applicationDelegate.setWindowDocumentEdited(edited);
                    Severity: Minor
                    Found in src/atom-environment.js and 1 other location - About 30 mins to fix
                    src/atom-environment.js on lines 1313..1320

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

                    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

                      setRepresentedFilename(filename) {
                        if (
                          typeof this.applicationDelegate.setWindowRepresentedFilename ===
                          'function'
                        ) {
                    Severity: Minor
                    Found in src/atom-environment.js and 1 other location - About 30 mins to fix
                    src/atom-environment.js on lines 1305..1311

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

                    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

                    There are no issues that match your filters.

                    Category
                    Status