domjtalbot/nx-mesh

View on GitHub

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) {
Severity: Major
Found in packages/nx-mesh/src/executors/build-swc/build-swc.ts - About 4 hrs to fix

    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) {
    Severity: Major
    Found in packages/nx-mesh/src/executors/build/build.ts - About 4 hrs to fix

      Function compileSwcWatch has 88 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export async function* compileSwcWatch(
        context: ExecutorContext,
        normalizedOptions: NormalizedSwcExecutorOptions,
        postCompilationCallback: () => Promise<void>
      ) {
      Severity: Major
      Found in packages/nx-mesh/src/executors/build-swc/swc-executor/compile-swc.ts - About 3 hrs to fix

        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';
        Severity: Minor
        Found in packages/nx-mesh/src/generators/base/base.spec.ts - About 3 hrs to fix

          Function addProjectConfig has 79 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function addProjectConfig(tree: Tree, options: NormalizedOptions) {
            const {
              codegen,
              isApp,
              isLibrary,
          Severity: Major
          Found in packages/nx-mesh/src/generators/base/lib/add-project-config.ts - About 3 hrs to fix

            Function swcExecutor has 76 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export async function* swcExecutor(
              _options: SwcExecutorOptions,
              context: ExecutorContext
            ) {
              const { sourceRoot, root } =
            Severity: Major
            Found in packages/nx-mesh/src/executors/build-swc/swc-executor/swc.impl.ts - About 3 hrs to fix

              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);
              Severity: Major
              Found in packages/nx-mesh/src/generators/base/lib/normalize-options.ts - About 2 hrs to fix

                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 () => {};
                  }
                Severity: Minor
                Found in packages/nx-mesh/src/generators/base/lib/add-jest.ts - About 1 hr to fix

                  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 normalizeOptions has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function normalizeOptions(
                      options: SwcExecutorOptions,
                      contextRoot: string,
                      sourceRoot?: string,
                      projectRoot?: string
                    Severity: Minor
                    Found in packages/nx-mesh/src/executors/build-swc/swc-executor/swc.impl.ts - About 1 hr to fix

                      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) {
                      Severity: Minor
                      Found in packages/nx-mesh/src/executors/start/start.ts - About 1 hr to fix

                        Function createPackageJson has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export async function createPackageJson(
                          options: {
                            dir: string;
                            outputPath: string;
                            projectRoot?: string;
                        Severity: Minor
                        Found in packages/nx-mesh/src/utils/create-package-json.ts - About 1 hr to fix

                          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);
                          Severity: Minor
                          Found in packages/nx-mesh/src/executors/dev/dev.ts - About 1 hr to fix

                            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) {
                            Severity: Minor
                            Found in packages/nx-mesh/src/executors/build-gateway/build-gateway.ts - About 1 hr to fix

                              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'),
                              Severity: Minor
                              Found in packages/nx-mesh/src/generators/base/lib/create-files.ts - About 1 hr to fix

                                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,
                                Severity: Minor
                                Found in packages/nx-mesh/src/generators/base/lib/add-cypress.ts - About 1 hr to fix

                                  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, {
                                  Severity: Minor
                                  Found in packages/nx-mesh/src/generators/base/lib/add-linting.ts - About 1 hr to fix

                                    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);
                                    Severity: Minor
                                    Found in packages/nx-mesh/src/generators/base/lib/normalize-options.ts - About 1 hr to fix

                                    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,
                                    Severity: Minor
                                    Found in packages/nx-mesh/src/executors/dev/lib/get-serve-location.ts - About 1 hr to fix

                                    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: StartExecutorSchema) {
                                      let port = options.port.number ?? 4200;
                                      const isRange = options.port.range !== undefined;
                                      const range = getPort.makeRange(
                                        options.port.range?.from ?? 1024,
                                    Severity: Minor
                                    Found in packages/nx-mesh/src/executors/start/lib/get-serve-location.ts - About 1 hr to fix

                                    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

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language