lacymorrow/crossover

View on GitHub

Showing 60 of 60 total issues

Function openSettingsWindow has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const openSettingsWindow = async () => {

    // Don't do anything if locked
    if ( preferences.value( 'hidden.locked' ) ) {

Severity: Minor
Found in src/main/crossover.js - About 1 hr to fix

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

    const centerWindow = options => {
    
        options = {
            window: activeWindow(),
            animated: true,
    Severity: Major
    Found in src/main/util-for-12.js and 1 other location - About 1 hr to fix
    src/main/util.js on lines 52..63

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

    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

    const centerWindow = options => {
    
        options = {
            window: activeWindow(),
            animated: true,
    Severity: Major
    Found in src/main/util.js and 1 other location - About 1 hr to fix
    src/main/util-for-12.js on lines 52..63

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

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

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

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

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

    Refactorings

    Further Reading

    Function newGithubIssueUrl has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    const newGithubIssueUrl = ( options = {} ) => {
    
        let repoUrl
        if ( options.repoUrl ) {
    
    
    Severity: Minor
    Found in src/main/util-for-12.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 newGithubIssueUrl has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    const newGithubIssueUrl = ( options = {} ) => {
    
        let repoUrl
        if ( options.repoUrl ) {
    
    
    Severity: Minor
    Found in src/main/util.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

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

            case 'left':
                newBound = bounds.x - options.distance
                options.targetWindow.setBounds( { x: newBound } )
                if ( shouldSaveSettings ) {
    
    
    Severity: Major
    Found in src/main/windows.js and 3 other locations - About 1 hr to fix
    src/main/windows.js on lines 453..462
    src/main/windows.js on lines 463..472
    src/main/windows.js on lines 483..492

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

    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

            case 'up':
                newBound = bounds.y - options.distance
                options.targetWindow.setBounds( { y: newBound } )
                if ( shouldSaveSettings ) {
    
    
    Severity: Major
    Found in src/main/windows.js and 3 other locations - About 1 hr to fix
    src/main/windows.js on lines 463..472
    src/main/windows.js on lines 473..482
    src/main/windows.js on lines 483..492

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

    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

            case 'right':
                newBound = bounds.x + options.distance
                options.targetWindow.setBounds( { x: newBound } )
                if ( shouldSaveSettings ) {
    
    
    Severity: Major
    Found in src/main/windows.js and 3 other locations - About 1 hr to fix
    src/main/windows.js on lines 453..462
    src/main/windows.js on lines 463..472
    src/main/windows.js on lines 473..482

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

    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

            case 'down':
                newBound = bounds.y + options.distance
                options.targetWindow.setBounds( { y: newBound } )
                if ( shouldSaveSettings ) {
    
    
    Severity: Major
    Found in src/main/windows.js and 3 other locations - About 1 hr to fix
    src/main/windows.js on lines 453..462
    src/main/windows.js on lines 473..482
    src/main/windows.js on lines 483..492

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

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

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

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

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

    Refactorings

    Further Reading

    Function appEvents has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const appEvents = () => {
    
        app.on( 'activate', async () => {
    
            // Will return current window if exists
    Severity: Minor
    Found in src/main/register.js - About 1 hr to fix

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

      module.exports = {
          is,
          activeWindow,
          centerWindow,
          debugInfo,
      Severity: Major
      Found in src/main/util-for-12.js and 1 other location - About 1 hr to fix
      src/main/util.js on lines 263..274

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

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

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

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

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

      Refactorings

      Further Reading

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

      module.exports = {
          is,
          activeWindow,
          centerWindow,
          debugInfo,
      Severity: Major
      Found in src/main/util.js and 1 other location - About 1 hr to fix
      src/main/util-for-12.js on lines 263..274

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

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

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

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

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

      Refactorings

      Further Reading

      Function newGithubIssueUrl has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const newGithubIssueUrl = ( options = {} ) => {
      
          let repoUrl
          if ( options.repoUrl ) {
      
      
      Severity: Minor
      Found in src/main/util.js - About 1 hr to fix

        Function newGithubIssueUrl has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const newGithubIssueUrl = ( options = {} ) => {
        
            let repoUrl
            if ( options.repoUrl ) {
        
        
        Severity: Minor
        Found in src/main/util-for-12.js - About 1 hr to fix

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

          const appEvents = () => {
          
              app.on( 'activate', async () => {
          
                  // Will return current window if exists
          Severity: Minor
          Found in src/main/register.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 appSize has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          const appSize = size => {
          
              // Detect if setting changed and app needs updating
              let bounds = windows.win.getBounds()
              let currentMode = 'normal'
          Severity: Minor
          Found in src/main/set.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 initShadowWindow has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const initShadowWindow = async () => {
          
              log.info( 'Trying to create shadow window...' )
          
              if ( preferences.value( 'hidden.locked' ) ) {
          Severity: Minor
          Found in src/main/crossover.js - About 1 hr to fix

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

                                        {
                                            label: 'App Size',
                                            key: 'appSize',
                                            type: 'radio',
                                            options: [
            Severity: Major
            Found in src/main/preferences.js and 2 other locations - About 1 hr to fix
            src/main/preferences.js on lines 155..164
            src/main/preferences.js on lines 466..475

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

                                        {
                                            label: 'Color Scheme',
                                            key: 'theme',
                                            type: 'radio',
                                            options: [
            Severity: Major
            Found in src/main/preferences.js and 2 other locations - About 1 hr to fix
            src/main/preferences.js on lines 155..164
            src/main/preferences.js on lines 456..465

            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

            Function createChild has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const createChild = async ( parent, windowName ) => {
            
                const VALID_WINDOWS = [ 'chooser' ]
            
                const options = {
            Severity: Minor
            Found in src/main/windows.js - About 1 hr to fix
              Severity
              Category
              Status
              Source
              Language