beforeyoubid/graphql-schema-diff

View on GitHub
src/index.ts

Summary

Maintainability
C
1 day
Test Coverage
A
98%

Showing 7 of 7 total issues

Avoid deeply nested control flow statements.
Open

if (!isInputValueBasicObject(argument.type) && argument.type.kind === 'NonNullType') {
this.mismatches.addedNotNullArguments.push({ field: field2, argument, type });
} else {
this.mismatches.addedArguments.push({ field: field2, argument, type });
}
Severity: Major
Found in src/index.ts - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

    if (
    isArgument &&
    notEmpty(argumentField) &&
    isInputValueDefinition(field) &&
    isInputValueDefinition(field2)
    Severity: Major
    Found in src/index.ts - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

      if (matchingArgument.type.kind === 'NonNullType') {
      this.mismatches.argumentsMadeNullable.push({ argument, type, field: field2 });
      }
      Severity: Major
      Found in src/index.ts - About 45 mins to fix

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

        } else if (isInputValueNonNull(type)) {
        if (isArgument && notEmpty(argumentField) && isInputValueDefinition(field)) {
        this.mismatches.argumentsMadeNullable.push({ field: argumentField, type: objectType, argument: field });
        } else {
        this.mismatches.fieldsMadeNullable.push({ field, type: objectType });
        Severity: Major
        Found in src/index.ts and 1 other location - About 3 hrs to fix
        src/index.ts on lines 117..140

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

        if (isInputValueNonNull(type2)) {
        if (isArgument && notEmpty(argumentField) && isInputValueDefinition(field)) {
        this.mismatches.argumentsMadeNotNull.push({ field: argumentField, type: objectType, argument: field });
        } else {
        this.mismatches.fieldsMadeNotNull.push({ field, type: objectType });
        Severity: Major
        Found in src/index.ts and 1 other location - About 3 hrs to fix
        src/index.ts on lines 123..140

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

        const matchingArgument =
        isFieldDefinition(field) && field.arguments !== undefined
        ? field.arguments.find(arg => arg.name.value === argument.name.value)
        : undefined;
        Severity: Major
        Found in src/index.ts and 1 other location - About 1 hr to fix
        src/index.ts on lines 180..183

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

        const matchingArgument =
        isFieldDefinition(field2) && field2.arguments !== undefined
        ? field2.arguments.find(arg => arg.name.value === argument.name.value)
        : undefined;
        Severity: Major
        Found in src/index.ts and 1 other location - About 1 hr to fix
        src/index.ts on lines 203..206

        There are no issues that match your filters.

        Category
        Status