Query your code model using CppDepend AI

Query your code model using CppDepend AI

CppDepend offers a powerful tool for analyzing and understanding your codebase through its comprehensive Code Model. This model provides a detailed representation of the codebase, capturing various aspects of the source code and its structure. By analyzing the code, CppDepend extracts a wealth of information that facilitates a variety of analyses and visualizations.

CppDepend AI introduces a revolutionary feature that allows developers to easily query this code model using natural language commands. This capability simplifies the process of extracting and understanding critical information from your codebase, making it more efficient and user-friendly.

To demonstrate the capabilities of CppDepend AI, we will use the Poco Project as an example.

Give Me Methods Where Complexity > 20

To find methods with a complexity greater than 20, simply write in the Ask CppDepend AI area:
give me methods where complexity > 20

CppDepend AI will analyze the codebase and provide a detailed list of methods that meet this complexity criterion, helping you identify potential areas for refactoring.

CppDepend AI provides an interactive chat, so you can ask to complements the previous result and add another metric:

Give Me Types Where Lines of Code More Than 500

To identify types with more than 500 lines of code, write:
give me types where lines of code more than 500

This request will help you find large types that might need to be broken down into smaller, more manageable components.

Types with Poor Cohesion

For a focused query on types with poor cohesion, write:
types with poor cohesion

CppDepend AI will list types with low cohesion, highlighting areas where code organization and modularity can be improved.

High Coupled Types

To identify types with high coupling, write:
high coupled types

This request will provide a list of highly coupled types, helping you understand and address tight dependencies within your codebase.

Big Methods

For a granular query on large methods, write:
big methods

CppDepend AI will analyze and provide a list of big methods, allowing you to identify methods that might benefit from refactoring to improve readability and maintainability.



More advanced queries could be managed by CppDepend AI, we can enumerate:
  • methods of classes inheriting from the fileimpl class and accessing protected fields
  • virtual methods of classes inheriting from the X class using big methods, accessing private or protected fields and having high issues.
  • big methods from the poco namespace using methods from the stl namespace

CppDepend AI revolutionizes the way developers query their code models by providing an intuitive, natural language interface. Whether you're looking to identify complex methods, large types, or tightly coupled components, CppDepend AI offers the tools and insights you need to manage and optimize your codebase effectively. Start leveraging the power of CppDepend AI today to effortlessly query and analyze your code model.

CppDepend offers a wide range of features. It is often described as a Swiss Army Knife for C and C++ developers.

Start Free Trial