supergraphql/graphql-cli-prepare

View on GitHub

Showing 108 of 111 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

if (this.argv.output) {
outputPath = path.join(this.argv.output, `${this.projectName}.${extension}`)
} else if (has(this.project.config, `extensions.binding.output`)) {
if (!this.argv.save) {
this.context.spinner.warn(
Severity: Major
Found in src/prepare.ts and 1 other location - About 5 hrs to fix
src/prepare.ts on lines 274..289

Similar blocks of code found in 2 locations. Consider refactoring.
Open

if (this.argv.output) {
outputPath = path.join(this.argv.output, `${this.projectName}.graphql`)
} else if (has(this.project.config, `extensions.bundle`)) {
if (!this.argv.save) {
this.context.spinner.warn(
Severity: Major
Found in src/prepare.ts and 1 other location - About 5 hrs to fix
src/prepare.ts on lines 246..261

Similar blocks of code found in 2 locations. Consider refactoring.
Open

if (
this.argv.project ||
(!this.argv.project &&
(has(this.project.config, 'extensions.prepare-bundle') ||
has(this.project.config, 'extensions.bundle')))
Severity: Major
Found in src/prepare.ts and 1 other location - About 1 hr to fix
src/prepare.ts on lines 48..68

Similar blocks of code found in 2 locations. Consider refactoring.
Open

if (
this.argv.project ||
(!this.argv.project &&
(has(this.project.config, 'extensions.prepare-binding') ||
has(this.project.config, 'extensions.binding')))
Severity: Major
Found in src/prepare.ts and 1 other location - About 1 hr to fix
src/prepare.ts on lines 72..90

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

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

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

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

Missing semicolon
Open

import { CommandBuilder } from 'yargs'
Severity: Minor
Found in src/index.ts by tslint

Missing semicolon
Open

const configFile = path.basename(this.config.configPath)
Severity: Minor
Found in src/prepare.ts by tslint

Missing semicolon
Open

const schemaPath: string = this.determineSchemaPath()
Severity: Minor
Found in src/prepare.ts by tslint

Missing semicolon
Open

const outputPath: string = this.determineBindingOutputPath(extension)
Severity: Minor
Found in src/prepare.ts by tslint

Missing semicolon
Open

const schemaContents: string = importSchema(schema)
Severity: Minor
Found in src/prepare.ts by tslint

Missing semicolon
Open

throw new Error(`No schemaPath defined for project '${this.projectName}' in config file.`)
Severity: Minor
Found in src/prepare.ts by tslint

Missing semicolon
Open

import * as fs from 'fs-extra'
Severity: Minor
Found in src/prepare.ts by tslint

Missing semicolon
Open

private projectName: string
Severity: Minor
Found in src/prepare.ts by tslint

Missing semicolon
Open

)
Severity: Minor
Found in src/prepare.ts by tslint

Missing semicolon
Open

)
Severity: Minor
Found in src/prepare.ts by tslint

Missing semicolon
Open

outputPath = get(this.project.config, `extensions.bundle`)
Severity: Minor
Found in src/prepare.ts by tslint

Missing semicolon
Open

}
Severity: Minor
Found in src/index.ts by tslint
Severity
Category
Status
Source
Language