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'
Function events
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const events = () => {
// Sync preferences to renderer
preferences.on( 'save', options => {
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
- Read upRead up
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)
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' ) ) {
- Read upRead up
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
- Read upRead up
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 ) ) {
- Read upRead up
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()
- Read upRead up
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"