aibolit
aibolit copied to clipboard
external_methods_called.py:27-31: Implement external...
The puzzle 183-9b03d7d9
from #183 has to be resolved:
https://github.com/yegor256/aibolit/blob/76b6e4ebc5fa3260b3c44acd53e640d098107f64/aibolit/metrics/external_methods_called/external_methods_called.py#L27-L31
The puzzle was created by paulodamaso on 25-Apr-20.
Estimate: 30 minutes, role: DEV.
If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.
@acheshkov/z please, pay attention to this issue
@0crat in
The job #286 assigned to @paulodamaso/z, here is why; the budget is 30 minutes, see §4; please, read §8 and §9; if the task is not clear, read this and this; there will be a monetary reward for this job
@paulodamaso/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.
@0crat wait I wasn't notified
@acheshkov Looks like this can't be achieved with current c2nes/javalang
library. I couldn't discover from which class some MethodInvocation
belongs. That's what MethodInvocation
gets me:
MethodInvocation(arguments=[], member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)
I've filed an issue at javalang repo: https://github.com/c2nes/javalang/issues/79
@acheshkov Any advice on this one?
@acheshkov ping
@paulodamaso, to figure it out you have to work with AST directly.
@aravij could you get piece of advice, ho to implement that using a new AST API?
There is an unrecoverable failure on my side. Please, submit it here:
PID: 4@349556e6-fa72-4cfa-be64-c068e2ccb4e1, thread: pool-49-thread-1
com.zerocracy.radars.github.GhProject[69] com.zerocracy.radars.github.GhProjectNotFoundException: Github project for 'cqfn/aibolit' repo was not found
0.54.5: Issue: cqfn/aibolit#286, Comment: 627867797
There is an unrecoverable failure on my side. Please, submit it here:
PID: 4@349556e6-fa72-4cfa-be64-c068e2ccb4e1, thread: pool-44-thread-1
com.zerocracy.radars.github.GhProject[69] com.zerocracy.radars.github.GhProjectNotFoundException: Github project for 'cqfn/aibolit' repo was not found
0.54.5: Issue: cqfn/aibolit#286, Comment: 635085794
There is an unrecoverable failure on my side. Please, submit it here:
PID: 4@349556e6-fa72-4cfa-be64-c068e2ccb4e1, thread: pool-64-thread-1
org.hamcrest.MatcherAssert[20] java.lang.AssertionError: HTTP response status is not equal to 205:
202 Accepted [https://api.github.com/notifications]
Server: GitHub.com
Date: Mon, 13 Jul 2020 07:26:19 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 132
Status: 202 Accepted
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4445
X-RateLimit-Reset: 1594626188
X-GitHub-Media-Type: github.v3
Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset
Access-Control-Allow-Origin: *
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
X-Frame-Options: deny
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
Content-Security-Policy: default-src 'none'
Vary: Accept-Encoding, Accept, X-Requested-With
X-GitHub-Request-Id: A334:1D74:15771:332D2:5F0C0C9B
{"message":"Unread notifications couldn't be marked in a single request. Notifications are being marked as read in the background."}
Expected: HTTP response with status 205
but: was <202 Accepted [https://api.github.com/notifications]
Server: GitHub.com
Date: Mon, 13 Jul 2020 07:26:19 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 132
Status: 202 Accepted
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4445
X-RateLimit-Reset: 1594626188
X-GitHub-Media-Type: github.v3
Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset
Access-Control-Allow-Origin: *
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
X-Frame-Options: deny
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
Content-Security-Policy: default-src 'none'
Vary: Accept-Encoding, Accept, X-Requested-With
X-GitHub-Request-Id: A334:1D74:15771:332D2:5F0C0C9B
{"message":"Unread notifications couldn't be marked in a single request. Notifications are being marked as read in the background."}>
0.54.5: Issue: cqfn/aibolit#286, Action: created
@acheshkov Looks like this can't be achieved with current
c2nes/javalang
library. I couldn't discover from which class someMethodInvocation
belongs. That's whatMethodInvocation
gets me:MethodInvocation(arguments=[], member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)
I've filed an issue at javalang repo: c2nes/javalang#79
@paulodamaso According to your issue in javalang repo, I think our previous implemented metric "FanOut" can help you.
for invoked_method_child in tree.children_with_type(i, ASTNodeType.METHOD_INVOCATION):
name_of_invoked_class = tree.get_method_invocation_params(invoked_method_child)
Also, my advice is not to use javalang anymore. We currently use new interface AST