You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The command list-metrics outputs metrics in unpredictable order, which might be confusing for users that expect it to be stable. (e.g. missing some info when skimming the output).
My actual issue was that I'm using ALL_OPERATORS to build an index of HTML reports, and there too the ordering is inconsistent. It seems it comes from using a set to build this dictionary:
"""Dictionary of all operators"""ALL_OPERATORS= {
operator.name: operatorforoperatorin {
OPERATOR_CYCLOMATIC,
OPERATOR_MAINTAINABILITY,
OPERATOR_RAW,
OPERATOR_HALSTEAD,
}
}
This seems to be the root cause of #126. So I'd like to request the feature of stable ordering, likely by changing the set literal to a tuple literal.
I've solved my issue by sorting ALL_OPERATORS.items(), then saw that it also affects list-metrics.
I can submit a PR if it's considered a desirable change.
The text was updated successfully, but these errors were encountered:
The command list-metrics outputs metrics in unpredictable order, which might be confusing for users that expect it to be stable. (e.g. missing some info when skimming the output).
My actual issue was that I'm using
ALL_OPERATORS
to build an index of HTML reports, and there too the ordering is inconsistent. It seems it comes from using a set to build this dictionary:This seems to be the root cause of #126. So I'd like to request the feature of stable ordering, likely by changing the set literal to a tuple literal.
I've solved my issue by sorting
ALL_OPERATORS.items()
, then saw that it also affects list-metrics.I can submit a PR if it's considered a desirable change.
The text was updated successfully, but these errors were encountered: