Skip to content

Entry point #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 33 additions & 29 deletions cldk/analysis/java/java.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,14 @@ def get_variables(self, **kwargs):
raise NotImplementedError(f"Support for this functionality has not been implemented yet.")

def get_service_entry_point_classes(self, **kwargs):
raise NotImplementedError(f"Support for this functionality has not been implemented yet.")
if self.analysis_backend in [AnalysisEngine.CODEQL, AnalysisEngine.TREESITTER]:
raise NotImplementedError(f"Support for this functionality has not been implemented yet.")
return self.backend.get_all_entry_point_classes()

def get_service_entry_point_methods(self, **kwargs):
raise NotImplementedError(f"Support for this functionality has not been implemented yet.")
if self.analysis_backend in [AnalysisEngine.CODEQL, AnalysisEngine.TREESITTER]:
raise NotImplementedError(f"Support for this functionality has not been implemented yet.")
return self.backend.get_all_entry_point_methods()

def get_application_view(self) -> JApplication:
"""
Expand Down Expand Up @@ -483,33 +487,33 @@ def get_class_call_graph(self, qualified_class_name: str, method_signature: str
raise NotImplementedError(f"Support for this functionality has not been implemented yet.")
return self.backend.get_class_call_graph(qualified_class_name, method_signature)

def get_entry_point_classes(self) -> Dict[str, JType]:
"""
Returns a dictionary of all entry point classes in the Java code.

Returns:
--------
Dict[str, JType]
A dict of all entry point classes in the Java code, with qualified class names as keys
"""
if self.analysis_backend in [AnalysisEngine.CODEQL, AnalysisEngine.TREESITTER]:
raise NotImplementedError(f"Support for this functionality has not been implemented yet.")
return self.backend.get_all_entry_point_classes()

def get_entry_point_methods(self) -> Dict[str, Dict[str, JCallable]]:
"""
Returns a dictionary of all entry point methods in the Java code with
qualified class name as key and dictionary of methods in that class
as value

Returns:
--------
Dict[str, Dict[str, JCallable]]:
A dictionary of dictionaries of entry point methods in the Java code.
"""
if self.analysis_backend in [AnalysisEngine.CODEQL, AnalysisEngine.TREESITTER]:
raise NotImplementedError(f"Support for this functionality has not been implemented yet.")
return self.backend.get_all_entry_point_methods()
# def get_entry_point_classes(self) -> Dict[str, JType]:
# """
# Returns a dictionary of all entry point classes in the Java code.
#
# Returns:
# --------
# Dict[str, JType]
# A dict of all entry point classes in the Java code, with qualified class names as keys
# """
# if self.analysis_backend in [AnalysisEngine.CODEQL, AnalysisEngine.TREESITTER]:
# raise NotImplementedError(f"Support for this functionality has not been implemented yet.")
# return self.backend.get_all_entry_point_classes()
#
# def get_entry_point_methods(self) -> Dict[str, Dict[str, JCallable]]:
# """
# Returns a dictionary of all entry point methods in the Java code with
# qualified class name as key and dictionary of methods in that class
# as value
#
# Returns:
# --------
# Dict[str, Dict[str, JCallable]]:
# A dictionary of dictionaries of entry point methods in the Java code.
# """
# if self.analysis_backend in [AnalysisEngine.CODEQL, AnalysisEngine.TREESITTER]:
# raise NotImplementedError(f"Support for this functionality has not been implemented yet.")
# return self.backend.get_all_entry_point_methods()

def remove_all_comments(self) -> str:
"""
Expand Down
98 changes: 0 additions & 98 deletions tests/example.py

This file was deleted.