Skip to content

Ql/incomplete tostring #12116

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Ql/incomplete tostring #12116

wants to merge 4 commits into from

Conversation

yoff
Copy link
Contributor

@yoff yoff commented Feb 7, 2023

TODO:

  • Some classes are restircted in their charpred to some branch types.
    We should take that into account when computing coverage.
  • Some classes rely on onther classes for cover. Example is
    ReturnCompletion:
/**
 * A completion that represents evaluation of a statement or an
 * expression resulting in a return from a callable.
 */
class ReturnCompletion extends Completion {
  ReturnCompletion() {
    this = TReturnCompletion() or
    this = TNestedCompletion(_, TReturnCompletion(), _)
  }
  override ReturnSuccessor getAMatchingSuccessorType() { any() }
  override string toString() {
    // `NestedCompletion` defines `toString()` for the other case
    this = TReturnCompletion() and result = "return"
  }
}

yoff added 2 commits January 27, 2023 12:59
TODO:
- Some classes are restircted in their charpred to some branch types.
  We should take that into account when computing coverage.
- Some classes rely on onther classes for cover. Example is
  `ReturnCompletion`:
  ```codeql
/**
 * A completion that represents evaluation of a statement or an
 * expression resulting in a return from a callable.
 */
class ReturnCompletion extends Completion {
  ReturnCompletion() {
    this = TReturnCompletion() or
    this = TNestedCompletion(_, TReturnCompletion(), _)
  }
  override ReturnSuccessor getAMatchingSuccessorType() { any() }
  override string toString() {
    // `NestedCompletion` defines `toString()` for the other case
    this = TReturnCompletion() and result = "return"
  }
}
```
branch.getNewType() = nt and
not branch = ts.getRestrictions() and
not ts.hasUnrestrictedDisjunct()
select ts, "$@ does not define a result for $@ of $@.", ts, "This toString predicate", branch,

Check warning

Code scanning / CodeQL

Alert message style violation

Don't repeat the alert location as a link.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant