Skip to content
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

feature(query): introduce to execute queries from CQL file 🚀 #102

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

shivasurya
Copy link
Owner

From now on, you could execute queries from file named *.cql 🥇

$ pathfinder --project <PATH_TO_SCAN> --query-file ../pathfinder-rules/android/webview.cql

Worker 1 ....... Done processing file Results.java
Worker 2 ....... Done processing file movieListActivity.java
Worker 1 ....... Done processing file NetworkAPI.java
Worker 2 ....... Done processing file ExampleUnitTest.java
Worker 3 ....... Done processing file movieDetailFragment.java
Worker 4 ....... Done processing file movieListActivity.java
Worker 5 ....... Done processing file Results.java
Progress: 100%
2024/08/23 09:29:13 Elapsed time:  42.888667ms
2024/08/23 09:29:13 Graph built successfully
Executing query: FIND method_invocation AS mi WHERE mi.getName() == "setJavaScriptEnabled" && "true" in mi.getArgumentName()
~/src/code-pathfinder/test-src/android/app/src/main/java/com/ivb/udacity/movieDetailActivity.java:35
------------
> webview.getSettings().setJavaScriptEnabled(true)
------------

  • Rulesets will be placed under pathfinder-rules/ directory as extension .cql
  • In future this will be moved under subcommand pathfinder scan -f <RULES_DIRECTORY> --project <SCAN_PATH>

@shivasurya shivasurya added the enhancement New feature or request label Aug 23, 2024
@shivasurya shivasurya self-assigned this Aug 23, 2024
@shivasurya shivasurya merged commit ab16095 into main Aug 23, 2024
2 checks passed
@shivasurya shivasurya deleted the shiva/rules branch August 23, 2024 14:30
Copy link

codecov bot commented Aug 23, 2024

Codecov Report

Attention: Patch coverage is 51.61290% with 15 lines in your changes missing coverage. Please review.

Project coverage is 52.95%. Comparing base (0aeafcc) to head (e8d549b).
Report is 1 commits behind head on main.

Files Patch % Lines
sourcecode-parser/main.go 51.61% 12 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #102      +/-   ##
==========================================
- Coverage   52.97%   52.95%   -0.02%     
==========================================
  Files          10       10              
  Lines        2250     2281      +31     
==========================================
+ Hits         1192     1208      +16     
- Misses        999     1011      +12     
- Partials       59       62       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant