Skip to content

Instantly share code, notes, and snippets.

@ndevenish
Created March 7, 2019 00:36
Show Gist options
  • Save ndevenish/90caad87d155551591c2aedc89d96d4a to your computer and use it in GitHub Desktop.
Save ndevenish/90caad87d155551591c2aedc89d96d4a to your computer and use it in GitHub Desktop.
Report of fix_show.py
Running fix_show.py over cctbx https://gist.github.com/ndevenish/47813efb6f94576686495edec94cb0ac.
188 Unique show() functions
79 show() functions didn't qualify
68 Because of non-object bases
9 Already had __str__
2 No str, but already had __repr__
109 show() functions DID qualify
32 of these functions could not be auto-analysed:
17 Could not determine any output calls (e.g. not print, calls sub-function)
5 Have extra, required arguments other than the destination stream (e.g. a mandatory "title")
6 Write to both stdout *and* a separate log parameter
3 Write to a destination that isn't passed in as an argument (e.g. a preconfigured self.log)
1 Didn't have any non-self arguments (or non-class function)
0 Failed for other reasons
77 Passed checks and can be refactored
60 Write to a keyword argument (f, log, out)
10 Only write to stdout (e.g. bare print)
7 Write to the only positional argument
Summary of qualifying candidate functions:
53 mmtbx
23 cctbx
10 iotbx
7 libtbx
4 rstbx
3 xfel
3 smtbx
3 scitbx
1 spotfinder
1 gltbx
1 crys3d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment