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
Command refactoring and more #2397
Conversation
bwitham
commented
May 21, 2018
•
edited
edited
- collapse multiple commands into a single command; makes commands easier to use and reduces redundant code in some cases:
- convert commands
- conflate commands (disable cumulative conflate for now, as its not used)
- calc tiles commands
- perty commands
- add stats for railways
{ | ||
boost::shared_ptr<const MatchComparator> matchComparator = | ||
PertyMatchScorer().scoreMatches(args[0], args[1]); | ||
cout << MapMatchScoringUtils::getMatchScoringString(matchComparator); |
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.
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.
Maybe some other time. Not logging this as a warning b/c that's strange and logging it as info requires updating a lot of regression tests again.
@mattjdnv @mschicker A lot of file changes, but this was mostly focused on simplifying the various convert commands into a single command to make it easier to use. There are a few extra things listed in the description that I did along the way. Also, #2416 is a follow on issue that would clean up the convert command even further...decided not to tackle it this time around as it might be fairly involved. thanks. |
{ | ||
if (Log::getInstance().getLevel() == Log::Info) | ||
{ | ||
std::cout << "."; |
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.
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.
pre-existing code from Ogr2OsmCmd
if (Log::getInstance().getLevel() == Log::Info) | ||
{ | ||
std::cout << "."; | ||
std::cout.flush(); |
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.
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.
pre-existing code from Ogr2OsmCmd
|
||
OsmMapReaderFactory readerFactory = OsmMapReaderFactory::getInstance(); | ||
if (readerFactory.hasElementInputStream(input) && | ||
//TODO: this ops restriction needs to be removed and the ops applied during streaming. |
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.
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.
Don't tell me what TODO.
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.
will be handled in #2416
} | ||
} | ||
|
||
void DataConverter::_convertFromOgr(const QStringList inputs, const QString output) |
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.
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'm sorry you're not smart enough to understand this function.
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.
Witham: 1
Dgisbot: 0
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.
Have to keep that guy in line :-)
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'm learning about cognitive complexity now. They list it as critical and then go on to give example open source projects that have over a thousand instances of it....so, is it really that critical?
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.
pre-existing method from Ogr2OsmCmd; maybe can look into refactoring it into multiple less complex methods at a later date
@@ -52,21 +57,89 @@ class PertyCmd : public BaseCommand | |||
|
|||
virtual int runSimple(QStringList args) | |||
{ | |||
if (args.size() != 2) | |||
LOG_VARD(args.size()); | |||
if (args.size() < 2 || args.size() > 3) | |||
{ | |||
cout << getHelp() << endl << endl; |
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.
SonarQube analysis reported 13 issues Watch the comments in this conversation to review them. 7 extra issuesNote: The following issues were found on lines that were not modified in the pull request. Because these issues can't be reported as line comments, they are summarized here:
|
@dgisbot has a mind of its own! |
That's harsh. Silenced by dgisbot...my voice will be heard! |
The struggle is real. |
I wonder if we can get SonarQube to only report the actual error findings and not just the code smells. I like the idea of cleaning up some relevant code smells but it isn't necessary to pass the test in my opinion. |
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.
Nice work! Approved! I agree that most of the SonarQube comments, while insightful, should not be addressed at this time.
Yeah, I think the best setup would be to have qube report everything in PR's but have the PR only fail on errors and not smells, if that's possible. Then optionally fix smells in the same PR or do it in a later one for the more critical items. We might have to do some adjusting on the priorities on the smells. For instance, qube was calling a large complex method that needed refactoring a critical problem...I would that give that type of thing a lower priority than critical. |