[OpenStack-Infra] Should we enforce check for lengthy functions or module
Monty Taylor
mordred at inaugust.com
Sun Dec 22 20:12:29 UTC 2013
It won't detect lengthy, but I think detecting 'too complex' might have the effect of finding functions that are too long. You're right though, it also might not... :)
On Dec 22, 2013 2:06 PM, Denny Zhang <denny at unitedstack.com> wrote:
>
> > Flake8 has a built-in check, called McCabe, which checks for
> > complexity (how many levels if nesting deep) It's a bit of a disaster
> > trying to run it right now... But I'd start with trying to get that
> > going.
> [Denny] Monty, nice to get your feedback.
>
> 1. McCable doesn't seem to be able to detect lengthy functions/modules. Right?
> http://nedbatchelder.com/blog/200803/python_code_complexity_microtool.html
> http://nedbatchelder.com/files/codepaths0.py
>
> 2. Totally agree: we may need this new kind of check; but we should turn
> on the switch gradually.
>
> >
> > On Dec 22, 2013 1:22 PM, Denny Zhang <denny at unitedstack.com> wrote:
> >>
> >> hi Stackers
> >>
> >> When I go through the implementation of various OpenStack projects, I used to find:
> >> 1. lengthy function, which may be several hundreds.
> >> 2. lengthy module, which may be several thousands
> >>
> >> Dividing lengthy code into small segments can help others to understand it.
> >>
> >> Should we enforce the check in gate check pipeline of OpenStack Infra's jenkins?
> >>
> >> --
> >> Denny Zhang(张巍)
> >> Email: filebat.mark at gmail.com
> >> Github: https://github.com/DennyZhang
> >> Blog: http://blog.ec-ae.com/
> >>
> >> When you blame others, you give up your power to change
> >>
> >> O(∩_∩)O
> >>
> >> _______________________________________________
> >> OpenStack-Infra mailing list
> >> OpenStack-Infra at lists.openstack.org
> >> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-infra
> >>
>
More information about the OpenStack-Infra
mailing list