pixee / codemodder-python

Python implementation of the Codemodder framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BUG: SQL parameterization codemod fails to remediate Sonar finding

drdavella opened this issue · comments

See the Sonar findings attached to this PR: drdavella/pygoat-sonar#5

Codemodder fails to remediate the Sonar issue for the SQL parameterization.

Search for this issue number to find an xfailing test case.

@drdavella The test added in #608 doesn't match the location file (the sonar result points to line 20 and the file has 19 lines), are you sure you've added the right one?

In any case, the transformation works, but it is failing to match the location.

@andrecsilva it's possible that the unit test isn't quite right, but this result file was taken directly from an actual Sonar scan. You can try checking out this branch on my fork of pygoat: https://github.com/drdavella/pygoat-sonar/pull/5/files

And then reproduce with this codemodder command:

codemodder $HOME/pygoat-sonar --path-include="introduction/new_view.py" --codemod-include="sonar:python/sql-parameterization-S3649" --dry-run --verbose --sonar-issues-json $HOME/codemodder-python/tests/samples/sonar/sql_parameterization.json

The source file matches the results but no fix is produced.