diff --git a/javascript/frameworks/cap/lib/advanced_security/javascript/frameworks/cap/CDL.qll b/javascript/frameworks/cap/lib/advanced_security/javascript/frameworks/cap/CDL.qll index fb680fbd6..a67469cb8 100644 --- a/javascript/frameworks/cap/lib/advanced_security/javascript/frameworks/cap/CDL.qll +++ b/javascript/frameworks/cap/lib/advanced_security/javascript/frameworks/cap/CDL.qll @@ -165,8 +165,8 @@ class CdlService extends CdlElement { CdlService() { kind = CdlServiceKind(this.getPropStringValue("kind")) } UserDefinedApplicationService getImplementation() { - this.getFile().getStem() = result.getFile().getStem() + ".cds" and - this.getFile().getParentContainer() = this.getFile().getParentContainer() + result.getFile().getRelativePath().regexpReplaceAll("\\.[^.]+$", ".cds.json") = + this.getFile().getRelativePath() } /** diff --git a/javascript/frameworks/cap/lib/advanced_security/javascript/frameworks/cap/CDS.qll b/javascript/frameworks/cap/lib/advanced_security/javascript/frameworks/cap/CDS.qll index 6f250e458..75af9f1bf 100644 --- a/javascript/frameworks/cap/lib/advanced_security/javascript/frameworks/cap/CDS.qll +++ b/javascript/frameworks/cap/lib/advanced_security/javascript/frameworks/cap/CDS.qll @@ -442,13 +442,7 @@ abstract class UserDefinedApplicationService extends UserDefinedService { /** * Gets the CDS definition of this service. */ - CdlService getCdsDeclaration() { - exists(CdsFile cdsFile | - cdsFile.getStem() = this.getFile().getStem() + ".cds" and - cdsFile.getParentContainer() = this.getFile().getParentContainer() and - result.getFile() = cdsFile - ) - } + CdlService getCdsDeclaration() { result.getImplementation() = this } /** * Gets the name of this service.