Skip to content

Conversation

@vodorok
Copy link
Collaborator

@vodorok vodorok commented Jul 16, 2019

Extended CodeChecker configuration capabilities of the Plugin.
There is a group of three radio button in the beginning of the Preferences/Project properties page.
The messages of this page now are meaningful eg: Displays the currently used CodeChecker or emit a helpful error message.

There are some changes under the hood.
The CodeChecker class.
The CodeCheckerLocator class group.

This resolves #152, also resolves #162

@vodorok vodorok requested a review from gyorb July 16, 2019 13:54
@Ericsson Ericsson deleted a comment Jul 22, 2019
@Ericsson Ericsson deleted a comment Jul 22, 2019
@Ericsson Ericsson deleted a comment Jul 22, 2019
@Ericsson Ericsson deleted a comment Jul 22, 2019
@Ericsson Ericsson deleted a comment Jul 22, 2019
@Ericsson Ericsson deleted a comment Jul 22, 2019
@Ericsson Ericsson deleted a comment Jul 22, 2019
@Ericsson Ericsson deleted a comment Jul 22, 2019
@Ericsson Ericsson deleted a comment Jul 22, 2019
@Ericsson Ericsson deleted a comment Jul 22, 2019
@Ericsson Ericsson deleted a comment Jul 22, 2019
@Ericsson Ericsson deleted a comment Jul 22, 2019
@Ericsson Ericsson deleted a comment Jul 22, 2019
@Ericsson Ericsson deleted a comment Jul 22, 2019
@Ericsson Ericsson deleted a comment Jul 22, 2019
@Ericsson Ericsson deleted a comment Jul 22, 2019
@Ericsson Ericsson deleted a comment Jul 22, 2019
@Ericsson Ericsson deleted a comment Jul 22, 2019
@Ericsson Ericsson deleted a comment Jul 22, 2019
@Ericsson Ericsson deleted a comment Jul 22, 2019
@Ericsson Ericsson deleted a comment Jul 22, 2019
@Ericsson Ericsson deleted a comment Jul 22, 2019
@Ericsson Ericsson deleted a comment Jul 22, 2019
@Ericsson Ericsson deleted a comment Jul 22, 2019
@Ericsson Ericsson deleted a comment Jul 22, 2019
@Ericsson Ericsson deleted a comment Jul 22, 2019
}

monitor.beginTask("Starting Analysis...", taskCount.get() * 2);
config.getCodeChecker().analyze(logFile, true, monitor, taskCount.get() * 2, config);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO There is a npe thrown at this line, when there is no CodeChecker configured.

@vodorok vodorok added the seq 1 label Aug 6, 2019
Copy link
Member

@dkrupp dkrupp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rebase the patch.

@Ericsson Ericsson deleted a comment Aug 7, 2019
@Ericsson Ericsson deleted a comment Aug 7, 2019
@Ericsson Ericsson deleted a comment Aug 7, 2019
Copy link
Collaborator

@gamesh411 gamesh411 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice patch! Please see my remarks inline.

*
* @return The checker list.
*/
public String getCheckers();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say, that getCheckers, getVersion should return an Optional, an analyze could indicate with an exception if something went wrong. Feel free to apply these suggestions liberally, at your discretion.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not completely convinced about the Optional usage in this case, as the version information should not be absent, if there is a valid CodeChecker package at that location. Same situation with the checkers. Maybe I could annotate these methods with @nonnull to be more clear.

Related: I'm still thinking about extracting the package validation section from the getVersion method. I'm just not sure whether to do it on the interface level, or in the implementation. (This getVersion currently not used in the plugin, but could be useful in the future for example to check compatibility).

* The query string.
* @return The matching ResolutionMethodTypes if exists null otherwise.
*/
public static ResolutionMethodTypes getFromString(String s) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the enum symbol name is the same as the String it represents (for example in this case), then getFromString, and even the getDefault value is redundant. Consider using an enum without a base type, and use the toString() and valueOf(String) methods. (To further clarify: this would effectively reduce the enum definition to a 3 member plain enum).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Darn, There is an another enum which could be simplified like this. Thanks for the remark, I'll make a patch for that other.

@vodorok
Copy link
Collaborator Author

vodorok commented Aug 21, 2019

Thanks @gamesh411 for your thorough review! I'll update the found issues.

@vodorok
Copy link
Collaborator Author

vodorok commented Aug 29, 2019

#180 Should be merged before this.

Refactored the logic, how CodeChecker is found and configured.
There is now an internal representation of a CodeChecker.
There are a locator service introduced to handle CodeChecker resolution.
There are a new gui radio button group to select how CodeChecker should
be found.
There is a proper dynamic widget enablement function depending on the
selected options, and more verbose messages for the preferences panel.
New Unit tests and extended Integration tests.
The CodeChecker class, and the locator logic is tested for PATH and Pre
built package resolution.
This is the same for the Integration tests, so only these two are
tested. The Custom built CodeChecker package with virtual env needs a
virtual environment emulation, which is not implemented yet.
@Ericsson Ericsson deleted a comment Sep 2, 2019
@Ericsson Ericsson deleted a comment Sep 2, 2019
@Ericsson Ericsson deleted a comment from gamesh411 Sep 2, 2019
@Ericsson Ericsson deleted a comment Sep 3, 2019
@Ericsson Ericsson deleted a comment Sep 3, 2019
@Ericsson Ericsson deleted a comment Sep 3, 2019
@gamesh411 gamesh411 merged commit fcd1016 into Ericsson:master Sep 4, 2019
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.

The way that a CodeChecker instance is found/configured needs refactoring. Search CodeChecker in PATH by default

3 participants