Skip to content

Commit 94ba8d2

Browse files
authored
Merge pull request #177 from advanced-security/lcartey/performance-improvements
Address a performance regression in recent upgrade
2 parents c3d6d1c + fc5bcfb commit 94ba8d2

File tree

2 files changed

+3
-9
lines changed
  • javascript/frameworks/cap/lib/advanced_security/javascript/frameworks/cap

2 files changed

+3
-9
lines changed

javascript/frameworks/cap/lib/advanced_security/javascript/frameworks/cap/CDL.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ class CdlService extends CdlElement {
165165
CdlService() { kind = CdlServiceKind(this.getPropStringValue("kind")) }
166166

167167
UserDefinedApplicationService getImplementation() {
168-
this.getFile().getStem() = result.getFile().getStem() + ".cds" and
169-
this.getFile().getParentContainer() = this.getFile().getParentContainer()
168+
result.getFile().getRelativePath().regexpReplaceAll("\\.[^.]+$", ".cds.json") =
169+
this.getFile().getRelativePath()
170170
}
171171

172172
/**

javascript/frameworks/cap/lib/advanced_security/javascript/frameworks/cap/CDS.qll

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -442,13 +442,7 @@ abstract class UserDefinedApplicationService extends UserDefinedService {
442442
/**
443443
* Gets the CDS definition of this service.
444444
*/
445-
CdlService getCdsDeclaration() {
446-
exists(CdsFile cdsFile |
447-
cdsFile.getStem() = this.getFile().getStem() + ".cds" and
448-
cdsFile.getParentContainer() = this.getFile().getParentContainer() and
449-
result.getFile() = cdsFile
450-
)
451-
}
445+
CdlService getCdsDeclaration() { result.getImplementation() = this }
452446

453447
/**
454448
* Gets the name of this service.

0 commit comments

Comments
 (0)