devopslibrary/adde

View on GitHub

Showing 53 of 53 total issues

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

isFile(reqPath): boolean {
if (fs.existsSync(reqPath) && fs.statSync(reqPath).isFile()) {
return true;
} else {
return false;
Severity: Major
Found in backend/src/restAPI/restAPI.service.ts and 1 other location - About 1 hr to fix
backend/src/restAPI/restAPI.service.ts on lines 61..67

Function getUserRepoInstallations has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

public getUserRepoInstallations(githubUser: User) {
return this.getUserInstallations(githubUser).then(async installations => {
const userRepoInstallations = [];
await Promise.all(
installations.map(async installation => {
Severity: Minor
Found in backend/src/auth/auth.service.ts - About 1 hr to fix

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

    const keys = await service.getCommonPropertiesWithinArray([
    {
    count: 500,
    name: 'Old Legacy Application',
    serverType: 'iis',
    Severity: Major
    Found in backend/src/schema/schema.service.spec.ts and 1 other location - About 1 hr to fix
    backend/src/schema/schema.service.spec.ts on lines 184..198

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

    const keys = service.getCommonKeysWithinArrayOfObjects([
    {
    count: 500,
    name: 'Old Legacy Application',
    serverType: 'iis',
    Severity: Major
    Found in backend/src/schema/schema.service.spec.ts and 1 other location - About 1 hr to fix
    backend/src/schema/schema.service.spec.ts on lines 17..31

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

    expect(
    service.filterByQueryParams(sampleResources, {
    color: 'green',
    size: 'small',
    shape: 'square',
    Severity: Major
    Found in backend/src/restAPI/restAPI.service.spec.ts and 1 other location - About 1 hr to fix
    backend/src/restAPI/restAPI.service.spec.ts on lines 170..187

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

    expect(
    service.filterByQueryParams(sampleResources, { color: 'blue' }),
    ).toEqual([
    {
    name: 'A large blue round ball that smells faintly sweet',
    Severity: Major
    Found in backend/src/restAPI/restAPI.service.spec.ts and 1 other location - About 1 hr to fix
    backend/src/restAPI/restAPI.service.spec.ts on lines 190..211

    Function getCommonKeysWithinArrayOfObjects has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    getCommonKeysWithinArrayOfObjects(objectArray): string[] {
    // Get all unique keys across all Objects
    let allKeys = [];
    for (const object of objectArray) {
    if (Array.isArray(object)) {
    Severity: Minor
    Found in backend/src/schema/schema.service.ts - About 1 hr to fix

      Function onApplicationBootstrap has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      async onApplicationBootstrap() {
      // Clone All Repositories
      const installations = await this.githubService.getAllInstallations();
      for (const installation of installations) {
      if (installation['suspended_at'] == null) {
      Severity: Minor
      Found in backend/src/bootstrap/bootstrap.service.ts - About 35 mins to fix

      Function value has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      static value(name) {
      if (!(name in this.CONFIG)) {
      console.log(`Configuration: There is no key named "${name}"`);
      return;
      }
      Severity: Minor
      Found in frontend/src/config/configuration.js - About 35 mins to fix

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

      for (const fileName of jsonFileNamesInFolder) {
      const fileData = JSON.parse(
      fs.readFileSync(folderPath + '/' + fileName, 'utf8'),
      );
      parsedFiles.push(fileData);
      Severity: Minor
      Found in backend/src/schema/schema.service.ts and 1 other location - About 35 mins to fix
      backend/src/restAPI/restAPI.service.ts on lines 112..117

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

      } else {
      const fileData = JSON.parse(
      fs.readFileSync(reqPath + '/' + name, 'utf8'),
      );
      resourceList.push(fileData);
      Severity: Minor
      Found in backend/src/restAPI/restAPI.service.ts and 1 other location - About 35 mins to fix
      backend/src/schema/schema.service.ts on lines 123..128

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

      const module: TestingModule = await Test.createTestingModule({
      controllers: [HealthController],
      imports: [TerminusModule],
      }).compile();
      Severity: Minor
      Found in backend/src/health/health.controller.spec.ts and 1 other location - About 30 mins to fix
      backend/src/git/git.service.spec.ts on lines 17..20

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

      const module: TestingModule = await Test.createTestingModule({
      providers: [GitService],
      imports: [ConfigModule],
      }).compile();
      Severity: Minor
      Found in backend/src/git/git.service.spec.ts and 1 other location - About 30 mins to fix
      backend/src/health/health.controller.spec.ts on lines 9..12
      Severity
      Category
      Status
      Source
      Language