{"id":236,"date":"2015-12-16T00:09:52","date_gmt":"2015-12-15T23:09:52","guid":{"rendered":"http:\/\/andreikucharavy.com\/L3Cache\/?p=236"},"modified":"2017-02-10T16:48:21","modified_gmt":"2017-02-10T15:48:21","slug":"my-python-programming-stack-for-a-refactoring-job","status":"publish","type":"post","link":"https:\/\/andreikucharavy.com\/L3Cache\/my-python-programming-stack-for-a-refactoring-job\/","title":{"rendered":"My Python programming stack for a refactoring job"},"content":{"rendered":"<h2>IDE:<\/h2>\n<p><a href=\"https:\/\/www.jetbrains.com\/pycharm\/\">Pycharm<\/a> professional edition:<\/p>\n<ul>\n<li>Marvelous support for refactoring: renaming, moving\\<\/li>\n<li>Marvelous support for code testing coverage<\/li>\n<li>Excellent support for styling (PEP8, PEP308)<\/li>\n<li>Marking of where code was edited + side bar allowing a really easy navigation through code <\/li>\n<li>Split edition windows (in case you are editing two very distant locations withing the same file)<\/li>\n<li>Support for all the file formats I ever have to work with &#8211; Excellent integration with git\/GitHub<\/li>\n<\/ul>\n<h2>Before I push:<\/h2>\n<p><a href=\"https:\/\/flake8.readthedocs.org\/en\/latest\/\">flake8<\/a> <code>--select=C --max-complexity 10 myProject<\/code><\/p>\n<ul>\n<li>As a rule of thumb, everything with McCabe complexity over 15 needs to be refactored<\/li>\n<li>Everything with complexity over 10 needs to be looked into to make sure method is not trying to do too much at once.<\/li>\n<\/ul>\n<p><a href=\"http:\/\/clonedigger.sourceforge.net\/\">clonedigger<\/a><\/p>\n<ul>\n<li>Tells the complementary story of the project complexity and redundance<\/li>\n<li>In my experience, more easy to read and understand than pylint version<\/li>\n<li>Allows me to poll together methods that do same things and extract it as a function for better control<\/li>\n<\/ul>\n<h2>Upon push:<\/h2>\n<p><a href=\"https:\/\/travis-ci.org\">Travis-Ci.org<\/a> + <a href=\"https:\/\/coveralls.io\/\">Coveralls.io<\/a><\/p>\n<ul>\n<li>Made me think about how my end users will install it <\/li>\n<li>Forces me to write unittests wherever possible.<\/li>\n<li>Unittests + coverage are good: they force me to think about paths that code can be taking and implement proper tests or insert nocoverage statements<\/li>\n<li>Once implemented, they make testing the code much simpler<\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.quantifiedcode.com\">Quantified Code.com<\/a><a href=\"https:\/\/landscape.io\">Landscape.io<\/a><\/p>\n<ul>\n<li>Checks my code for smells and advice consistent with different PEPs.<\/li>\n<li>Cites sources, so that I don&#8217;t have just the verification, but also the spirit behind its introduction<\/li>\n<li>Sends me an e-mail upon each push telling me if I&#8217;ve introduced additional smells or errors upon pushing<\/li>\n<li>In the end fairly complementary to the tools I already have when it comes to the static analysis&#8217;<\/li>\n<\/ul>\n<h2>In addition to all of the above:<\/h2>\n<p>Developer Decision log:<\/p>\n<ul>\n<li>Because I need to have a bird&#8217;s eye view of the project, I put all the decisions or decisions to make as I read and\/or refactor code there, to make sure I know what is done and what is to do.<\/li>\n<li>Unlike issues, it is a little bit more in-depth explanation of what is going on, not necessarily to be shown in the docs, nor necessarily worth opening\/closing an issue.<\/li>\n<\/ul>\n<h2>What is missing<\/h2>\n<p>Profiling tools. I would really like to know how the modifications I introduce to code impact performance, but I don&#8217;t think I have yet found a way of doing it other than log everything and profile specific functions when I feel they are being really slow.<\/p>\n<p>On the other premature optimization never brought anything good and a proper structuring of the project would make profiling and optimization easier in the long run.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>IDE: Pycharm professional edition: Marvelous support for refactoring: renaming, moving\\ Marvelous support for code testing coverage Excellent support for styling (PEP8, PEP308) Marking of where code was edited + side bar allowing a really easy navigation through code Split edition windows (in case you are editing two very distant locations withing the same file) Support <a class=\"read-more\" href=\"https:\/\/andreikucharavy.com\/L3Cache\/my-python-programming-stack-for-a-refactoring-job\/\">[&hellip;]<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24],"tags":[],"class_list":["post-236","post","type-post","status-publish","format-standard","hentry","category-prog"],"_links":{"self":[{"href":"https:\/\/andreikucharavy.com\/L3Cache\/wp-json\/wp\/v2\/posts\/236"}],"collection":[{"href":"https:\/\/andreikucharavy.com\/L3Cache\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/andreikucharavy.com\/L3Cache\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/andreikucharavy.com\/L3Cache\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/andreikucharavy.com\/L3Cache\/wp-json\/wp\/v2\/comments?post=236"}],"version-history":[{"count":6,"href":"https:\/\/andreikucharavy.com\/L3Cache\/wp-json\/wp\/v2\/posts\/236\/revisions"}],"predecessor-version":[{"id":311,"href":"https:\/\/andreikucharavy.com\/L3Cache\/wp-json\/wp\/v2\/posts\/236\/revisions\/311"}],"wp:attachment":[{"href":"https:\/\/andreikucharavy.com\/L3Cache\/wp-json\/wp\/v2\/media?parent=236"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/andreikucharavy.com\/L3Cache\/wp-json\/wp\/v2\/categories?post=236"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/andreikucharavy.com\/L3Cache\/wp-json\/wp\/v2\/tags?post=236"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}