-
Notifications
You must be signed in to change notification settings - Fork 280
Cleanup some bits of code that trip up LGTM #3136
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM's suggestions LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah; I'm in.
j.object.find("size-symbol") != j.object.end() && | ||
j.object.find("end-symbol") == j.object.end() && | ||
j["size-symbol"].is_string())); | ||
}))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... I think there might be a few other issues with this bit of code ...
std::function<void(const key_type &k, const mapped_type &m)> f) const | ||
{ | ||
typedef std::pair<unsigned, const baset *> stack_itemt; | ||
|
||
std::stack<stack_itemt> stack; | ||
stack.push({depth, &n}); | ||
stack.push({start_depth, &n}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really the only place it is used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be one for @danpoe to comment on? It was a bit of a guess that this one should be the input argument, while other uses of depth
would refer to the variable declared locally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good to me
@@ -100,13 +100,13 @@ std::set<exprt> full_index_set(const array_string_exprt &s) | |||
} | |||
|
|||
/// Create the cartesian product of two sets. | |||
template<class T, class U> | |||
std::set<std::pair<T, U>> product(const std::set<T> ts, const std::set<U> us) | |||
template <class X, class Y> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ What's the logic here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Template parameter types get renamed to match the name of the parameters to the function, makes sense to me. X and Y are more common for this sort of thing. Though I agree this doesn't seem to be an objective improvement. According to the commit message we have a global t
somewhere though, so that's probably the reason.
(Looked it up now, apparently we have a test that used tt
and t
as global names - I think we should probably just fix that test...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The t
in instantiate_not_contains.cpp
should just be made static right - that would fix this? This tool is super neat though!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's upset that var t
and template parameter T
are only distinguished by case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Reported by Semmle's LGTM (https://lgtm.com/projects/g/diffblue/cbmc/alerts/?mode=list).
Reported by Semmle's LGTM (https://lgtm.com/projects/g/diffblue/cbmc/alerts/?mode=list).
Renamed template parameters as the chosen name did make a lot of sense in the specific context. Reported by Semmle's LGTM (https://lgtm.com/projects/g/diffblue/cbmc/alerts/?mode=list).
Reported by Semmle's LGTM (https://lgtm.com/projects/g/diffblue/cbmc/alerts/?mode=list).
This is a whitespace-only change.
Reported by Semmle's LGTM (https://lgtm.com/projects/g/diffblue/cbmc/alerts/?mode=list).
b51b521
to
a02dbfd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passed Diffblue compatibility checks (cbmc commit: a02dbfd).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/87644740
Issues reported by Semmle's LGTM (https://lgtm.com/projects/g/diffblue/cbmc/alerts/?mode=list).