lacymorrow/crossover

View on GitHub

Showing 28 of 60 total issues

File preferences.js has 591 lines of code (exceeds 250 allowed). Consider refactoring.
Open

const { app } = require( 'electron' )
const path = require( 'path' )
const { debugInfo, is } = require( 'electron-util' )
const ElectronPreferences = require( 'electron-preferences' )
const { DEFAULT_THEME, FILE_FILTERS, SETTINGS_WINDOW_DEVTOOLS, SUPPORTED_IMAGE_FILE_TYPES, DEBOUNCE_DELAY } = require( '../config/config.js' )
Severity: Major
Found in src/main/preferences.js - About 1 day to fix

    File windows.js has 356 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    const path = require( 'path' )
    
    const { app, BrowserWindow, screen } = require( 'electron' )
    
    const { activeWindow, centerWindow, is } = require( './util' )
    Severity: Minor
    Found in src/main/windows.js - About 4 hrs to fix

      File crossover.js has 346 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      const { globalShortcut, nativeTheme, shell, app } = require( 'electron' )
      const { SHADOW_WINDOW_OFFSET, DEFAULT_THEME, SETTINGS_WINDOW_DEVTOOLS, APP_BACKGROUND_OPACITY } = require( '../config/config' )
      const { checkboxTrue, hexToRgbA } = require( '../config/utils' )
      const dock = require( './dock' )
      const iohook = require( './iohook' )
      Severity: Minor
      Found in src/main/crossover.js - About 4 hrs to fix

        Function keyboardShortcuts has 88 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const keyboardShortcuts = () => {
        
            /* Default accelerator */
            const accelerator = 'Control+Shift+Alt'
        
        
        Severity: Major
        Found in src/main/crossover.js - About 3 hrs to fix

          Function lockWindow has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
          Open

          const lockWindow = ( lock, targetWindow = windows.win ) => {
          
              log.info( `Locked: ${lock}` )
          
              /* Actions */
          Severity: Minor
          Found in src/main/crossover.js - About 2 hrs to fix

          Cognitive Complexity

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

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

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

          Further reading

          Function init has 63 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const init = () => {
          
              /* IP Communication */
              ipcMain.on( 'log', ( _event, arg ) => {
          
          
          Severity: Major
          Found in src/main/ipc.js - About 2 hrs to fix

            Function syncSettings has 54 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const syncSettings = ( options = preferences.preferences ) => {
            
                log.info( 'Sync options' )
            
                // Set app size
            Severity: Major
            Found in src/main/crossover.js - About 2 hrs to fix

              Function moveWindow has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

              const moveWindow = options_ => {
              
                  const options = {
                      distance: 1,
                      direction: 'none',
              Severity: Minor
              Found in src/main/windows.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 moveWindow has 45 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const moveWindow = options_ => {
              
                  const options = {
                      distance: 1,
                      direction: 'none',
              Severity: Minor
              Found in src/main/windows.js - About 1 hr to fix

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

                const lockWindow = ( lock, targetWindow = windows.win ) => {
                
                    log.info( `Locked: ${lock}` )
                
                    /* Actions */
                Severity: Minor
                Found in src/main/crossover.js - About 1 hr to fix

                  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

                    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

                    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

                      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

                            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