src/main-process/atom-application.js

Summary

Maintainability
F
2 wks
Test Coverage

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

const AtomWindow = require('./atom-window');
const ApplicationMenu = require('./application-menu');
const AtomProtocolHandler = require('./atom-protocol-handler');
const AutoUpdateManager = require('./auto-update-manager');
const StorageFolder = require('../storage-folder');
Severity: Major
Found in src/main-process/atom-application.js - About 4 days to fix

    Function handleEvents has 449 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      handleEvents() {
        const createOpenSettings = ({ event, sameWindow }) => {
          const targetWindow = event
            ? this.atomWindowForEvent(event)
            : this.focusedWindow();
    Severity: Major
    Found in src/main-process/atom-application.js - About 2 days to fix

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

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

        Function openPaths has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
        Open

          async openPaths({
            pathsToOpen,
            foldersToOpen,
            executedFrom,
            pidToKillWhenClosed,
        Severity: Minor
        Found in src/main-process/atom-application.js - About 5 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function openPaths has 130 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          async openPaths({
            pathsToOpen,
            foldersToOpen,
            executedFrom,
            pidToKillWhenClosed,
        Severity: Major
        Found in src/main-process/atom-application.js - About 5 hrs to fix

          Function openWithOptions has 80 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            openWithOptions(options) {
              const {
                pathsToOpen,
                executedFrom,
                foldersToOpen,
          Severity: Major
          Found in src/main-process/atom-application.js - About 3 hrs to fix

            Function runTests has 56 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              runTests({
                headless,
                resourcePath,
                executedFrom,
                pathsToOpen,
            Severity: Major
            Found in src/main-process/atom-application.js - About 2 hrs to fix

              Function parsePathToOpen has 49 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                async parsePathToOpen(pathToOpen, executedFrom, extra) {
                  const result = Object.assign(
                    {
                      pathToOpen,
                      initialColumn: null,
              Severity: Minor
              Found in src/main-process/atom-application.js - About 1 hr to fix

                Function openPackageUriHandler has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  openPackageUriHandler(url, parsedUrl, devMode, safeMode, env) {
                    let bestWindow;
                
                    if (parsedUrl.host === 'core') {
                      const predicate = require('../core-uri-handlers').windowPredicate(
                Severity: Minor
                Found in src/main-process/atom-application.js - About 1 hr to fix

                  Function runBenchmarks has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    runBenchmarks({
                      headless,
                      test,
                      resourcePath,
                      executedFrom,
                  Severity: Minor
                  Found in src/main-process/atom-application.js - About 1 hr to fix

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

                      constructor(options) {
                        StartupTime.addMarker('main-process:atom-application:constructor:start');
                    
                        super();
                        this.quitting = false;
                    Severity: Minor
                    Found in src/main-process/atom-application.js - About 1 hr to fix

                      Function launch has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        async launch(options) {
                          if (!this.configFilePromise) {
                            this.configFilePromise = this.configFile.watch().then(disposable => {
                              this.disposable.add(disposable);
                              this.config.onDidChange('core.titleBar', () => this.promptForRestart());
                      Severity: Minor
                      Found in src/main-process/atom-application.js - About 1 hr to fix

                        Function loadPreviousWindowOptions has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          async loadPreviousWindowOptions() {
                            const state = await this.storageFolder.load('application.json');
                            if (!state) {
                              return [];
                            }
                        Severity: Minor
                        Found in src/main-process/atom-application.js - About 1 hr to fix

                          Function launch has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                          Open

                            async launch(options) {
                              if (!this.configFilePromise) {
                                this.configFilePromise = this.configFile.watch().then(disposable => {
                                  this.disposable.add(disposable);
                                  this.config.onDidChange('core.titleBar', () => this.promptForRestart());
                          Severity: Minor
                          Found in src/main-process/atom-application.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 promptForPath has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            promptForPath(type, callback, path) {
                              const properties = (() => {
                                switch (type) {
                                  case 'file':
                                    return ['openFile'];
                          Severity: Minor
                          Found in src/main-process/atom-application.js - About 1 hr to fix

                            Function openPackageUriHandler has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                              openPackageUriHandler(url, parsedUrl, devMode, safeMode, env) {
                                let bestWindow;
                            
                                if (parsedUrl.host === 'core') {
                                  const predicate = require('../core-uri-handlers').windowPredicate(
                            Severity: Minor
                            Found in src/main-process/atom-application.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 resolveTestRunnerPath has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                              resolveTestRunnerPath(testPath) {
                                let packageRoot;
                                if (FindParentDir == null) {
                                  FindParentDir = require('find-parent-dir');
                                }
                            Severity: Minor
                            Found in src/main-process/atom-application.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 open has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              static open(options) {
                                StartupTime.addMarker('main-process:atom-application:open');
                            
                                const socketSecret = getExistingSocketSecret(options.version);
                                const socketPath = getSocketPath(socketSecret);
                            Severity: Minor
                            Found in src/main-process/atom-application.js - About 1 hr to fix

                              Function resolveTestRunnerPath has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                resolveTestRunnerPath(testPath) {
                                  let packageRoot;
                                  if (FindParentDir == null) {
                                    FindParentDir = require('find-parent-dir');
                                  }
                              Severity: Minor
                              Found in src/main-process/atom-application.js - About 1 hr to fix

                                Function promptForPathToOpen has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  promptForPathToOpen(type, { devMode, safeMode, window }, path = null) {
                                    return this.promptForPath(
                                      type,
                                      async pathsToOpen => {
                                        let targetWindow;
                                Severity: Minor
                                Found in src/main-process/atom-application.js - About 1 hr to fix

                                  Function openWithOptions has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    openWithOptions(options) {
                                      const {
                                        pathsToOpen,
                                        executedFrom,
                                        foldersToOpen,
                                  Severity: Minor
                                  Found in src/main-process/atom-application.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 handleEvents has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    handleEvents() {
                                      const createOpenSettings = ({ event, sameWindow }) => {
                                        const targetWindow = event
                                          ? this.atomWindowForEvent(event)
                                          : this.focusedWindow();
                                  Severity: Minor
                                  Found in src/main-process/atom-application.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 runTests has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    runTests({
                                      headless,
                                      resourcePath,
                                      executedFrom,
                                      pathsToOpen,
                                  Severity: Minor
                                  Found in src/main-process/atom-application.js - About 55 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 deleteSocketFile has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    async deleteSocketFile() {
                                      if (process.platform === 'win32') return;
                                  
                                      if (!this.socketSecretPromise) {
                                        return;
                                  Severity: Minor
                                  Found in src/main-process/atom-application.js - About 45 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

                                  Consider simplifying this complex logical expression.
                                  Open

                                      if (
                                        !socketPath ||
                                        options.test ||
                                        options.benchmark ||
                                        options.benchmarkTest ||
                                  Severity: Major
                                  Found in src/main-process/atom-application.js - About 40 mins to fix

                                    Function deleteSocketSecretFile has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                      async deleteSocketSecretFile() {
                                        if (!this.socketSecretPromise) {
                                          return;
                                        }
                                        await this.socketSecretPromise;
                                    Severity: Minor
                                    Found in src/main-process/atom-application.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 parsePathToOpen has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                      async parsePathToOpen(pathToOpen, executedFrom, extra) {
                                        const result = Object.assign(
                                          {
                                            pathToOpen,
                                            initialColumn: null,
                                    Severity: Minor
                                    Found in src/main-process/atom-application.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 killProcess has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                      killProcess(pid) {
                                        try {
                                          const parsedPid = parseInt(pid);
                                          if (isFinite(parsedPid)) this._killProcess(parsedPid);
                                        } catch (error) {
                                    Severity: Minor
                                    Found in src/main-process/atom-application.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

                                    Avoid too many return statements within this function.
                                    Open

                                          return this.openPath({
                                            pathToOpen: null,
                                            pidToKillWhenClosed,
                                            newWindow,
                                            devMode,
                                    Severity: Major
                                    Found in src/main-process/atom-application.js - About 30 mins to fix

                                      Function promptForPath has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                        promptForPath(type, callback, path) {
                                          const properties = (() => {
                                            switch (type) {
                                              case 'file':
                                                return ['openFile'];
                                      Severity: Minor
                                      Found in src/main-process/atom-application.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

                                      Function runBenchmarks has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                        runBenchmarks({
                                          headless,
                                          test,
                                          resourcePath,
                                          executedFrom,
                                      Severity: Minor
                                      Found in src/main-process/atom-application.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

                                          try {
                                            windowInitializationScript = require.resolve(
                                              path.resolve(this.devResourcePath, 'src', 'initialize-test-window')
                                            );
                                          } catch (error) {
                                      Severity: Major
                                      Found in src/main-process/atom-application.js and 1 other location - About 1 hr to fix
                                      src/main-process/atom-application.js on lines 1787..1801

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

                                      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

                                          try {
                                            windowInitializationScript = require.resolve(
                                              path.resolve(this.devResourcePath, 'src', 'initialize-benchmark-window')
                                            );
                                          } catch (error) {
                                      Severity: Major
                                      Found in src/main-process/atom-application.js and 1 other location - About 1 hr to fix
                                      src/main-process/atom-application.js on lines 1727..1735

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

                                      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

                                        async openPaths({
                                          pathsToOpen,
                                          foldersToOpen,
                                          executedFrom,
                                          pidToKillWhenClosed,
                                      Severity: Major
                                      Found in src/main-process/atom-application.js and 1 other location - About 1 hr to fix
                                      src/text-editor-component.js on lines 4156..4170

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

                                      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

                                            return this.openPaths({
                                              pathsToOpen,
                                              foldersToOpen,
                                              executedFrom,
                                              pidToKillWhenClosed,
                                      Severity: Major
                                      Found in src/main-process/atom-application.js and 1 other location - About 1 hr to fix
                                      src/main-process/atom-application.js on lines 1756..1768

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

                                      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

                                          const window = this.createWindow({
                                            windowInitializationScript,
                                            resourcePath,
                                            headless,
                                            isSpec,
                                      Severity: Major
                                      Found in src/main-process/atom-application.js and 1 other location - About 1 hr to fix
                                      src/main-process/atom-application.js on lines 396..408

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

                                      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 (devMode) {
                                              try {
                                                windowInitializationScript = require.resolve(
                                                  path.join(
                                                    this.devResourcePath,
                                      Severity: Major
                                      Found in src/main-process/atom-application.js and 1 other location - About 1 hr to fix
                                      src/main-process/atom-application.js on lines 1380..1391

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

                                      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 (devMode) {
                                              try {
                                                windowInitializationScript = require.resolve(
                                                  path.join(
                                                    this.devResourcePath,
                                      Severity: Major
                                      Found in src/main-process/atom-application.js and 1 other location - About 1 hr to fix
                                      src/main-process/atom-application.js on lines 1609..1620

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

                                      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.disposable.add(
                                            ipcHelpers.on(ipcMain, 'open-chosen-file', (event, defaultPath) => {
                                              this.promptForPathToOpen(
                                                'file',
                                                createOpenSettings({ event, sameWindow: true }),
                                      Severity: Major
                                      Found in src/main-process/atom-application.js and 1 other location - About 1 hr to fix
                                      src/main-process/atom-application.js on lines 851..859

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

                                      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.disposable.add(
                                            ipcHelpers.on(ipcMain, 'open-chosen-any', (event, defaultPath) => {
                                              this.promptForPathToOpen(
                                                'all',
                                                createOpenSettings({ event, sameWindow: true }),
                                      Severity: Major
                                      Found in src/main-process/atom-application.js and 1 other location - About 1 hr to fix
                                      src/main-process/atom-application.js on lines 860..868

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

                                      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 (!existingWindow && addToLastWindow) {
                                              existingWindow = this.getLastFocusedWindow(win => {
                                                return (
                                                  !win.isSpec && win.devMode === devMode && win.safeMode === safeMode
                                                );
                                      Severity: Major
                                      Found in src/main-process/atom-application.js and 1 other location - About 1 hr to fix
                                      src/main-process/atom-application.js on lines 1355..1363

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

                                      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 (noDirectories) {
                                                existingWindow = this.getLastFocusedWindow(win => {
                                                  return (
                                                    !win.isSpec &&
                                                    win.devMode === devMode &&
                                      Severity: Major
                                      Found in src/main-process/atom-application.js and 1 other location - About 1 hr to fix
                                      src/main-process/atom-application.js on lines 1335..1341

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

                                      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

                                            openedWindow = this.createWindow({
                                              locationsToOpen,
                                              windowInitializationScript,
                                              resourcePath,
                                              devMode,
                                      Severity: Major
                                      Found in src/main-process/atom-application.js and 1 other location - About 1 hr to fix
                                      src/main-process/atom-application.js on lines 1820..1830

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

                                      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

                                          const window = this.createWindow({
                                            windowInitializationScript,
                                            resourcePath,
                                            headless,
                                            test,
                                      Severity: Major
                                      Found in src/main-process/atom-application.js and 1 other location - About 1 hr to fix
                                      src/main-process/atom-application.js on lines 1403..1413

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

                                      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.disposable.add(
                                            ipcHelpers.on(ipcMain, 'get-auto-update-manager-state', event => {
                                              event.returnValue = this.autoUpdateManager.getState();
                                            })
                                          );
                                      Severity: Minor
                                      Found in src/main-process/atom-application.js and 1 other location - About 55 mins to fix
                                      src/main-process/atom-application.js on lines 1044..1048

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

                                      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.disposable.add(
                                            ipcHelpers.on(ipcMain, 'get-auto-update-manager-error', event => {
                                              event.returnValue = this.autoUpdateManager.getErrorMessage();
                                            })
                                          );
                                      Severity: Minor
                                      Found in src/main-process/atom-application.js and 1 other location - About 55 mins to fix
                                      src/main-process/atom-application.js on lines 1038..1042

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

                                      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 (pathsToOpen != null) {
                                            for (let pathToOpen of pathsToOpen) {
                                              testPaths.push(path.resolve(executedFrom, fs.normalize(pathToOpen)));
                                            }
                                          }
                                      Severity: Minor
                                      Found in src/main-process/atom-application.js and 1 other location - About 50 mins to fix
                                      src/main-process/atom-application.js on lines 1804..1810

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

                                      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 (pathsToOpen != null) {
                                            for (let pathToOpen of pathsToOpen) {
                                              benchmarkPaths.push(
                                                path.resolve(executedFrom, fs.normalize(pathToOpen))
                                              );
                                      Severity: Minor
                                      Found in src/main-process/atom-application.js and 1 other location - About 50 mins to fix
                                      src/main-process/atom-application.js on lines 1738..1742

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

                                      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 (match[2]) {
                                              result.initialColumn = Math.max(0, parseInt(match[2].slice(1), 10) - 1);
                                            }
                                      Severity: Minor
                                      Found in src/main-process/atom-application.js and 1 other location - About 50 mins to fix
                                      src/main-process/atom-application.js on lines 1903..1905

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

                                      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 (match[1]) {
                                              result.initialLine = Math.max(0, parseInt(match[1].slice(1), 10) - 1);
                                            }
                                      Severity: Minor
                                      Found in src/main-process/atom-application.js and 1 other location - About 50 mins to fix
                                      src/main-process/atom-application.js on lines 1906..1908

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

                                      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

                                        openPath({
                                          pathToOpen,
                                          pidToKillWhenClosed,
                                          newWindow,
                                          devMode,
                                      Severity: Minor
                                      Found in src/main-process/atom-application.js and 1 other location - About 50 mins to fix
                                      src/text-editor-component.js on lines 4185..4196

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

                                      ipcMain.handle('setAsDefaultProtocolClient', (_, { protocol, path, args }) => {
                                        return app.setAsDefaultProtocolClient(protocol, path, args);
                                      });
                                      Severity: Minor
                                      Found in src/main-process/atom-application.js and 1 other location - About 35 mins to fix
                                      src/main-process/atom-application.js on lines 136..138

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

                                      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

                                      ipcMain.handle('isDefaultProtocolClient', (_, { protocol, path, args }) => {
                                        return app.isDefaultProtocolClient(protocol, path, args);
                                      });
                                      Severity: Minor
                                      Found in src/main-process/atom-application.js and 1 other location - About 35 mins to fix
                                      src/main-process/atom-application.js on lines 140..142

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

                                      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