Adding 20 new checks in SymfonyInsight

A few days ago, we released a batch of 20 new checks relative to PHP and Symfony applications in SymfonyInsight. Here is an overview of what they cover:

  1. Removing unused code

Three new rules relative to unused local variables, private members and constructuor parameters now warn you when you declare PHP symbols that can be removed.

Removing unecessary code is a quick way to decrease technical debt as it naturally decreases the difficulty of reading code and understanding what is actually used.

  1. Removing duplicate code

Two new checks now ensure your project doesn't duplicate code, which may be a source of bugs. For example, SymfonyInsight will now warn you if you define two values with the same key in an array or if you declare a constant/property/method twice.

  1. Fixing invalid instanciations

A series of new rules now check class constructors calls in order to check they are valid (number of arguments, references, ...). This check will prevent your project from creating invalid objects and thus prevent bugs.

  1. Improved type checking

Symfonyinsight now betters understanding typing and is able to warn you about misuses of typed variables. For instance, it now warns you if you use a non-iterable variable inside a foreach, if you declare an invalid typehint, if you pass wrong data to a typed method, etc.

  1. Fixing invalid inheritance architecture

Finally, our engine is now able to better alert your regarding problems in your inheritance architecture: if a class implements another class, if an interface extends a class, if a class/interface is used as a trait, etc. It is also now able to better resolve declared symbols in order to check for their existence everywhere in your code.

Get started on https://insight.symfony.com/!

                Sponsor the Symfony project.

http://feedproxy.google.com/~r/symfony/blog/~3/bF8Q3-F1Wfc/adding-20-new-checks-in-symfonyinsight

созданный 4y | 27 нояб. 2020 г., 11:20:06


Войдите, чтобы добавить комментарий

Другие сообщения в этой группе

A Week of Symfony #947 (17-23 February 2025)

This week, development activity focused on new security features. The upcoming Symfony 7.3 version added support for security voters to explain their vote, improved the IsGranted attribute to allow us

23 февр. 2025 г., 10:10:09 | Symfony
SymfonyLive Berlin 2025: Agentic Applications with Symfony

SymfonyLive Berlin 2025, conference held in English, will take place from April 1 to 4! The schedule is being revealed gradually. More details are available here.

We’re thrilled to announce

21 февр. 2025 г., 09:20:12 | Symfony
SymfonyLive Paris 2025 : Postgres pour vos besoins NoSQL

SymfonyLive Paris 2025, conference in French language only, will take place from March 27 to 28! The schedule is currently being revealed as we go along. More details are available here.

Al

20 февр. 2025 г., 10:10:13 | Symfony
SymfonyLive Berlin 2025: Asynchronous PHP

SymfonyLive Berlin 2025, conference held in English, will take place from April 1 to 4! The schedule is being revealed gradually. More details are available here.

We’re thrilled to announce

19 февр. 2025 г., 08:40:05 | Symfony
SymfonyLive Paris 2025 :  Le Composant Symfony Mapper

SymfonyLive Paris 2025, conference in French language only, will take place from March 27 to 28! The schedule is currently being revealed as we go along. More details are available here.

Al

18 февр. 2025 г., 14:10:24 | Symfony
A Week of Symfony #946 (10-16 February 2025)

This week, development activity focused on the upcoming Symfony 7.3 version. We introduced a simpler way to configure DKIM and SMIME options, improved how to work with value objects in the container a

16 февр. 2025 г., 11:10:08 | Symfony
SymfonyLive Berlin 2025: Distributed Transactions in Symfony

SymfonyLive Berlin 2025, conference held in English, will take place from April 1 to 4! The schedule is being revealed gradually. More details are available here.

We’re thrilled to announce

14 февр. 2025 г., 08:10:16 | Symfony