[GenABEL-dev] [Genabel-commits] r1139 - pkg/ProbABEL/src
Yurii Aulchenko
yurii.aulchenko at gmail.com
Fri Mar 15 11:31:47 CET 2013
Dear Maarten,
Many thanks for this post - it was very interesting to read
about cyclomatic complexity. Something new for me!
Also many thanks for mentioning the tools - definitely something to run my
code through next time.
best wishes,
Yurii
On Fri, Mar 15, 2013 at 11:00 AM, Maarten Kooyman <kooyman at gmail.com> wrote:
> Hi Yurii et al,
>
> As you might known there are quite some users who like to have the
> P-value in there Probabel output. The part where the output is handled
> is quite complex and I did not had at first sight a clue where to
> start without being afraid that the whole thing would fall like house
> of cards. This was the main functions (which should not do output, but
> that is a topic of another discussion) It had a McCabe index
> (cyclomatic complexity) of over 80. To keep a long story short:
> everything with a cyclomatic complexity over 30 is might be sketchy in
> terms of code quality and in terms of code maintainability just
> plainly bad. You can find more about this at
> http://en.wikipedia.org/wiki/Cyclomatic_complexity.
>
> I was able to simplify the code because the part were each snp is
> "calculated" was duplicated for two cases: one for probability files
> and one dose files. I merged the 2 parts of code which removed lots
> of duplicated code and some of the cyclomatic complexity: this dropped
> by almost 20 percent to 67. This is still far from perfect but it is a
> start.
>
>
> Kind regards,
>
> Maarten Kooyman
>
> p.s. 2 tools to calculate this kind of statistics:
> CCCC - C and C++ Code Counter (Command line tool which outputs in html)
> metriculator- a plugin for Eclipse CDT (I like this one! )
>
> On Thu, Mar 14, 2013 at 9:22 AM, Yurii Aulchenko
> <yurii.aulchenko at gmail.com> wrote:
> > Hi Maarten,
> >
> > Wow - not a trivial amount of code commented out. Great job on cleaning
> the
> > ProbABEL!
> >
> > best,
> > Yurii
> >
> >
> > On Wed, Mar 13, 2013 at 11:07 PM, <noreply at r-forge.r-project.org> wrote:
> >>
> >> Author: maartenk
> >> Date: 2013-03-13 23:07:17 +0100 (Wed, 13 Mar 2013)
> >> New Revision: 1139
> >>
> >> Modified:
> >> pkg/ProbABEL/src/main.cpp
> >> Log:
> >> commented out unneeded code (+-230 lines) and removed some duplicated
> code
> >> by a function
> >>
> >>
> >
> > _______________________________________________
> > genabel-devel mailing list
> > genabel-devel at lists.r-forge.r-project.org
> >
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel
>
--
-----------------------------------------------------
Yurii S. Aulchenko
[ LinkedIn <http://nl.linkedin.com/in/yuriiaulchenko> ] [
Twitter<http://twitter.com/YuriiAulchenko>] [
Blog <http://yurii-aulchenko.blogspot.nl/> ]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/genabel-devel/attachments/20130315/65f4d803/attachment.html>
More information about the genabel-devel
mailing list