From fb37330f5e3f86c1c8e1e5275527bae757c1aefc Mon Sep 17 00:00:00 2001 From: Rasmus Wriedt Larsen Date: Mon, 7 Sep 2020 14:59:07 +0200 Subject: [PATCH] Python: Fix grammar Co-authored-by: Taus --- python/tools/recorded-call-graph-metrics/README.md | 4 ++-- .../recorded-call-graph-metrics/ql/lib/RecordedCalls.qll | 2 +- python/tools/recorded-call-graph-metrics/ql/query/Metrics.ql | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/python/tools/recorded-call-graph-metrics/README.md b/python/tools/recorded-call-graph-metrics/README.md index d9cdfa1feb6..f20c788aaf4 100644 --- a/python/tools/recorded-call-graph-metrics/README.md +++ b/python/tools/recorded-call-graph-metrics/README.md @@ -4,7 +4,7 @@ also known as _call graph tracing_. Execute a python program and for each call being made, record the call and callee. This allows us to compare call graph resolution from static analysis with actual data -- that is, can we statically determine the target of each actual call correctly. -Using the call graph tracer does incur heave toll on the performance. Expect 10x longer to execute program. +Using the call graph tracer does incur a heavy toll on the performance. Expect 10x longer to execute the program. Number of calls recorded vary a little from run to run. I have not been able to pinpoint why. @@ -25,7 +25,7 @@ $ head -n 100 projects/*/Metrics.txt ### Expanding set of projects -It should be fairly straight forward to expand the set of projects. Most projects use `tox` for running their tests against multiple python versions. I didn't look into any kind of integration, but have manually picked out the instructions required to get going. +It should be fairly straightforward to expand the set of projects. Most projects use `tox` for running their tests against multiple python versions. I didn't look into any kind of integration, but have manually picked out the instructions required to get going. As an example, compare the [`tox.ini`](https://github.com/pallets/flask/blob/21c3df31de4bc2f838c945bd37d185210d9bab1a/tox.ini) file from flask with the configuration diff --git a/python/tools/recorded-call-graph-metrics/ql/lib/RecordedCalls.qll b/python/tools/recorded-call-graph-metrics/ql/lib/RecordedCalls.qll index 93aa8b0a604..fb313fe80bd 100644 --- a/python/tools/recorded-call-graph-metrics/ql/lib/RecordedCalls.qll +++ b/python/tools/recorded-call-graph-metrics/ql/lib/RecordedCalls.qll @@ -179,7 +179,7 @@ class IdentifiedRecordedCall extends XMLRecordedCall { // - all these calls were recorded // // without this `strictcount`, in the case `func(); func(); func()`, if 1 of the calls - // is not recorded, we woulld still mark the other two recorded calls as valid + // is not recorded, we would still mark the other two recorded calls as valid // (which is not following the rules above). + 1 to count `this` as well. strictcount(this.getACall()) = strictcount(this.getOtherWithSameSetOfCalls()) + 1 and forex(XMLRecordedCall rc | rc = this.getOtherWithSameSetOfCalls() | diff --git a/python/tools/recorded-call-graph-metrics/ql/query/Metrics.ql b/python/tools/recorded-call-graph-metrics/ql/query/Metrics.ql index 6243e5b1748..2216e9dcb3d 100644 --- a/python/tools/recorded-call-graph-metrics/ql/query/Metrics.ql +++ b/python/tools/recorded-call-graph-metrics/ql/query/Metrics.ql @@ -1,6 +1,6 @@ import lib.RecordedCalls -// colum i is just used for sorting +// column i is just used for sorting from string text, float number, float ratio, int i where exists(int all_rcs | all_rcs = count(XMLRecordedCall rc) and ratio = number / all_rcs |