Showing 29 of 553 total issues
Function buildExecutor
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default async function* buildExecutor(
options: BuildSWCExecutorSchema,
context: ExecutorContext
) {
if (options.dir === undefined) {
Function buildExecutor
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default async function* buildExecutor(
options: BuildExecutorSchema,
context: ExecutorContext
) {
if (options.dir === undefined) {
Function compileSwcWatch
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function* compileSwcWatch(
context: ExecutorContext,
normalizedOptions: NormalizedSwcExecutorOptions,
postCompilationCallback: () => Promise<void>
) {
File base.spec.ts
has 304 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type { Tree } from '@nrwl/devkit';
import type { BaseOptions } from './schema';
import * as devkit from '@nrwl/devkit/';
import { getProjects, readJson } from '@nrwl/devkit';
Function addProjectConfig
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function addProjectConfig(tree: Tree, options: NormalizedOptions) {
const {
codegen,
isApp,
isLibrary,
Function swcExecutor
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function* swcExecutor(
_options: SwcExecutorOptions,
context: ExecutorContext
) {
const { sourceRoot, root } =
Function normalizeOptions
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function normalizeOptions(
tree: Tree,
options: BaseOptions
): NormalizedOptions {
const workspace = getWorkspaceLayout(tree);
Function addJest
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function addJest(host: Tree, options: NormalizedOptions) {
if (options.unitTestRunner !== 'jest') {
// eslint-disable-next-line @typescript-eslint/no-empty-function
return () => {};
}
Function normalizeOptions
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function normalizeOptions(
options: SwcExecutorOptions,
contextRoot: string,
sourceRoot?: string,
projectRoot?: string
Function default
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default async function (tree: Tree) {
let changesMade = false;
const projects = getProjects(tree);
forEachExecutorOptions(
Function startExecutor
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function* startExecutor(
options: StartExecutorSchema,
context: ExecutorContext
) {
if (options.dir === undefined) {
Function createPackageJson
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function createPackageJson(
options: {
dir: string;
outputPath: string;
projectRoot?: string;
Function devExecutor
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function* devExecutor(
options: DevExecutorSchema,
context: ExecutorContext
) {
const { baseUrl, port } = await getServeLocation(options);
Function buildExecutor
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default async function* buildExecutor(
options: BuildGatewayExecutorSchema,
context: ExecutorContext
) {
if (options.dir === undefined) {
Function createFiles
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function createFiles(tree: Tree, options: NormalizedOptions) {
if (options.isApp) {
generateFiles(
tree,
path.join(__dirname, '../files/app'),
Function addLinting
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function addLinting(
host: Tree,
options: NormalizedOptions
): Promise<GeneratorCallback> {
const linting = await lintProjectGenerator(host, {
Function addCypress
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function addCypress(host: Tree, options: NormalizedOptions) {
const task = await cypressProjectGenerator(host, {
...options,
directory: options.projectParentDirectory,
linter: Linter.EsLint,
Function getServeLocation
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export async function getServeLocation(options: StartExecutorSchema) {
let port = options.port.number ?? 4200;
const isRange = options.port.range !== undefined;
const range = getPort.makeRange(
options.port.range?.from ?? 1024,
- 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 getServeLocation
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export async function getServeLocation(options: DevExecutorSchema) {
let port = options.port.number ?? 4200;
const isRange = options.port.range !== undefined;
const range = getPort.makeRange(
options.port.range?.from ?? 1024,
- 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 normalizeOptions
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function normalizeOptions(
tree: Tree,
options: BaseOptions
): NormalizedOptions {
const workspace = getWorkspaceLayout(tree);
- 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"