Showing 79 of 148 total issues
Function buildNativefierApp
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
export async function buildNativefierApp(
rawOptions: RawOptions,
): Promise<string> {
// early-suppress potential logging before full options handling
if (rawOptions.quiet) {
- 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 findSync
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
function findSync(
pattern: RegExp,
basePath: string,
limitSearchToDirectories = false,
): string[] {
- 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 createTrayIcon
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function createTrayIcon(
nativefierOptions: OutputOptions,
mainWindow: BrowserWindow,
): Tray | undefined {
const options = { ...nativefierOptions };
File mainWindow.ts
has 275 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as fs from 'fs';
import * as path from 'path';
import {
desktopCapturer,
Function getAllowedIconFormats
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export function getAllowedIconFormats(platform: string): string[] {
const hasIdentify = hasbin.sync('identify') || hasbin.sync('gm');
const hasConvert = hasbin.sync('convert') || hasbin.sync('gm');
const hasIconUtil = hasbin.sync('iconutil');
- 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 getAllowedIconFormats
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function getAllowedIconFormats(platform: string): string[] {
const hasIdentify = hasbin.sync('identify') || hasbin.sync('gm');
const hasConvert = hasbin.sync('convert') || hasbin.sync('gm');
const hasIconUtil = hasbin.sync('iconutil');
Function checkApp
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function checkApp(
appRoot: string,
inputOptions: RawOptions,
): Promise<void> {
const arch = inputOptions.arch ? inputOptions.arch : inferArch();
Function convertIconIfNecessary
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function convertIconIfNecessary(options: AppOptions): void {
if (!options.packager.icon) {
log.debug('Option "icon" not set, skipping icon conversion.');
return;
}
Function convertIconIfNecessary
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export function convertIconIfNecessary(options: AppOptions): void {
if (!options.packager.icon) {
log.debug('Option "icon" not set, skipping icon conversion.');
return;
}
- 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 setupSessionInteraction
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setupSessionInteraction(window: BrowserWindow): void {
// See API.md / "Accessing The Electron Session"
ipcMain.on(
'session-interaction',
(event, request: SessionInteractionRequest) => {
Function injectBookmarks
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
function injectBookmarks(menuTemplate: MenuItemConstructorOptions[]): void {
const bookmarkConfigPath = path.join(__dirname, '..', 'bookmarks.json');
if (!fs.existsSync(bookmarkConfigPath)) {
return;
Function getLatestSafariVersion
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function getLatestSafariVersion(
url = SAFARI_VERSIONS_HISTORY_URL,
): Promise<SafariVersion> {
try {
log.debug('Grabbing apple version data from', url);
Function onNewWindowHelper
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function onNewWindowHelper(
options: WindowOptions,
setupWindow: (options: WindowOptions, window: BrowserWindow) => void,
details: HandlerDetails,
parent?: BrowserWindow,
Function checkApp
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
async function checkApp(
appRoot: string,
inputOptions: RawOptions,
): Promise<void> {
const arch = inputOptions.arch ? inputOptions.arch : inferArch();
- 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 createTrayIcon
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export function createTrayIcon(
nativefierOptions: OutputOptions,
mainWindow: BrowserWindow,
): Tray | undefined {
const options = { ...nativefierOptions };
- 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 getInfoPListOptions
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getInfoPListOptions(
appResourcesDir: string,
priorOptions: NativefierOptions,
): NativefierOptions {
if (!fileExists(path.join(appResourcesDir, '..', '..', 'Info.plist'))) {
Function injectBookmarks
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function injectBookmarks(menuTemplate: MenuItemConstructorOptions[]): void {
const bookmarkConfigPath = path.join(__dirname, '..', 'bookmarks.json');
if (!fs.existsSync(bookmarkConfigPath)) {
return;
- 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 setupScreenSharePicker
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setupScreenSharePicker(
resolve: (value: MediaStream | PromiseLike<MediaStream>) => void,
reject: (reason?: unknown) => void,
sources: Electron.DesktopCapturerSource[],
): void {
Function initContextMenu
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function initContextMenu(
options: OutputOptions,
window?: BrowserWindow,
): void {
log.debug('initContextMenu');
Function onReady
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
async function onReady(): Promise<void> {
// Warning: `mainWindow` below is the *global* unique `mainWindow`, created at init time
mainWindow = await createMainWindow(appArgs, setDockBadge);
createTrayIcon(appArgs, mainWindow);
- 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"