• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Qiskit / qiskit / 15171633158
88%

Build:
DEFAULT BRANCH: main
Ran 21 May 2025 08:52PM UTC
Jobs 1
Files 811
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

21 May 2025 06:16PM UTC coverage: 88.315% (+0.004%) from 88.311%
15171633158

push

github

web-flow
Avoid using string parsing for ParameterExpression.sympify() (#14391)

* Avoid using string parsing for ParameterExpression.sympify()

In the recently merged #13278 the implementation for the sympify
method for ParameterExpression was changed because we no longer rely on
symengine internally. Previously we would just return the inner
symengine object used to represent the symbolic expression. Without
symengine available #13278 updated the implementation of the method to
generate a string representation of the expression and pass that to
sympify which has a "parser" for converting that expression string to a
sympy object. However, sympify() method is insecure as it internally
relies on Python's eval() to parse the string and can't be used for
untrusted input. While this doesn't have the same exact exposure as
in https://github.com/Qiskit/qiskit/security/advisories/GHSA-6m2c-76ff-6vrf
because you have to opt-in to using this function with input that is
untrusted and the degrees of freedom are less because it has to go
through the rust symbolic expression it is still a potential
vulnerability waiting to happen. This commit reworks the sympify
implementation to avoid using sympy's parser and instead just builds
the sympy expression from the internal state directly.

* Remove unused Rust functions that support sympy string generation

* Add test coverage for all of parameter expression

* Add .sign() to the megaexpression

47 of 47 new or added lines in 2 files covered. (100.0%)

8 existing lines in 3 files now uncovered.

78468 of 88850 relevant lines covered (88.32%)

467453.75 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
1
94.23
-0.23% crates/qasm2/src/expr.rs
2
75.25
-0.37% crates/circuit/src/symbol_expr.rs
5
92.48
-0.25% crates/qasm2/src/lex.rs
Jobs
ID Job ID Ran Files Coverage
1 15171633158.1 21 May 2025 08:52PM UTC 811
88.32
GitHub Action Run
Source Files on build 15171633158
  • Tree
  • List 811
  • Changed 7
  • Source Changed 4
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #15171633158
  • 8970b83e on github
  • Prev Build on gh-readonly-queue/main/pr-14364-83d85a01566044c00bcfde45647d3daf034c1276 (#15168839272)
  • Next Build on main (#15184934187)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc