From 5c58a01a620d4fec7163190c553898d04e73ab91 Mon Sep 17 00:00:00 2001 From: Fawwaz Anugrah Wiradhika Dharmasatya <anugrahdwfawwaz@gmail.com> Date: Wed, 5 Jun 2024 21:57:31 +0700 Subject: [PATCH] fix: nocheck not working if there are decorator --- src/lib/FileReader.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/FileReader.py b/src/lib/FileReader.py index ee6d0b5..bb05f81 100644 --- a/src/lib/FileReader.py +++ b/src/lib/FileReader.py @@ -44,10 +44,14 @@ class FileReader: else: continue # Tentukan parent node ini - parent = self.cfg_generator.generate(curr_node).ast.parent + parent = self.cfg_generator.generate(curr_node).ast.parent.parent + print(parent) + print(parent.parent) # Kasih keterangan tambahan ke konteks modul/fungsi yang merupakan parent fungsi ini. for route in project_info.route_class: + print(route.cfg.ast) if route.location==file and (CFG.is_node_equal(route.cfg.ast,parent) or CFG.is_node_equal(route.cfg.ast,parent.parent)): + print("masuk") route.context.append(f"Exempt::{curr_node.name.split('(')[0]}") elif("@ACL" in annotation): # Ini kelas acl -- GitLab