I'm working on a Sonar project and I have to make a plugin in order to get metrics and to compute them.
In order to understand how it works, I'd like to try to do the following examples:
Get the value (complexity) and to compute it as a double or a float value.
Take the complexity value (MetricsCore.COMPLEXITY) and if it's more than 200, write a message to say that it's too complex.
Take the number of comments lines and multiply it by 10.
I know that in these examples what I want to do is useless, but it's just to understand how to get the Metrics Core value and take their value, and to create new Metrics.
I don't find a lot of documentation....
Thank you very much
For information, I will use Sonar-reference-plugin.
You can find our sample plugins here: https://github.com/SonarSource/sonar-examples/tree/master/plugins. "sonar-reference-plugin" should give you lots of information.
This should help you to better understand how things work.
Related
Is it possible to have OSMnx (great tool BTW) include car ferries when building a graph? Failing that, what would be the most direct way to build such a graph? The problem isn't just that the ferry routes themselves aren't present but, without the ferries, islands that are in reality reachable by car aren't included in the road network.
I have tried using osmnx.settings.useful_tags_way to no avail. Using 'route'='ferry' in overpass-api returns what I would like to include in the graph so I have been editing the OSMnx downloads.py file trying to alter the overpass-api call directly.
Thanks!
First pass (hacky)
I've came up with fairly hacky partial solution by editing osmnx's downloads.py file and replacing the line (originally around line 350):
query_str = f"{overpass_settings};(way{osm_filter}(poly:'{polygon_coord_str}');>;);out;"
with:
osm_filter2 = f'["route"="ferry"]'
query_str = f"{overpass_settings};(way{osm_filter}(poly:'{polygon_coord_str}');>;way{osm_filter2}(poly:'{polygon_coord_str}');>;);out;"
The query string format took some trial and error. If this, or something like it, turns out to be the best approach, I'll try to make it more broadly applicable (add "ferry" to the predefined filter list rather than hardcoded, pass a list of filters, etc).
Much Better
I found that building separate graphs and unioning them using networkx.union or networkx.disjoint_union did not give usable results. So I have added a multiple filter capability to my version of the osmnx downloads.py file. I also added some additional network type options. So it's now possible to pass, for instance, "ferry" as a network_type for the osmnx.graph_from_* functions:
network_type = "ferry"
I can also now pass multiple network types using a pipe delimiter:
network_type = "drive|ferry"
to get a graph that is the union of the two. When doing this, I found that it's useful to create a second ferry-only graph and use that as a reference to update the tags in the combined network graph. It is also better to load non-simplified graphs at first and and simplify it/them yourself after this step.
Still experimenting
Still having some issues with non-connectedness - now in the ferry-only network. Car ferries at isolated crossings than don't share a harbor with a through-ferry are not included in the ferries-only graphs and therefore the tags of their counterparts in the combined network aren't getting updated as needed. The ferries in the combined network (network_type = "drive|ferry") are all present and connected correctly and therefore their respective islands are now on the road network - which is great. But, because their tags aren't being updated, these isolated ferries are getting default highway speeds (and I'm doing travel time analysis). I can use work around this using:
if not 'highway' in edge[3]:
but, for a robust solution, I think we want to be able to tag them explicitly.
I'd still love to hear what other think.
I am using "pullerquest" in github to comment on examination after examination. It generates comments like this one:
Here, I can only see the top ten of issues.
How can I see all of the issues? Is there a link to the complete list of files?
As of the current version (1.4.1),
the maximum number of issues to display in that list is hardcoded at 10,
by the MAX_GLOBAL_ISSUES constant in the source code.
If you want to know more details, here's how the plugin operates:
The PullRequestIssuePostJob class creates an instance of GlobalReport here, calling this constructor, which uses the MAX_GLOBAL_ISSUES constant as the default maximum.
PullRequestIssuePostJob will process each issue, eventually ending up in GlobalReport.process method, where a conditional statement decides to register the issue if we are under the maximum, otherwise simply count it.
If you really want to see all issues, you could fork the code and change the constant to a higher number on this line.
As #JulienH pointed out in a comment, the size of GithHub comments is limited, so it is not possible to display an unlimited number of issues. This is why the cap on the number of issues displayed is necessary.
everyone. I met the bug shown below:
I noticed that it just refer a map method in scala, I wonder how to solve this problem. Thank you very much~
OK, I will solve my problem by myself. Actually, the reason why the stackoverflow happens is that I use the Mutable.List in my code. However, List has the maximum value of length. While the number of element you want to put into List exceeds the maximum value of List designed length, this bug occurs. So the solution is to check your code and to see whether you have used some data structure which might has its limits in length or not.
I am using STS 3.4 and working on a web application based on Grails framework.
When i try to use System.err.println in groovy classes it does not print anything on standard eclipse console(STS console).
Actually there are times when in print things but that is like 1 in 10, I couldn't understand this random behavior.
I am using some library that uses System.err.println for debugging purposes but i could not get any debugging info. All i need to know is where and how to get System.err.println output?
Please help me, Thanks in advance
If it is a random behaviour, it may be not-flush-ed buffered stream. Especially, that can happen when output comes from different thread.
As a solution, you can hook in into System.err dispatching (it's a stream, that you can set from outside), and overload functions, to get desired output anywhere you want. Or simply force flush it. But be careful, as it may lead to performance problems.
Consider using logging instead for more standard and configurable output. This should help you to set it up: http://groovy.codehaus.org/Logging
The Spring Batch documentation says:
no <chunk/> element should be used within the <tasklet/>
There is no further explanation and I can't imagine any. Can anybody please explain this limitation to me?
I think you have missed something.
This piece of document is saying that, no <chunk/> element should be used within the <tasklet/> IF you are configuring for a Tasklet step.
If you look around a bit, you will see, in order to configure a chunk-oriented step, you are in fact using <chunk/> within a <tasklet/>