CODEMETRICS computes the same code metrics that the File Exchange displays for all submissions. It allows you to see your metrics before submitting.
Santosh Kasula (2020). Code Metrics (https://www.mathworks.com/matlabcentral/fileexchange/10514-code-metrics), MATLAB Central File Exchange. Retrieved .
Is there any way to get source that generated the MDF executable? Will not run on Windows x64 8.1, even with current copy of cygwin1.dll...
CODEMETRICS reports one clash for each file in my test. Is that behavior intended? Anyhow, I replaced
clashname = which( fname );
if isscalar( which( fname, '-all' ) )
clashname = '';
clashname = which( fname );
in the subfunction, getClash. Now it reports no clashes in the same test.
Note : "Filename Clashes" metric is incorrect because it is based on Matlab "which" function WITHOUT "-all" option (private\generateStats > getClash - line 381).
Thus, it does not detect if the function name match many one in the Matlab Path.
I have used this utility for quite a long time and really found it to be wonderfully useful. Unfortunately, it no longer works with the updated FEX format. I would be very grateful if it could be updated to work with the new FEX. One other functionality piece which would be very nice would be to have a summary of downloads page, which allowed one to easily see which of the fxdownloads are on the path, which are not, and to toggle the state of any given one. Thanks,
i want to work on fhss
Hello I'm Tobias
I download your zip File. But when I klick on the exe File, come the Display, that one dll File not found. What kan I do??
I'm a German :)
it is necessary to my project.
it is realy useful to the beginners
Really it is good and helpm a lot
please can you tell wich version of matlab i must have in order to use turbo code in simulink
Thanks, this is really useful for keeping track.
Thanks, this is really useful for keeping track.
Thank you very much, but I desire to know its corresponding references.
skjwhjskakahdkadhajkdhajkdhakdj ajkdehajkdhajkashadshakdhakdhkadh akjdhkajd kd akdkadkajd jkdjkd ajkd kdhkd hs
It is very good!
if may, you send this file for me.
i need for one research
this good file, and very important to reads
I got an error, then I fixed the proxy server and it is working great. I still have to be smart enough to put in the right search string...
Verry help full
still I have to do more on this
this project is very excellent
The "help warnings" section of the code metrics penalizes me for having no "example" section in a Contents.m file and in a demo.m file that exists solely for the purposes of producing a published m-file (which is *all* example!)
I wonder if Contents.m should be checked separately (as in the "contents report" on a directory). And I wonder if it would be possible to skip/relax checks on blah.m if blah.html is also present in the zip?
Thanks for a useful tool.
Thanks for providing. Please provide an intel r2007a mac version of the compiled windows & linux app for the dup code art of the metric.
While any metric isn't perfct I need to manage a large amount of code from many coder and this helps me get a first pass at code I need to look at.
je cherche un logiciel pour tabler des commande, et pouvoir me servir de procedé de mathlab.thank 's very much.
very good example explain
I would like, to acoupled of the toolbox fuzzy with comandes matlab, into to simulink for the desing fuzzy control process.
Could you tell me the way to generation a numer using the Gaussian random is, please?
It runs on MATLAB 7, how can it check the metrics of the m-files generated using oler versions of MATLAB correctly?
i am student university sharif.i want formations related simulation bldc.thnks
it is great
very good,and excellent
excellent one, improve it...
good one... keep it up
necesito un ejemplo de simplex en matlab
necesito con urgencia el desarrollo de un problema de simplex en matlab.
Good it helped me a lot
It is pretty nice. However, when I used it, the one it downloaded is not the one I picked. There is one file shift between them. Is it just me or everyone gets this problem?
I need a matlab code for face detection.thenk's
i want transmit nmr spectrum in matlab help me
its very good
I am getting following error with todays download (4/10/2006)
??? XMTOK takes one input, one output.
Error in ==> Improve Codes\private\generateStats>getLineCounts at 83
[unused,bptok] = xmtok(f);
Error in ==> Improve Codes\private\generateStats at 29
[stats(i,1).lines,stats(i,1).comments] = getLineCounts(file);
Error in ==> codemetrics at 31
stats = generateStats(workingDir);
hi i got your mail on the mathlab central and i will like to know you
Really it is good.I wish you all the best
I don't find this to be particularly useful myself, but it is worthwhile code to have around.
We seem to have a lot of whiners here. THIS IS FREE CODE PEOPLE! IF YOU DON'T LIKE IT, DON'T USE IT!
This code is on the File Exchange for free. It's not part of a MATLAB Official Release, and is not held to the same "high standards". I can write any peice of garbage code I want (not that this code is garbage) that is useful to someone out there and post it here at the File Exchange. Geez... you didn't just pay $1k for this code, so stop feeling as if this code should be tailored specifically to your liking.
BTW, I found this code easy to follow when reading through the *.m files, but maybe that's because I actually understand MATLAB, unlike *some* people.
I would like to know how an image can be loaded in the Matlab prompt
Does not work on a system running another OS than MSWindows, because it contains a compiled programme. The advantage of Matlab is, I guess, that scripts, functions and toolboxes are working on every platform, independent on the OS, isn't it?
Moreover, I fully agree with Oliver.
On one hand, I can't complain too much, the code appears to do what it is suppose to.
But, particularly a ~15 module function should be written such that it is easy to tell what it is doing and how.
It took me 45 minutes to dig down to discover the undocumented feature in "mlint" that calculates complexity.
This code doesn't even pass that test with an index of 13.
Each module should have a summary of which modules it calls and who calls it. Variables should be defined. Spaces should follow commas.
All these points, and more, are covered in the Style Guidelines in your White Paper section.
This looks like cowboy code and I've wasted too many years digging thru this type. It really is cheaper to write it well first, from well written requirements and with quality documentation.
If MathWorks employees write this style of code, how can I be assured the primary functions in MatLab are well written?
Eduard, it should now be doing the right thing with respect to methods. Let me know if we're still missing something.
Urs, mdf is compiled only for Windows, and now Linux. On other platforms the report won't be able to include "cloned code", but the rest of it should work. We're looking into opening the source code for this, but it dives into parts of the parser to find equivalent code (even if it's not identical) and we need to be sure we're not revealing any trade secrets.
Darren, yes this code will only run newer versions of MATLAB. It uses some experimental features that were only introduced recently.
Heinrich and Dave and John, we relaxed the regular expression we are using to detect examples. plot4 will now be OK.
As to the value of these metrics, nobody is claiming that they are the ultimate judge of quality. They are just here to suggest areas where your code might be improved and to show how any submission compares to others on the File Exchange.
Thank you all for taking the time to send your feedback and please keep it coming.
I tried to improve the score on some of my m-files using this, and ultimately decided that there's not always a direct correlation between good code and good score, as many have mentioned here. I think it would be useful if the SCORE and PERCENTILE RANKING were removed. These are often subjective, so assigning a number to the "goodness" may not be the way to go. However, the raw results from each criteria may still be helpful (the example check should be improved). Then based on those results, people can make their own judgement on the usefulness of the code.
Looking more deeply into these metrics, I note that cyclomatic complexity penalizes better codes. A comparison of two codes which are identical, except that one has extensive error checks for bad data, will yield a poor complexity score for the code which attempts to check for problems. Every test for problems should reduce the resulting score. I wanted to verify this fact, but I cannot since this submission only runs if you have PC matlab. Sigh.
I'm lukewarm about these metrics. These are not perfect at all, but they can be improved. Any single number measures of code will tend to show only the broad tendencies anyway. And they can easily miss subtle variations, for example, in how an example is flagged. Your examples may get missed just because of use of the phrase "example usage", instead of just "example".
Mlint is another problem, since mlint in the newer releases will catch more problems in your code. Since these metrics will use our own (sometimes older version of) mlint, they need not be even truly representative of the website metrics.
As for cyclomatic complexity, I can't even pronounce it. ;-) But it does seem ironic that "code metrics" got a poor score itself for cyclomatic complexity.
I personally find this submission to be a wonderful addition to the FEX. Be able to quickly see the number of lines of code and % percent of comments on a directory of code is wonderful. Anyway who manages a large number of matlab programmers will see the benefit of having this available. As for those that hate metric, think of it has a relative thing. If you see someone consistently with little comments, then you need to check it out and see if their comments are on par. Let's not think in absolutes.
For folks who write good code, these code metrics are not much use. However, they do identify poorly coded submissions. Folks who don't bother to check mlint messages or care about name clashes get flagged by these metrics. The "cyclomatic complexity" metric is the one I don't fully understand. Sometimes it just isn't possible to get a low (good) number.
As stated before, this metric misses things, like examples for example. I hate programs that purport to tell me how to program better anyway.
I did not run this submission, but looked at the results for other submissions. It produces wrong results sometimes for the help section. For example, look at the comments of the recent 'plot4' submission. It has an example, but code metrics tells it hasn't.
Doesn't seem to work on R13. Problem with regexp and 'Tokens'...
I agree with Us. Codemetrics suck. They don't measure anything useful and can give the impression there is something wrong with a submission when there isn't.
This is not an attack on the author, I'm sure your submission does exactly what it says it does for R14.
the core (mdf.?) is hidden - and this is simply very insulting and just a no-go to this community!
personally, i am extremely disenchanted by this submission - as i have been very disenchanted by the recently introduced file/code metrics to begin with since it is:
- absolutely (sic!) useless in the realm of ML if ever you understood anything about its visionary concept...
- promotes mediocrity (sic!) at best... that is: at best...
- most of the time computes, extracts, and displays plain false, inscrutable, mostly unintelligible, and absolutely misleading information (particularly for a newcomer) about a contribution
as i said: i am VERY disenchanted
This is just what I was looking for. Just one quation. Under filename clashes it only shows the clashes with the functions them selfs e.g. gravity.m: work/unitfun/gravity.m and not the real clashes e.g. for @foo/vertcat.m. Should i perhaps change my path or is this a bug?
Deleted fxsearch and fxdownload functionality which is not working anymore.
fxsearch: max search results limit has been changed to avoid memory problems.
FXDOWNLOADS and FXSEARCH has been added.
FXDOWNLOADS and FXSEARCH code has been added.
FXDOWNLOADS and FXSEARCH has been added.
Further relax the "example" detection.
* Compute cloned code also on Linux.