† ideally refactor the function write_counts()
because it scores
D (21) on cyclomatic complexity and pylint
does not like it either:
R: 99, 0: Too many local variables (24/15) (too-many-locals)
R: 99, 0: Too many branches (14/12) (too-many-branches)
‡ currently, the function write_counts()
handles only presentations
E & K, and a course duration of six months. Ideally it should handle
any month code, and duration should be an argument to the function
with a default value of six months.
Currently, the output csv table had one row per day with posts. Possibly extend
this script to write another output csv table along the lines of
track_classified_posts.write_counts()
so that days without posts also
recorded in the csv table, with zeroes.
*_classified_counts.csv
works
beautifully and can be tweaked as required for publication far more easily than
by adjusting a scriptCreate an esteem.common.py containing:
General review and refactor, for example filter_forum()
in filter_posts.py
is really filter_forum()
and write_posts()
, even so its cyclomatic
complexity is still A (5) so refactoring this function is not a high priority
task.
Currently the scripts are run from the command line, and any changes to their input and output directories required editing of the script. The scripts could benefit from being rewritten to accept command line arguments at the very least. It might even be desirable, after consultation with the project team members, to write a GUI front-end to the framework.