Skip to content
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

#396 Add ReportData class #401

Merged
merged 9 commits into from
Mar 5, 2020
Merged

#396 Add ReportData class #401

merged 9 commits into from
Mar 5, 2020

Conversation

HDouss
Copy link
Contributor

@HDouss HDouss commented Feb 27, 2020

Resolving issue #396

@0crat
Copy link
Collaborator

0crat commented Feb 27, 2020

This pull request #401 is assigned to @fanifieiev/z, here is why; the budget is 15 minutes, see §4; please, read §27 and when you decide to accept the changes, inform @paulodamaso/z (the architect) right in this ticket; if you decide that this PR should not be accepted ever, also inform the architect; this blog post will help you understand what is expected from a code reviewer; there will be no monetary reward for this job

@HDouss
Copy link
Contributor Author

HDouss commented Feb 27, 2020

@fanifieiev ping

@HDouss
Copy link
Contributor Author

HDouss commented Feb 28, 2020

@fanifieiev ping...

@HDouss
Copy link
Contributor Author

HDouss commented Feb 28, 2020

@fanifieiev ping...again..

@HDouss
Copy link
Contributor Author

HDouss commented Feb 29, 2020

@fanifieiev ping...

Copy link

@fanifieiev fanifieiev left a comment

Choose a reason for hiding this comment

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

@HDouss Please take a look at the comments

ReportData(final String name, final Map<String, Object> args, final double mean,
final double sigma) {
this.metr = name;
this.args = new HashMap<>(args);

Choose a reason for hiding this comment

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

@HDouss It is better to use unmodifiable map here

* @return Params
*/
public Map<String, Object> params() {
return new HashMap<>(this.args);

Choose a reason for hiding this comment

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

@HDouss Just returning unmodifiable map would sufficient

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fanifieiev Ok. but I think I should remove the test for immutability or change it to expect Exceptions.

Choose a reason for hiding this comment

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

@HDouss I would personally not create a test for ReportData, it is just a holder object, just dummy object, I would better check how much it is involved in XslReportTest

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fanifieiev it does not harm to have such tests, especially for immutability.

final double sigma = random.nextDouble();
final Map<String, Object> sample = ReportDataTest.args();
final ReportData data = new ReportData(name, sample, mean, sigma);
new Assertion<>("Must returns name", data.metric(), new IsEqual<>(name)).affirm();

Choose a reason for hiding this comment

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

@HDouss It is better to reformat here and below in a way:

new Assertion<>(
   "<message>",
   ... ,
   ...
).affirm();

for better readability

Copy link

@fanifieiev fanifieiev left a comment

Choose a reason for hiding this comment

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

@HDouss Thanks
@paulodamaso We are good to merge this PR

@HDouss
Copy link
Contributor Author

HDouss commented Mar 1, 2020

@paulodamaso ping

Copy link
Collaborator

@paulodamaso paulodamaso left a comment

Choose a reason for hiding this comment

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

@HDouss There are some comments, please take a look

ReportData(final String name, final Map<String, Object> args, final double mean,
final double sigma) {
this.metr = name;
this.args = Collections.unmodifiableMap(new HashMap<>(args));
Copy link
Collaborator

Choose a reason for hiding this comment

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

@HDouss Let's avoid using static methods. See if we can't replace this call by some of the cactoos collections

final double sigma = 1;
final Map<String, Object> sample = ReportDataTest.args();
final ReportData data = new ReportData(name, sample, mean, sigma);
new Assertion<>(
Copy link
Collaborator

Choose a reason for hiding this comment

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

@HDouss Please split this method into several methos containing just one assertion each

final Map<String, Object> params = new HashMap<>(sample);
final ReportData data = new ReportData(name, params);
params.clear();
new Assertion<>(
Copy link
Collaborator

Choose a reason for hiding this comment

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

@HDouss Here also, please split it into two methods

@HDouss
Copy link
Contributor Author

HDouss commented Mar 1, 2020

@paulodamaso Thanks. Fixed.

@HDouss
Copy link
Contributor Author

HDouss commented Mar 2, 2020

@paulodamaso ping

@0crat
Copy link
Collaborator

0crat commented Mar 3, 2020

@fanifieiev/z this job was assigned to you 5days ago. It will be taken away from you soon, unless you close it, see §8. Read this and this, please.

@HDouss
Copy link
Contributor Author

HDouss commented Mar 3, 2020

@paulodamaso ping.

@paulodamaso paulodamaso merged commit e7d1fd0 into cqfn:master Mar 5, 2020
@0crat 0crat removed the scope label Mar 5, 2020
@0crat
Copy link
Collaborator

0crat commented Mar 5, 2020

Job audit: ARC didn't merge or close PR, performer @fanifieiev/z/z didn't make CR comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants