Search for code duplicates in WebStorm/PhpStorm
We’re glad to announce a new code analysis feature that is available in the most recent PhpStorm EAP— Locate Duplicates. This feature lets you quickly find duplicate code fragments and then fix them, therefore reducing the size of your code and making it easier to understand and maintain.
The feature is invoked via Code | Locate Duplicates menu that brings the Code Duplication Analysis Settings dialog where you can adjust the search options.
Do not show duplicates simpler than option can be used to exclude duplicates of insignificant size. Anonymize uncommon subexpressions simpler than option is used to anonymize not only single entries like variables or literals, but also short expressions. Default values for these settings are good to begin with but you can of course experiment and find settings that best match your code.
Results of this search are shown in a diff view with code fragments so that you can inspect the results:
Last, but not least fact is that PhpStorm also detects duplicates in CSS code, so you can easily spot similar declarations, and this surely helps find a way through large CSS files. You can adjusted the criteria for declaring the CSS fragments as duplicates, too:
Working with Windows Azure SQL Database in PhpStorm
PhpStorm provides us the possibility to connect to Windows Azure SQL Database right from within the IDE. In this post, we’ll explore several options that are available for working with Windows Azure SQL Database (or database systems like SQL Server, MySQL, PostgreSQL or Oracle, for that matter): …
Change signature refactoring in PhpStorm
A very powerful refactoring is the Change signature refactoring in PhpStorm. It enables us to modify a function signature in many ways: we can change the function name, change its visibility, add, remove and reorder parameters as well as rename parameters. (more…)…
Folding for imports in PhpStorm 6.0
In PhpStorm 6, we've introduced code folding for imports. Any list of imports will now be folded into a single line. This greatly reduced clutter in your editor when having a lot of imports! (more…)…
Drag & Drop Project Files to Remote Hosts in PhpStorm
The Remote Host pane allows us to work directly on a remote server through FTP, FTPS, SFTP or a local/network folder. A lot of people asked us to add drag & drop to the Remote Host pane in PhpStorm. Good news: PhpStorm 6 comes with drag & drop as well as copy & paste support from the pro…