diff options
author | George Kadianakis <desnacked@riseup.net> | 2019-03-05 15:01:07 +0200 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-03-13 09:27:29 -0400 |
commit | 8bacc1dad170a9a29633d95c91a4139af6a2bfe7 (patch) | |
tree | 527e20b26938e33a3520e582f684cc01f5c724c8 /scripts/maint/practracker/problem.py | |
parent | 4795f2d3a0df72d0e51a51eb1fbafdc68bfbc77c (diff) | |
download | tor-8bacc1dad170a9a29633d95c91a4139af6a2bfe7.tar.gz tor-8bacc1dad170a9a29633d95c91a4139af6a2bfe7.zip |
practracker: Improve documentation in problem.py .
Diffstat (limited to 'scripts/maint/practracker/problem.py')
-rw-r--r-- | scripts/maint/practracker/problem.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/scripts/maint/practracker/problem.py b/scripts/maint/practracker/problem.py index 9f5771678e..2330098ef3 100644 --- a/scripts/maint/practracker/problem.py +++ b/scripts/maint/practracker/problem.py @@ -53,6 +53,10 @@ class ProblemVault(object): return False class Problem(object): + """ + A generic problem in our source code. See the subclasses below for the + specific problems we are trying to tackle. + """ def __init__(self, problem_type, problem_location, metric_value): self.problem_location = problem_location self.metric_value = int(metric_value) @@ -72,14 +76,35 @@ class Problem(object): return "problem %s %s %s" % (self.problem_type, self.problem_location, self.metric_value) class FileSizeProblem(Problem): + """ + Denotes a problem with the size of a .c file. + + The 'problem_location' is the filesystem path of the .c file, and the + 'metric_value' is the number of lines in the .c file. + """ def __init__(self, problem_location, metric_value): super(FileSizeProblem, self).__init__("file-size", problem_location, metric_value) class IncludeCountProblem(Problem): + """ + Denotes a problem with the number of #includes in a .c file. + + The 'problem_location' is the filesystem path of the .c file, and the + 'metric_value' is the number of #includes in the .c file. + """ def __init__(self, problem_location, metric_value): super(IncludeCountProblem, self).__init__("include-count", problem_location, metric_value) class FunctionSizeProblem(Problem): + """ + Denotes a problem with a size of a function in a .c file. + + The 'problem_location' is "<path>:<function>()" where <path> is the + filesystem path of the .c file and <function> is the name of the offending + function. + + The 'metric_value' is the size of the offending function in lines. + """ def __init__(self, problem_location, metric_value): super(FunctionSizeProblem, self).__init__("function-size", problem_location, metric_value) |