Showing 79 of 148 total issues
Function generateMenu
has 291 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function generateMenu(
options: {
disableDevTools: boolean;
nativefierVersion: string;
zoom?: number;
Function getOptions
has 204 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function getOptions(rawOptions: RawOptions): Promise<AppOptions> {
const options: AppOptions = {
packager: {
appCopyright: rawOptions.appCopyright,
appVersion: rawOptions.appVersion,
File menu.ts
has 398 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as fs from 'fs';
import path from 'path';
import {
BrowserWindow,
Function getOptions
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
export async function getOptions(rawOptions: RawOptions): Promise<AppOptions> {
const options: AppOptions = {
packager: {
appCopyright: rawOptions.appCopyright,
appVersion: rawOptions.appVersion,
- 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
File main.ts
has 366 lines of code (exceeds 250 allowed). Consider refactoring. Open
import 'source-map-support/register';
import fs from 'fs';
import * as path from 'path';
Function getOptionsFromExecutable
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
export function getOptionsFromExecutable(
appResourcesDir: string,
priorOptions: NativefierOptions,
): NativefierOptions {
const newOptions: NativefierOptions = { ...priorOptions };
- 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 getOptionsFromExecutable
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function getOptionsFromExecutable(
appResourcesDir: string,
priorOptions: NativefierOptions,
): NativefierOptions {
const newOptions: NativefierOptions = { ...priorOptions };
Function buildNativefierApp
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function buildNativefierApp(
rawOptions: RawOptions,
): Promise<string> {
// early-suppress potential logging before full options handling
if (rawOptions.quiet) {
File playwright-test.ts
has 325 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { once } from 'events';
import * as fs from 'fs';
import * as path from 'path';
import { Shell } from 'electron';
Function setupScreenSharePickerStyles
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setupScreenSharePickerStyles(id: string): void {
const screenShareStyles = document.createElement('style');
screenShareStyles.id = id;
screenShareStyles.innerHTML = `
.desktop-capturer-selection {
File windowEvents.test.ts
has 303 lines of code (exceeds 250 allowed). Consider refactoring. Open
jest.mock('./helpers');
jest.mock('./windowEvents');
jest.mock('./windowHelpers');
import { dialog, BrowserWindow, HandlerDetails, WebContents } from 'electron';
File windowHelpers.ts
has 303 lines of code (exceeds 250 allowed). Consider refactoring. Open
import path from 'path';
import {
dialog,
BrowserWindow,
Function createMainWindow
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function createMainWindow(
nativefierOptions: OutputOptions,
setDockBadge: (value: number | string, bounce?: boolean) => void,
): Promise<BrowserWindow> {
const options = { ...nativefierOptions };
Function pickElectronAppArgs
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
function pickElectronAppArgs(options: AppOptions): OutputOptions {
return {
accessibilityPrompt: options.nativefier.accessibilityPrompt,
alwaysOnTop: options.nativefier.alwaysOnTop,
appBundleId: options.packager.appBundleId,
File helpers.test.ts
has 298 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { shell } from 'electron';
jest.mock('./windowHelpers');
import {
cleanupPlainText,
Function generateMenu
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
export function generateMenu(
options: {
disableDevTools: boolean;
nativefierVersion: string;
zoom?: number;
- 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
File preload.ts
has 295 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Preload file that will be executed in the renderer process.
* Note: This needs to be attached **prior to imports**, as imports
* would delay the attachment till after the event has been raised.
*/
File cli.test.ts
has 290 lines of code (exceeds 250 allowed). Consider refactoring. Open
import 'source-map-support/register';
import { initArgs, parseArgs } from './cli';
import { parseJson } from './utils/parseUtils';
Function onReady
has 70 lines of code (exceeds 25 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);
Function spawnApp
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
const spawnApp = async (
playwrightConfig: NativefierOptions = { ...DEFAULT_CONFIG },
awaitFirstWindow = true,
preventNavigation = false,
): Promise<Page | undefined> => {