supergraphql/graphql-cli-prepare

View on GitHub

Showing 4 of 111 total issues

Function determineInputSchema has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  private determineInputSchema(schemaPath: string | undefined): string {
    const bundleDefined = has(this.project.config, 'extensions.prepare-bundle.output')
    const oldBundleDefined = has(this.project.config, 'extensions.bundle.output')
    // schemaPath is only set when bundle ran
    if (!schemaPath) {
Severity: Minor
Found in src/prepare.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 determineBindingOutputPath has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  private determineBindingOutputPath(extension: string) {
    let outputPath: string
    if (this.argv.output) {
      outputPath = path.join(this.argv.output, `${this.projectName}.${extension}`)
    } else if (has(this.project.config, `extensions.binding.output`)) {
Severity: Minor
Found in src/prepare.ts - About 25 mins 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 getProjectConfig has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  private getProjectConfig(): { [name: string]: GraphQLProjectConfig } {
    let projects: { [name: string]: GraphQLProjectConfig } | undefined
    if (this.argv.project) {
      if (Array.isArray(this.argv.project)) {
        projects = {}
Severity: Minor
Found in src/prepare.ts - About 25 mins 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 determineBundleOutputPath has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  private determineBundleOutputPath() {
    let outputPath: string
    if (this.argv.output) {
      outputPath = path.join(this.argv.output, `${this.projectName}.graphql`)
    } else if (has(this.project.config, `extensions.bundle`)) {
Severity: Minor
Found in src/prepare.ts - About 25 mins 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