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

Établi 4y | 27 nov. 2020 à 11:20:06


Connectez-vous pour ajouter un commentaire

Autres messages de ce groupe

SymfonyOnline January 2025: Join us in 2 weeks!

Get ready for the exciting SymfonyOnline January 2025, kicking off shortly on January 16-17! There’s still time to register and join the international online Symfony conference—along with pre-

2 janv. 2025 à 12:50:08 | Symfony
Symfony 6.4.17 released

Symfony 6.4.17 has just been released. Here is the list of the most important changes since 6.4.16:

bug #59304 [PropertyInfo] Remove @internal from PropertyReadInfo and PropertyWriteInfo (Dario G
31 déc. 2024 à 16:50:11 | Symfony
Symfony 7.1.10 released

Symfony 7.1.10 has just been released. Here is the list of the most important changes since 7.1.9:

bug #59304 [PropertyInfo] Remove @internal from PropertyReadInfo and PropertyWriteInfo (Dario Gu
31 déc. 2024 à 16:50:10 | Symfony
Symfony 7.2.2 released

Symfony 7.2.2 has just been released. Here is the list of the most important changes since 7.2.1:

bug #59304 [PropertyInfo] Remove @internal from PropertyReadInfo and PropertyWriteInfo (Dario Gua
31 déc. 2024 à 16:50:10 | Symfony
A Week of Symfony #939 (23-29 December 2024)

This week, we launched the new Twig playground, a tool that lets you test and experiment with Twig features in a safe, sandboxed environment. While Symfony development activity was lighter than usual

29 déc. 2024 à 11:30:09 | Symfony
Introducing the new Twig Playground

I'm very excited to announce the launch of Twig Playground, a new tool that allows you to test and experiment with Twig templates in a sandbox environment. It is entirely web-based, with no backend.

26 déc. 2024 à 16:20:14 | Symfony
A Week of Symfony #938 (16-22 December 2024)

This week, Symfony development activity focused on fixing bugs in maintenance versions and adding new features for the upcoming Symfony 7.3 release. Meanwhile, we published blog posts about the new Tw

22 déc. 2024 à 10:20:10 | Symfony