You can now purchase a Sourcery Pro subscription.
With Sourcery Pro you can:
Get more details here.
You can now select multiple files or folders and scan for duplicated code within them. This will find sections of code that are 3 lines long or greater that are duplicated in multiple places. It will also find near-duplicate code where variable names have been changed but the code structure remains the same.
This feature is available in our Pro subscription, for VS Code users only initially. It is in active development so we would love your feedback.
Sourcery is now available in Sublime.
Get more details and setup instructions here.
This will convert code like this:
result = "" for text in long_list_of_text(): result = result + text return result
result = "".join(long_list_of_text()) return result
results = sum(1 for token in source.split() if token == 1)
results = sum(token == 1 for token in source.split())
simplify-boolean-comparisonsuggest more often
use-countnow triggers on the result of
simplify-constant-sumrather than directly
remove-redundant-ifnow slightly more powerful
if..elifchains with repeated code
remove-redundant-ifwhen invalidated by a context manager
switchrefactoring could produce incorrect result