shivasurya / code-pathfinder

Code Pathfinder, the open-source alternative to CodeQL. Designed for precise flow analysis and advanced structural search, it identifies vulnerabilities in source code.
https://codepathfinder.dev/
GNU Affero General Public License v3.0
32 stars 6 forks source link

Access Routine Feature #25

Closed shivasurya closed 3 months ago

shivasurya commented 4 months ago

Description

This has_access attribute aka routine helps to identify if the variable has access within the code. in simple terms, It also means if the variable is actually used in the program or not.

This has_access routine will helps to craft queries to find variables (in future all entities) that are un-used in the program.

Example

Path-Finder Query Console: 
>FIND variable_declaration WHERE has_access = 'false' AND scope = 'local'
Executing query: FIND variable_declaration WHERE has_access = 'false' AND scope = 'local'

------Query Results------
-------------------
int i = 0;
/Users/shiva/src/android/app/src/main/java/com/ivb/udacity/database/favouritesSqliteHelper.java
-------------------
int jk = 0;
/Users/shiva/src/android/app/src/main/java/com/ivb/udacity/movieListActivity.java
-------------------
RecyclerView rView = recyclerView;
/Users/shiva/src/android/app/src/main/java/com/ivb/udacity/movieListActivity.java
-------------------

closes: #23