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

[Angular] Extract Function not detected #132

Open
mkshiblu opened this issue Sep 27, 2021 · 4 comments
Open

[Angular] Extract Function not detected #132

mkshiblu opened this issue Sep 27, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@mkshiblu
Copy link
Owner

mkshiblu commented Sep 27, 2021

Commit: github.com/angular/angular.js/commit/42e622b751d1ad1520b824473f9ad31e7efb75b3
File: src/ng/compile.js (line ~2793)
Original Method: nodeLinkFn
ExtractedMethod: setupControllers

Repository Commit Refactoring Node type Location before Local name before Location after Local name after
angular.js 42e622b751d1ad1520b824473f9ad31e7efb75b3 EXTRACT_MOVE Function src/ng/compile.js:124567-132721 nodeLinkFn src/ng/compile.js:133977-135217 setupControllers

image

image

JSRMiner IS reporting a rename variable

Rename Variable directive to controllerDirective in $CompileProvider.10.applyDirectivesToNode.nodeLinkFn(childLinkFn ,scope ,linkNode ,$rootElement ,boundTranscludeFn) at src/ng/compile.js|$CompileProvider.10.applyDirectivesToNode.nodeLinkFn

@mkshiblu
Copy link
Owner Author

@tsantalis Can you please take a look whenever you get a chance and let me know your thoughts on these two instances? (e.g. ExtractMove or Extract only) Specifically, is the rename variable a True Positive?

@tsantalis
Copy link
Collaborator

tsantalis commented Sep 29, 2021

The commit is not accessible. I get "404 not found"
But it looks like an Extract Function.

The rename variable is not correct. because directive declaration is matched in the extracted method.
name is renamed to controllerKey in the extracted method.

@mkshiblu
Copy link
Owner Author

@tsantalis Thanks for your reply. Looks like GitHub automatllcally shortened the visible URL. The updated link should work now.

I agree that the renamed variable is FN and Instead of ExtractMoveFunction it is an ExtractFunction refactoring.

@mkshiblu mkshiblu added the bug Something isn't working label Sep 29, 2021
@mkshiblu
Copy link
Owner Author

mkshiblu commented Oct 1, 2021

Commit: github.com/angular/angular.js/commit/8e104ee508418bc2ebb65e5b4ac73d22285cc224

File: src/ng/compile.js (line ~2793)

Extract Method Missed By both tool-

Original Method: nodeLinkFn
ExtractedMethod: setupControllers

image

image

image

Interestingly, though the same refactorings have been performed same as in the commit in description, in this commit it's not being reported by any of the tools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants