-
Notifications
You must be signed in to change notification settings - Fork 81
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
#135 Added schema location to metric.xml #196
Conversation
Job #196 is now in scope, role is |
Codecov Report
@@ Coverage Diff @@
## master #196 +/- ##
============================================
+ Coverage 74.41% 74.46% +0.05%
Complexity 163 163
============================================
Files 31 31
Lines 1020 1022 +2
Branches 73 73
============================================
+ Hits 759 761 +2
Misses 231 231
Partials 30 30
Continue to review full report at Codecov.
|
@amihaiemil please review |
@amihaiemil just fixed some conflicts, please review |
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.
@llorllale I think you merged some branches the wrong way? This PR has a lot of stuff not concerning the parent ticket.
src/main/java/org/jpeek/App.java
Outdated
@@ -131,7 +131,8 @@ public App(final Path source, final Path target) { | |||
new MapEntry<>("LCOM5", true), | |||
new MapEntry<>("SCOM", true), | |||
new MapEntry<>("NHD", true), | |||
new MapEntry<>("MMAC", true) | |||
new MapEntry<>("MMAC", true), | |||
new MapEntry<>("OCC", true) |
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.
@llorllale Why did you add OCC here? Does it have to do with metric.xsl?
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.
@amihaiemil fixed; this was an error on my part
src/main/java/org/jpeek/Report.java
Outdated
Report(final XML xml, final String name, | ||
final Map<String, Object> args, | ||
final double mean, final double sigma) { | ||
this.skeleton = xml; | ||
this.metric = name; | ||
this.params = args; | ||
this.params = new MapOf<>( | ||
// @checkstyle LineLength (1 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.
@llorllale Can you indent this code so you don't have to escape checkstyle?
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.
@amihaiemil fixed wait
src/main/java/org/jpeek/Report.java
Outdated
new UncheckedText( | ||
new TextOf( | ||
new InputOf( | ||
// @checkstyle LineLength (1 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.
@llorllale Same 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.
@amihaiemil fixed wait
@@ -0,0 +1,107 @@ | |||
<?xml version="1.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.
@llorllale Again, I don't understand why this PR adds both OCC metric and implements the metric.xsl thing?
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.
@amihaiemil I fixed this
@@ -22,6 +22,14 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |||
SOFTWARE. | |||
--> | |||
<!-- | |||
@todo #134:30min Index.xsd: add `xsd:documentation` tags as per issue #134. We need to |
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.
@llorllale Why are you adding these todos here? They have nothing to do with the ticket or the metric.xsl
functionality, right?
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.
@amihaiemil fixed, they had nothing to do with the ticket
@amihaiemil fixed, please review. You were right. Lucky for me however, those other changes are now in |
As per PR review: * fixed indentation in Report.java
@amihaiemil fixed the indentation issues |
@rultor good to merge |
@amihaiemil Thanks for your request. @yegor256 Please confirm this. |
@yegor256 ping |
new TextOf( | ||
new InputOf( | ||
Report.class.getResourceAsStream( | ||
"xsl/metric-post-schemaloc.xsl" |
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.
@llorllale looks weird. Can't we just add this single attribute to the skeleton.xml
when we are building it? Why making this simple operation so complex?
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.
@yegor256 My line of reasoning is: Report
creates metric.xml
so it is responsible for properly building it.
Skeleton
creates the skeleton.xml
so I believe it is responsible for properly building that xml.
I see that App
is currently creating both index.xml
and matrix.xml
and I think those two things should be extracted into their own classes who in turn will be responsible for properly building those xmls.
WDYT?
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.
@yegor256 let's also remember that the value for xsi:noNamespaceSchemaLocation
will be different among the files.
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.
@llorllale why can't you set it via Xembly? Why using XSL?
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.
why can't you set it via Xembly?
Xembler
works with nodes. Can't set the required attribute on the node returned by the XML
resulting from transforming the skeleton into metric
because it's a document node (throws error "Cannot cast ...DocumentImpl to ...Element"). I think I would have to bend over backwards in the code to make it work (appending child elements, etc)
Why using XSL?
We already have a post-processing stage in Report
so I took advantage of that. Also, this way seems cleaner to me than the alternative I described above. The noise can be reduced a little if XSLDocument
had a ctor that accepted InputStream
and params
together.
@@ -26,6 +26,9 @@ SOFTWARE. | |||
@todo #134:30min Index.xsd: add `xsd:documentation` tags as per issue #134. We need to | |||
document the schemas in src/resources/org/jpeek/xsd so that the semantics of | |||
the generated XML documents is transparent for maintainers. | |||
@todo #135:30min Index.xsd: add a reference to this schema from the generated | |||
skeleton.xml. Schemas from src/resources/org/jpeek/xsd must be referenced in |
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.
@llorllale what skeleton.xml
has to do with this file? Typo?
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.
@yegor256 yes, typo
@@ -26,6 +26,9 @@ SOFTWARE. | |||
@todo #134:30min Matrix.xsd: add `xsd:documentation` tags as per issue #134. We need to | |||
document the schemas in src/resources/org/jpeek/xsd so that the semantics of | |||
the generated XML documents is transparent for maintainers. | |||
@todo #135:30min Matrix.xsd: add a reference to this schema from the generated | |||
skeleton.xml. Schemas from src/resources/org/jpeek/xsd must be referenced in |
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.
@llorllale what skeleton.xml
has to do with this file? Typo?
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.
@yegor256 yes, typo
@@ -22,6 +22,11 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |||
SOFTWARE. | |||
--> | |||
<!-- | |||
@todo #135:30min Skeleton.xsd: add a reference to this schema from the generated | |||
skeleton.xml. Schemas from src/resources/org/jpeek/xsd must be referenced in |
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.
@llorllale what skeleton.xml
has to do with this file? Typo?
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.
@yegor256 yes, typo actually, NO, this one was not a typo :)
@llorllale it seems you over-designed it, see above |
@llorllale Are you done with the changes asked by Yegor? If so, ping him so we can try to merge |
Ping @yegor256 |
@yegor256 any thoughts ? |
@llorllale see above |
@yegor256 please see my reply above. Also, please let me know your thoughts regarding the puzzle I'm leaving here as it also involves a design decision. |
@yegor256 ping |
@amihaiemil/z this job was assigned to you 8 days ago. It will be taken away from you soon, unless you close it, see §8. Read this and this, please. |
@yegor256 ping |
@llorllale it still seems weird to me that we are using XSL just in order to add one attribute to the XML. We have to use Xembly, it will take just one instruction and the problem is solved. Current solution is too complex and verbose. |
@yegor256 where would this one instruction go? Sorry, for asking, I don't see it. |
@llorllale @yegor256 If you can't agree on the solution, then maybe you should open another PR and solve it there, since this is in my hands for 8 days now :D |
@amihaiemil agreed, should I just close this? |
@llorllale yes. I mean, I can't think of a better solution for this kind of situation. I, as the CR, did my job, but clock is ticking. I was thinking that now the project will have to pay for a second CR -- but then again, if I would continue to review this one, I would spend more than 15min so it wouldn't be correct. So yeah, I think this is the best solution, just close this and open another one, discuss further changes there :) |
@yegor256 the solution I've provided works and moves the project forward. If an improvement needs to be made then I understand we can leave a puzzle for it. Agree? This job has gone beyond budget for both DEV and REV. |
@llorllale sure, you can always "puzzle" the problem to cut corners and close the ticket. |
As per ARC review: * Left puzzle for further refactor towards simpler solution
@amihaiemil @yegor256 I've changed the puzzle; now leaving the refactoring work as the puzzle |
@yegor256 can we merge this now, it's the 10th day, 0crat will take it away tonight, I think :( |
The user @amihaiemil/z resigned from #196, please stop working. Reason for job resignation: It is older than 10 days, see §8 |
Resigned on delay, see §8: -15 points just awarded to @amihaiemil/z, total is +1145 |
@rultor merge |
The job #196 is now out of scope |
as per #135:
Added
xsi:noNamespaceSchemaLocation
to the generatedmetric.xml
and left puzzles for the rest of the schemas insrc/resources/org/jpeek/xsd