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

#473 - Specify which class the graph is for. #480

Merged
merged 5 commits into from
Jul 26, 2020
Merged

Conversation

vzurauskas
Copy link
Contributor

#473

Made XmlGraph specific to a particular class inside a skeleton.

@0crat
Copy link
Collaborator

0crat commented Jun 15, 2020

This pull request #480 is assigned to @victornoel/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 a monetary reward for this job

Copy link
Contributor

@victornoel victornoel left a comment

Choose a reason for hiding this comment

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

@vzurauskas one question and possible change to add

this.nds = new Unchecked<>(
new Sticky<>(
() -> XmlGraph.build(skeleton)
() -> XmlGraph.build(skeleton, pname, cname)
Copy link
Contributor

Choose a reason for hiding this comment

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

@vzurauskas why is it better to make XmlGraph for one class? Does it mean we need to introduce a todo to create another class responsible for iterating on all the classes of this skeleton?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@victornoel XmlGraph implements this interface:

public interface Graph {
    List<Node> nodes();
}

It's a list of nodes for one class, because if it was for all classes in skeleton, it would have to be a list of lists of nodes, or a map to lists of nodes. As far as I can tell, the graph is useful only in a context of a single class, because I don't think there are any cross-class cohesion metrics.

Iteration could be metric-specific, I guess. E.g. Ccm iterates through classes of a transformed skeleton and has a method (not implemented currently) to update the NCC value using a graph of a specific class.

Copy link
Contributor

Choose a reason for hiding this comment

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

@vzurauskas ok, thank you for the explanation :)

Copy link
Contributor

@victornoel victornoel left a comment

Choose a reason for hiding this comment

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

@vzurauskas here are some more comments

skeleton.xml().nodes("//class").get(0),
skeleton.xml()
.nodes(
new Joined("", "//package[@id=", pname).toString()
Copy link
Contributor

Choose a reason for hiding this comment

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

@vzurauskas is it normal that the [ is not closed at the end with a ]?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@victornoel No, I don't think that's normal. Fixed.

Copy link
Contributor

Choose a reason for hiding this comment

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

@vzurauskas just to understand, this bug wasn't caught because there are no tests? If there is no todo already, let's add one to add more tests then, WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@victornoel There are tests in XmlGraphTest, but they are disabled now. There's a ticket to enable them, it's the other PR you're reviewing. :)

Copy link
Contributor

Choose a reason for hiding this comment

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

@vzurauskas ah perfect then :)

skeleton.xml().nodes("//class").get(0),
skeleton.xml()
.nodes(
new Joined("", "//package[@id=", pname).toString()
Copy link
Contributor

Choose a reason for hiding this comment

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

@vzurauskas I think using a FormattedText would not make this much more readable instead of Joined here and in other places.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@victornoel Good idea.

Copy link
Contributor

@victornoel victornoel left a comment

Choose a reason for hiding this comment

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

@paulodamaso lgtm :)

@victornoel
Copy link
Contributor

@paulodamaso this is ok to be merged

@0crat
Copy link
Collaborator

0crat commented Jun 29, 2020

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

@victornoel
Copy link
Contributor

@vzurauskas now there are conflicts :)

@vzurauskas
Copy link
Contributor Author

@victornoel Fixed.

@paulodamaso This can be merged now.

@victornoel
Copy link
Contributor

@paulodamaso ping

@paulodamaso
Copy link
Collaborator

@victornoel @vzurauskas Sorry for the absence guys

@paulodamaso
Copy link
Collaborator

@rultor merge

@rultor
Copy link
Collaborator

rultor commented Jul 26, 2020

@rultor merge

@paulodamaso OK, I'll try to merge now. You can check the progress of the merge here

@rultor rultor merged commit 847ef28 into cqfn:master Jul 26, 2020
@rultor
Copy link
Collaborator

rultor commented Jul 26, 2020

@rultor merge

@paulodamaso Done! FYI, the full log is here (took me 14min)

@0crat
Copy link
Collaborator

0crat commented Jul 26, 2020

The project doesn't have enough funds, can't make a payment

@0crat
Copy link
Collaborator

0crat commented Jul 26, 2020

Code review was too long (41 days), architects (@paulodamaso) were penalized, see §55

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.

6 participants