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

Export csv report via java code #68

Open
fdj612 opened this issue Feb 2, 2021 · 11 comments
Open

Export csv report via java code #68

fdj612 opened this issue Feb 2, 2021 · 11 comments

Comments

@fdj612
Copy link

fdj612 commented Feb 2, 2021

Hi,
Thanks for your great work. I'd like to generate a .csv report for java package and export it directly through java code. Is there an existing library that could be used or any suggestion to directly call your module without Intellij installed?
Any advice would be helpful. Thanks
Best,
Susan

@BasLeijdekkers
Copy link
Owner

Sorry, it is not possible to use the MetricsReloaded plugin without IntelliJ IDEA. It needs on IntelliJ IDEA's Java parser and abstract syntax tree. Furthermore I also do not know of any library that can do this.

What is possible is invoking IntelliJ IDEA from the command line and collecting the desired metrics, without user interface. Perhaps that could be useful?

Bas

@fdj612
Copy link
Author

fdj612 commented Feb 3, 2021

Hi,
Thanks for your reply. It is helpful!
Best,
Susan

@fdj612 fdj612 closed this as completed Feb 3, 2021
@fdj612
Copy link
Author

fdj612 commented Feb 8, 2021

Hi,
I have tried to use the command line to calculate the metric, but are all failed.
I have tried to use the profile name like "complexity", "Complexity", "complexity metrics", and "complexity.metrics.profile.name". However, all the metric profile names I've tried show "profile not found."
Could you list the valid or existing metric profile names that can be used to calculate the metrics, thank you!!
Best,
Susan

@fdj612 fdj612 reopened this Feb 8, 2021
@BasLeijdekkers
Copy link
Owner

On MacOS the following works for me:
/Applications/IntelliJ\ IDEA\ 2020.3.app/Contents/MacOS/idea metrics /Users/bas/Projects/MyProject "Complexity metrics" output.xml
The capitalization of the name has to match exactly.

I also noticed running metrics from the command line could use some improvements. Please keep this issue open as a reminder, and i will try to implement this for the next release.

@fdj612
Copy link
Author

fdj612 commented Feb 9, 2021

Hi,
Oh~ Thank you for your help.
Is this solution also works on Windows?
Thanks for your great work!!!

Best,
Susan

@fdj612
Copy link
Author

fdj612 commented Feb 9, 2021

Hello,
I've tried on Windows, I use "idea.bat project_path "Complexity metrics" output.xml"
In the beginning, it says file "output.xml" not found, so I create an empty file.
However, it turns to display this error:
image
image

Can you help me what's wrong >_<

Thank!!!
Best,
Susan

@BasLeijdekkers
Copy link
Owner

It appears all of these are just warnings produced by IntelliJ IDEA. I don't see any errors.

@fdj612
Copy link
Author

fdj612 commented Feb 9, 2021

oh~Understand.
But the output.xml is not written.
Is there any wrong with my command?
"idea.bat project_path "Complexity metrics" output.xml"
BTW, my OS is Windows.
Thanks^_^

Best,
Susan

@BasLeijdekkers
Copy link
Owner

I don't see anything wrong with your command. Is there any more output on the command line? When it working you should see messages like:

MetricsReloaded running on IntelliJ IDEA 2020.3.2
Opening project...
Project MyProject opened.
Calculating metrics
Finished.

@runexperiment
Copy link

Hi,
I have a problem,How can windows calculate the complexity information from the command line
Thanks for your great work!!!
Best,
memory

@runexperiment
Copy link

oh~Understand. But the output.xml is not written. Is there any wrong with my command? "idea.bat project_path "Complexity metrics" output.xml" BTW, my OS is Windows. Thanks^_^

Best, Susan

Hi
I have the same problem,How can windows calculate the complexity information from the command line,What specific command should I execute."idea.bat project_path "Complexity metrics" output.xml" ,Execute this command, I will open idea and generate some empty files.
Best
memory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants