cozy-labs/cozy-desktop

View on GitHub
core/local/chokidar/local_change.js

Summary

Maintainability
F
1 wk
Test Coverage

File local_change.js has 621 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/** A local change as to be fed to Prep/Merge.
 *
 * Ended up being specific to ChokidarWatcher.
 *
 * @module core/local/chokidar/local_change
Severity: Major
Found in core/local/chokidar/local_change.js - About 1 day to fix

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

    function fileMoveFromUnlinkAdd(
      sameInodeChange /*: ?LocalChange */,
      e /*: LocalFileAdded */
    ) /*: * */ {
      const unlinkChange /*: ?LocalFileDeletion */ =
    Severity: Minor
    Found in core/local/chokidar/local_change.js - About 1 hr to fix

      Function includeAddEventInFileMove has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function includeAddEventInFileMove(
        sameInodeChange /*: ?LocalChange */,
        e /*: LocalFileAdded */
      ) {
        const moveChange /*: ?LocalFileMove */ = maybeMoveFile(sameInodeChange)
      Severity: Minor
      Found in core/local/chokidar/local_change.js - About 1 hr to fix

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

        function fileMoveFromUnlinkAdd(
          sameInodeChange /*: ?LocalChange */,
          e /*: LocalFileAdded */
        ) /*: * */ {
          const unlinkChange /*: ?LocalFileDeletion */ =
        Severity: Minor
        Found in core/local/chokidar/local_change.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 find has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        function find /*:: <T> */(
          changes /*: LocalChange[] */,
          maybeRightType /*: (LocalChange) => ?T */,
          predicate /*: (T) => boolean */,
          remove /*: ?true */
        Severity: Minor
        Found in core/local/chokidar/local_change.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

        function fileUpdate(e /*: LocalFileUpdated */) /*: LocalFileUpdate */ {
          const change /*: LocalFileUpdate */ = {
            sideName,
            type: 'FileUpdate',
            path: e.path,
        Severity: Major
        Found in core/local/chokidar/local_change.js and 1 other location - About 6 hrs to fix
        core/local/chokidar/local_change.js on lines 330..348

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

        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

        function fileAddition(e /*: LocalFileAdded */) /*: LocalFileAddition */ {
          const change /*: LocalFileAddition */ = {
            sideName,
            type: 'FileAddition',
            path: e.path,
        Severity: Major
        Found in core/local/chokidar/local_change.js and 1 other location - About 6 hrs to fix
        core/local/chokidar/local_change.js on lines 365..383

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

        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

        function dirDeletion(e /*: LocalDirUnlinked */) /*: ?LocalDirDeletion */ {
          if (!getInode(e)) return
          const change /*: LocalDirDeletion */ = {
            sideName,
            type: 'DirDeletion',
        Severity: Major
        Found in core/local/chokidar/local_change.js and 1 other location - About 5 hrs to fix
        core/local/chokidar/local_change.js on lines 350..363

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

        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

        function fileDeletion(e /*: LocalFileUnlinked */) /*: ?LocalFileDeletion */ {
          if (!getInode(e)) return
          const change /*: LocalFileDeletion */ = {
            sideName,
            type: 'FileDeletion',
        Severity: Major
        Found in core/local/chokidar/local_change.js and 1 other location - About 5 hrs to fix
        core/local/chokidar/local_change.js on lines 315..328

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

        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 (
            !addChange ||
            metadata.id(addChange.path) !== metadata.id(e.path) ||
            addChange.path.normalize() === e.path.normalize()
          ) {
        Severity: Major
        Found in core/local/chokidar/local_change.js and 1 other location - About 1 hr to fix
        core/local/chokidar/local_change.js on lines 647..653

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

        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 (
            !addChange ||
            metadata.id(addChange.path) !== metadata.id(e.path) ||
            addChange.path.normalize() === e.path.normalize()
          ) {
        Severity: Major
        Found in core/local/chokidar/local_change.js and 1 other location - About 1 hr to fix
        core/local/chokidar/local_change.js on lines 581..587

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

        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 (moveChangeSamePath && !moveChangeSamePath.old) {
            // $FlowFixMe
            moveChangeSamePath.type = 'Ignored'
            delete moveChangeSamePath.wip
            delete moveChangeSamePath.md5sum
        Severity: Major
        Found in core/local/chokidar/local_change.js and 1 other location - About 1 hr to fix
        core/local/chokidar/local_change.js on lines 922..934

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

        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 (addChangeSamePath && addChangeSamePath.wip) {
            // $FlowFixMe
            addChangeSamePath.type = 'Ignored'
            delete addChangeSamePath.wip
            delete addChangeSamePath.md5sum
        Severity: Major
        Found in core/local/chokidar/local_change.js and 1 other location - About 1 hr to fix
        core/local/chokidar/local_change.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 69.

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

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

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

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

        Refactorings

        Further Reading

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

          const fileMove /*: Object */ = build('FileMove', addChange.path, {
            stats: e.stats,
            md5sum: e.md5sum,
            old: e.old,
            ino: addChange.ino,
        Severity: Major
        Found in core/local/chokidar/local_change.js and 2 other locations - About 1 hr to fix
        core/local/chokidar/local_change.js on lines 461..467
        core/local/chokidar/local_change.js on lines 589..595

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

          const fileMove /*: Object */ = build('FileMove', addChange.path, {
            stats: addChange.stats,
            md5sum: addChange.md5sum,
            old: e.old,
            ino: addChange.ino,
        Severity: Major
        Found in core/local/chokidar/local_change.js and 2 other locations - About 1 hr to fix
        core/local/chokidar/local_change.js on lines 555..561
        core/local/chokidar/local_change.js on lines 589..595

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

          const fileMove /*: Object */ = build('FileMove', e.path, {
            stats: addChange.stats,
            old: addChange.old,
            ino: addChange.ino,
            md5sum: e.md5sum,
        Severity: Major
        Found in core/local/chokidar/local_change.js and 2 other locations - About 1 hr to fix
        core/local/chokidar/local_change.js on lines 461..467
        core/local/chokidar/local_change.js on lines 555..561

        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

          log.debug(
            {
              oldpath: dirMove.old && dirMove.old.path,
              path: dirMove.path,
              ino: dirMove.ino,
        Severity: Major
        Found in core/local/chokidar/local_change.js and 1 other location - About 1 hr to fix
        core/local/chokidar/local_change.js on lines 469..477

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

        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

          log.debug(
            {
              oldpath: fileMove.old && fileMove.old.path,
              path: fileMove.path,
              ino: fileMove.ino,
        Severity: Major
        Found in core/local/chokidar/local_change.js and 1 other location - About 1 hr to fix
        core/local/chokidar/local_change.js on lines 442..450

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

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

          log.debug(
            {
              oldpath: fileMove.old && fileMove.old.path,
              path: fileMove.path,
              ino: fileMove.ino,
        Severity: Major
        Found in core/local/chokidar/local_change.js and 6 other locations - About 1 hr to fix
        core/local/chokidar/local_change.js on lines 503..511
        core/local/chokidar/local_change.js on lines 530..538
        core/local/chokidar/local_change.js on lines 563..571
        core/local/chokidar/local_change.js on lines 662..670
        core/local/chokidar/local_change.js on lines 735..743
        core/local/chokidar/local_change.js on lines 820..828

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

          log.debug(
            {
              oldpath: fileMove.old && fileMove.old.path,
              path: fileMove.path,
              ino: fileMove.ino,
        Severity: Major
        Found in core/local/chokidar/local_change.js and 6 other locations - About 1 hr to fix
        core/local/chokidar/local_change.js on lines 530..538
        core/local/chokidar/local_change.js on lines 563..571
        core/local/chokidar/local_change.js on lines 597..605
        core/local/chokidar/local_change.js on lines 662..670
        core/local/chokidar/local_change.js on lines 735..743
        core/local/chokidar/local_change.js on lines 820..828

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

          log.debug(
            {
              oldpath: dirMove.old && dirMove.old.path,
              path: dirMove.path,
              ino: dirMove.ino,
        Severity: Major
        Found in core/local/chokidar/local_change.js and 6 other locations - About 1 hr to fix
        core/local/chokidar/local_change.js on lines 503..511
        core/local/chokidar/local_change.js on lines 563..571
        core/local/chokidar/local_change.js on lines 597..605
        core/local/chokidar/local_change.js on lines 662..670
        core/local/chokidar/local_change.js on lines 735..743
        core/local/chokidar/local_change.js on lines 820..828

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

          log.debug(
            {
              oldpath: fileMove.old && fileMove.old.path,
              path: fileMove.path,
              ino: fileMove.ino,
        Severity: Major
        Found in core/local/chokidar/local_change.js and 6 other locations - About 1 hr to fix
        core/local/chokidar/local_change.js on lines 503..511
        core/local/chokidar/local_change.js on lines 530..538
        core/local/chokidar/local_change.js on lines 597..605
        core/local/chokidar/local_change.js on lines 662..670
        core/local/chokidar/local_change.js on lines 735..743
        core/local/chokidar/local_change.js on lines 820..828

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

          log.debug(
            {
              oldpath: moveChange.old && moveChange.old.path,
              path: moveChange.path,
              ino: moveChange.ino,
        Severity: Major
        Found in core/local/chokidar/local_change.js and 6 other locations - About 1 hr to fix
        core/local/chokidar/local_change.js on lines 503..511
        core/local/chokidar/local_change.js on lines 530..538
        core/local/chokidar/local_change.js on lines 563..571
        core/local/chokidar/local_change.js on lines 597..605
        core/local/chokidar/local_change.js on lines 662..670
        core/local/chokidar/local_change.js on lines 735..743

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

          log.debug(
            {
              oldpath: moveChange.old && moveChange.old.path,
              path: moveChange.path,
              ino: moveChange.ino,
        Severity: Major
        Found in core/local/chokidar/local_change.js and 6 other locations - About 1 hr to fix
        core/local/chokidar/local_change.js on lines 503..511
        core/local/chokidar/local_change.js on lines 530..538
        core/local/chokidar/local_change.js on lines 563..571
        core/local/chokidar/local_change.js on lines 597..605
        core/local/chokidar/local_change.js on lines 662..670
        core/local/chokidar/local_change.js on lines 820..828

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

          log.debug(
            {
              oldpath: dirMove.old && dirMove.old.path,
              path: dirMove.path,
              ino: dirMove.ino,
        Severity: Major
        Found in core/local/chokidar/local_change.js and 6 other locations - About 1 hr to fix
        core/local/chokidar/local_change.js on lines 503..511
        core/local/chokidar/local_change.js on lines 530..538
        core/local/chokidar/local_change.js on lines 563..571
        core/local/chokidar/local_change.js on lines 597..605
        core/local/chokidar/local_change.js on lines 735..743
        core/local/chokidar/local_change.js on lines 820..828

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

          const dirMove /*: Object */ = build('DirMove', addChange.path, {
            stats: addChange.stats,
            old: e.old,
            ino: addChange.ino,
            wip: addChange.wip
        Severity: Major
        Found in core/local/chokidar/local_change.js and 3 other locations - About 1 hr to fix
        core/local/chokidar/local_change.js on lines 397..402
        core/local/chokidar/local_change.js on lines 435..440
        core/local/chokidar/local_change.js on lines 655..660

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

          const dirMove /*: Object */ = build('DirMove', e.path, {
            stats: addChange.stats,
            old: addChange.old,
            ino: addChange.ino,
            wip: e.wip
        Severity: Major
        Found in core/local/chokidar/local_change.js and 3 other locations - About 1 hr to fix
        core/local/chokidar/local_change.js on lines 397..402
        core/local/chokidar/local_change.js on lines 435..440
        core/local/chokidar/local_change.js on lines 523..528

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

          const dirMove /*: Object */ = build('DirMove', e.path, {
            stats: e.stats,
            old: unlinkChange.old,
            ino: unlinkChange.ino,
            wip: e.wip
        Severity: Major
        Found in core/local/chokidar/local_change.js and 3 other locations - About 1 hr to fix
        core/local/chokidar/local_change.js on lines 397..402
        core/local/chokidar/local_change.js on lines 523..528
        core/local/chokidar/local_change.js on lines 655..660

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

          const fileMove /*: Object */ = build('FileMove', e.path, {
            stats: e.stats,
            old: unlinkChange.old,
            ino: unlinkChange.ino,
            wip: e.wip
        Severity: Major
        Found in core/local/chokidar/local_change.js and 3 other locations - About 1 hr to fix
        core/local/chokidar/local_change.js on lines 435..440
        core/local/chokidar/local_change.js on lines 523..528
        core/local/chokidar/local_change.js on lines 655..660

        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

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

          if (
            !srcDoc ||
            srcDoc.path.normalize() === dstEvent.path.normalize() ||
            srcDoc.ino !== dstEvent.stats.ino
          )
        Severity: Major
        Found in core/local/chokidar/local_change.js and 1 other location - About 1 hr to fix
        core/local/chokidar/local_change.js on lines 679..684

        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

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

          if (
            !srcDoc ||
            srcDoc.path.normalize() === dstEvent.path.normalize() ||
            srcDoc.ino !== dstEvent.stats.ino
          )
        Severity: Major
        Found in core/local/chokidar/local_change.js and 1 other location - About 1 hr to fix
        core/local/chokidar/local_change.js on lines 614..619

        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

          log.debug(
            {
              oldpath: dirMove.old.path,
              path: dirMove.path,
              ino: dirMove.ino,
        Severity: Minor
        Found in core/local/chokidar/local_change.js and 1 other location - About 55 mins to fix
        core/local/chokidar/local_change.js on lines 629..637

        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

          log.debug(
            {
              oldpath: fileMove.old.path,
              path: fileMove.path,
              ino: fileMove.ino,
        Severity: Minor
        Found in core/local/chokidar/local_change.js and 1 other location - About 55 mins to fix
        core/local/chokidar/local_change.js on lines 693..701

        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

            log.debug(
              {
                oldpath: moveChange.old && moveChange.old.path,
                path: moveChange.path,
                ino: moveChange.ino
        Severity: Minor
        Found in core/local/chokidar/local_change.js and 1 other location - About 50 mins to fix
        core/local/chokidar/local_change.js on lines 854..861

        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

          log.debug(
            {
              oldPath: moveChange.old && moveChange.old.path,
              path: moveChange.path,
              ino: moveChange.ino
        Severity: Minor
        Found in core/local/chokidar/local_change.js and 1 other location - About 50 mins to fix
        core/local/chokidar/local_change.js on lines 765..772

        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

        There are no issues that match your filters.

        Category
        Status