Is there any plugin to some IDE that show the number of times a line is run in the code?
Eclipse's ECLemma does not seem to have a setting to show execution times at the left-hand-side bar, like in the service WebCat.
I think the eclipse test and performance tools plateform would be able to help you with this. It includes a profiler which will instrument your code and provide the information you want.
Careful with profiling, it can be a heavy performance hit depending on how many functions/classes you monitor
Have a look at the breakpoint properties in eclipse may be you can configure a variable to capture the hitcount
What's wrong with writing to a log file or to screen or using a counter?
The focus of code coverage is only if a line is executed or not. Nothing more.
To get counters you would have to look at profiler software and not code coverage.
There are plugins for both Eclipse and Netbeans. I am not sure if they show counters per line, but I think that they show counters per method, which might be what you want...
(source: free.fr)
In NetBeans 6.8 there is a nice code coverage tool which does pretty much that what you want but actually only for ruby. (right click project -> code coverage)
But could you use an ant task or maven plugin? Then Take a look at this list
Related
I'm using Intellij IDEA, working on a Hybris project. We use ant for build, but the build takes too long (about 15 min), so when i start the build, I must stop coding, so i lose a lot of time.
My question is, can I keep coding while the build is running? Or will my uncomplete extra code make the build fail?
Thank you
can I keep coding while the build is running?
No, you should not change the code while the build is going on. Yes, you can keep changes unsaved :)
will my uncomplete extra code make the build fail?
Yes, it might.
I lose a lot of time.
Use code hot-swapping tools, like Jrebel(Licenced), DCEVM(opensource).
It is simply not possible to edit while building. You might end up with an inconsistent build. If you want to speed up development, try to set up something like jRebel.
you can just separate editing from building process by build on another computer device or try CI while you are using any CVS like GitLab, GitHub.
I am wondering why they 'quick run/preview' displays object different that when you select 'main run' in Eclipse. I personally find that objects look better/neater/more elegant in quick run/preview mode than when I when I run and compile the application via the 'main run' option.
Can anyone tell me there is such a big difference, and what I need to do to actually make my application and its objects look like in 'quick run/preview' mode?
Quick run/preview in Eclipse is used to compile the code and run it more efficiently than normal run. I'm assuming you are referring to this when you are building GUI's?
Anyhow, quick run/preview is just to quickly preview your application regardless of the looks.
I'm assuming you want your GUI to have the Look and Feel of a Windows application rather than the "metal" Java GUI look.
This is done relatively easy as you can both make the "Look and Feel" of your application be based on whatever OS you are running or which one you prefer.
Refer to this simple article here.
I wanted to know if there is a way to measure the overhead of a specific function or even the running time of an application in Eclipse (with the capability to run the test for arbitrary times to get the average time).
I have a code that should be executed in Eclipse therefore looking for such a thing. I know that we have Jmeter in Netbeans and I'm looking for something similar in Eclipse.
Thanks
I have had good experiences with JProfiler. It should be precise enough to give usable data even when you run your function only once, depending on how you set it up. It also optionally integrates with Eclipse.
It's not free, but there's a fully functioning trial available.
I used Traceview before and it worked quite good to me.
It quite easy to use, just open the DDMS view in eclipse and look for the icon with three arrows with a red dot (Start Method Profiling). Click the icon and test your app as you want. When you are done click on stop. The trace should open in a new tab.
You could use the following
http://www.jvmmonitor.org/
It's called Java Monitor and comes as an eclipse plugin. You can install it from eclipse market place.
How can I tell eclipse to inform me when the number of lines in my method exceeds a certain number?
I've tried researching but ended up with nothing.
Any help will be appreciated.
Thanks folks!
An eclipse plugin perhaps?
You can use code metrics plugins for Eclipse which analyze your code and calculate statistics.
An example:
http://metrics.sourceforge.net/
The statistics include the average and maximum line numbers of methods.
I found it:
An eclipse plugin - http://metrics.sourceforge.net/
It will show the metrics in a different panel but will not raise a warning in your eclipse though. You need to look at the metrics.
Install CodePro Analytix. Configure the issue detection for method length in CodePro Analytix to your number of lines. Set the issue level to "Error". Then use the dynamic auditing mode of CodePro Analytix. It will always scan the currently opened editor files for violations. So on saving a file containing a long method, you get a violation error immediately.
Maybe you want to consider plugins like PMD or FindBugs to improve the code quality.
CheckStyle can check for style issues in your code, like a method that is too long (confer MethodLength). There is an Eclipse Plugin where you can configure which checks to do, what your limits are (e.g., with how many lines to report a method as "too long"), and how to display that the check failed (e.g., as an error, as a warning,...).
is it possible to create a plugin or add on for netbeans such that whenever i run or compile a project, a pop up box shows me that run complete or build complete. I know i can create a pop up box using java. this is just to know, consider something like learning process.
I assume that you can do something like so, please take a look at this Netbeans Plugin Tutorial.
However, what you are requesting, a build complete notification is already available through Netbean's Console output window. Also, popups can get pretty annoying pretty fast, so be careful.