Introducing Sourcery Pro!

Don't miss out on these powerful new features - write better code faster today.

Date

Dec 02, 2020

Sourcery Pro launches
Photo by SpaceX on Unsplash

We're excited to announce that Sourcery just got a whole load more powerful.

With Sourcery Pro you can:

  • Remove duplicate code with our new automated method extraction
  • Refactor your whole project in the IDE
  • Use our GitHub bot on private repos

Remove duplicate code

Sourcery can now propose refactorings to extract blocks of code into new functions. This will be suggested in two circumstances:

  • When finding duplicate and near duplicate blocks of code within a single function
  • When finding a large block of code in the function that would be better off in its own function

Take a look:

Before extract method
The slider creation code appears twice
After extract method
The duplicate code has been extracted into a new method

Sourcery suggests where methods can be extracted and then does it for you - all you need to do is think of a name.

Getting rid of duplicate code and ensuring functions are small and easy to read are fundamental to writing high quality code. Sourcery is now here to help!

Scan your whole project with Sourcery

You can now get all of Sourcery's suggestions at once, right in the IDE.

Select the project or a folder within a project in the IDE plugins, and then have Sourcery scan every file within it. All refactoring suggestions will be displayed as they are found in the Problems window.

This makes it easy to refactor a large portion of the codebase quickly without manually having to visit every file to see the Sourcery suggestions.

More to come

This is just the beginning. In the coming weeks we will be expanding out our analysis to allow method extraction at the class and module level as well.

Banish duplicate code to the scrapheap - sign up here!