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' )
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' )
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' )
Function keyboardShortcuts
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
const keyboardShortcuts = () => {
/* Default accelerator */
const accelerator = 'Control+Shift+Alt'
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 */
- 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 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
const init = () => {
/* IP Communication */
ipcMain.on( 'log', ( _event, arg ) => {
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
Function moveWindow
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
const moveWindow = options_ => {
const options = {
distance: 1,
direction: 'none',
- 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 moveWindow
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
const moveWindow = options_ => {
const options = {
distance: 1,
direction: 'none',
Function lockWindow
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
const lockWindow = ( lock, targetWindow = windows.win ) => {
log.info( `Locked: ${lock}` )
/* Actions */
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' ) ) {
Function newGithubIssueUrl
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
const newGithubIssueUrl = ( options = {} ) => {
let repoUrl
if ( options.repoUrl ) {
- 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 newGithubIssueUrl
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
const newGithubIssueUrl = ( options = {} ) => {
let repoUrl
if ( options.repoUrl ) {
- 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 appEvents
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const appEvents = () => {
app.on( 'activate', async () => {
// Will return current window if exists
Function newGithubIssueUrl
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const newGithubIssueUrl = ( options = {} ) => {
let repoUrl
if ( options.repoUrl ) {
Function newGithubIssueUrl
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const newGithubIssueUrl = ( options = {} ) => {
let repoUrl
if ( options.repoUrl ) {
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
- 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 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'
- 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 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' ) ) {
Function createChild
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createChild = async ( parent, windowName ) => {
const VALID_WINDOWS = [ 'chooser' ]
const options = {