lacymorrow/crossover

View on GitHub

Showing 28 of 60 total issues

Function appSize has 30 lines of code (exceeds 25 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

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

    const events = () => {
    
        // Sync preferences to renderer
        preferences.on( 'save', options => {
    
    
    Severity: Minor
    Found in src/main/register.js - About 1 hr to fix

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

      const syncSettings = ( options = preferences.preferences ) => {
      
          log.info( 'Sync options' )
      
          // Set app size
      Severity: Minor
      Found in src/main/crossover.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 init has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const init = async options => {
      
          log.info( 'Init', options )
      
          // Cleanup (if reset)
      Severity: Minor
      Found in src/main/init.js - About 1 hr to fix

        Function openSettingsWindow has a Cognitive Complexity of 9 (exceeds 5 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 55 mins to fix

        Cognitive Complexity

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

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

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

        Further reading

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

        const registerKeyboardShortcuts = () => {
        
            // Register all shortcuts
            const { keybinds } = Preferences.getDefaults()
            const custom = preferences.value( 'keybinds' ) // Defaults
        Severity: Minor
        Found in src/main/crossover.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 deepFreeze has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        const deepFreeze = o => {
        
            Object.freeze( o )
        
            for ( const prop of Object.getOwnPropertyNames( o ) ) {
        Severity: Minor
        Found in src/config/utils.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 start has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        const start = async () => {
        
            // Handle errors early
            await errorHandling.init()
        
        
        Severity: Minor
        Found in src/main.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

        Severity
        Category
        Status
        Source
        Language