Summarize data

Please, check my code!
I forgot to include some kind of readme.st. To test custom command:
python manage.py summarize [date YYYY-MM-DD] [--nodeletion]
If you pass no parameters it summarizes current date minus 15 days (single day and no a 15-days period)
I'm still doing that by using dicts and a common function for set an
initial status for a dict and other to increase counters for each key. I'm
using code_status as keys.

On Mon, Oct 6, 2014 at 8:57 PM, Lorenzo Gil Sanchez <
notifications@github.com> wrote:

> In okapiweb/management/commands/summarize.py:
>
> > +                        'status_200': method_status_200,
> > +                        'status_400': method_status_404,
> > +                        'status_404': method_status_404,
> > +                        'status_500': method_status_500,
> > +                    }
> > +                    method_list.append(methods_data)
> > +                paths_data = {
> > +                    'path': path,
> > +                    'mean_response_time': path_mean_response_time,
> > +                    'min_response_time': path_min_response_time,
> > +                    'max_response_time': path_max_response_time,
> > +                    'status_200': path_status_200,
> > +                    'status_400': path_status_404,
> > +                    'status_404': path_status_404,
> > +                    'status_500': path_status_500,
> > +                    'methods': method_list
>
> This function/method is quite long and I see a lot of oportunities for
> refactoring and abstraction. Each inner loop is very similar to the parent
> loop so I would write aux functions/methods to do the hard work. Also, that
> make them easier to write tests for them.
>
> As this algorithm is actually modifying data (creating new data and
> removing old data) I think automated tests are pretty important here.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/redbeacon/okapi-web/pull/23/files#r18477293>.
>



-- 
Alejandro Garcia
Software Engineer at RedBeacon.com