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
into:
result = "".join(long_list_of_text())
return result
Changes this:
results = sum(1 for token in source.split() if token == 1)
to this:
results = sum(token == 1 for token in source.split())
simplify-boolean-comparison
suggest more oftenuse-count
now triggers on the result of simplify-constant-sum
rather than
directlyremove-redundant-if
now slightly more powerfulif..elif
chains with repeated coderemove-redundant-if
when invalidated by a context managerswitch
refactoring could produce incorrect result