Copy/Paste Detector (CPD) for PHP code.

Related tags

Code Analysis phpcpd
Overview

PHP Copy/Paste Detector (PHPCPD)

phpcpd is a Copy/Paste Detector (CPD) for PHP code.

Installation

This tool is distributed as a PHP Archive (PHAR):

$ wget https://phar.phpunit.de/phpcpd.phar

$ php phpcpd.phar --version

Using Phive is the recommended way for managing the tool dependencies of your project:

$ phive install phpcpd

$ ./tools/phpcpd --version

It is not recommended to use Composer to download and install this tool.

Usage Example

$ php phpcpd.phar --fuzzy wordpress-5.5
phpcpd 6.0.0 by Sebastian Bergmann.

Found 121 clones with 8137 duplicated lines in 69 files:

  - /home/sb/wordpress-5.5/wp-includes/sodium_compat/src/Core/Curve25519/H.php:19-1466 (1447 lines)
    /home/sb/wordpress-5.5/wp-includes/sodium_compat/src/Core32/Curve25519/H.php:19-1466
.
.
.
  - /home/sb/wordpress-5.5/wp-includes/sodium_compat/src/Core32/Curve25519.php:879-889 (10 lines)
    /home/sb/wordpress-5.5/wp-includes/sodium_compat/src/Core32/Curve25519.php:1072-1082

1.82% duplicated lines out of 446676 total lines of code.
Average size of duplication is 67 lines, largest clone has 1447 of lines

Time: 00:02.980, Memory: 318.00 MB
Comments
  • Feature/composer support

    Feature/composer support

    Fixes problem with executable in #53

    To test it out:

    1. Create a new directory and add following composer.json file to it

      {
          "minimum-stability": "dev",
          "require": {
              "sebastian/phpcpd": "dev-feature/composer-support@dev"
          },
          "repositories": [
              {
                  "type": "vcs",
                  "url": "https://github.com/Ocramius/phpcpd.git"
              }
          ]
      }
      
    2. Run following:

      curl -s https://getcomposer.org/installer | php
      php composer.phar install
      
    3. Run the cli tools:

       ./vendor/bin/phpcpd vendor/sebastian/phpcpd/src
      

      should produce

       phpcpd 1.4.0-11-g458de68 by Sebastian Bergmann.
      
       0.00% duplicated lines out of 1597 total lines of code.
      
       Time: 0 seconds, Memory: 2.25Mb
      

    Same works without defining the composer.json file and using the cloned repository instead.

    opened by Ocramius 49
  • Annotation to suppress code checking for several lines / whole File

    Annotation to suppress code checking for several lines / whole File

    Could you add an annotation option to make it possible to disable CPD for:

    • a whole file (@SuppressWarnings(PHPCPD) over class body) -a whole method (@SuppressWarnings(PHPCPD) over method body)
    • several lines of code (@SuppressWarnings(PHPCPD-START) and @SuppressWarnings(PHPCPD-END))
    opened by sneps85 31
  • Add new algorithm: suffixtree

    Add new algorithm: suffixtree

    Full description of algorithm here: https://www.cqse.eu/fileadmin/content/news/publications/2009-do-code-clones-matter.pdf

    Original source available here: https://www.cqse.eu/en/news/blog/conqat-end-of-life/

    Possible to detect Type 3 clones.

    Example run:

    php phpcpd --algorithm suffixtree --min-tokens 25 QuestionTheme.php
    

    Question:

    • I need to add new options, which are not supported by the abstract strategy. How about replacing the input args with a new class, StrategyConfiguration? Needed options are: --edit-distance (int), and --head-equality (int).
    • ~~To be able to analyze more than one file, the input should not be "file" but a list of tokens. Maybe there's a memory saving mechanism in place right now, where only the hashes are saved between analysis? Which works for the Rabin-Karp default algorithm, but maybe not for the new one. Have to double check.~~
    opened by olleharstedt 22
  • [RFR] Add a regexps-exclude option

    [RFR] Add a regexps-exclude option

    This PR adds a new --regexps-exclude option to counter a limitation with other options.

    The --names-exclude option refers only to base name, which forbids to exclude a given path. For instance, if we want to exclude web/app_*.php it will not work. We have to exclude app_*.php through the --names-exclude. But it will also exclude src/app_test.php for instance.

    The --regexps-exclude allows to specify a regexp which will then be inserted into the notPath method of the finder (a PR on finder-facade has been created). This way, we can exclude previous patterns with a command line such:

    phpcpd.phar --regexps-exclude '~web/app_.*\.php~' myProject
    

    This PR can probably helps to fix some issues with the --exclude option, and should be an answer to #84.

    opened by jpetitcolas 19
  • PHP Notice:  Undefined offset: 27498 in /usr/local/lib/php/pear/PHPCPD/TextUI/Command.php on line 260

    PHP Notice: Undefined offset: 27498 in /usr/local/lib/php/pear/PHPCPD/TextUI/Command.php on line 260

    Version 1.3.1; who knows what steps to reproduce.

    In some cases, the phpcpd textui can produce e_notices: PHP Notice: Undefined offset: 27498 in /usr/local/lib/php/pear/PHPCPD/TextUI/Command.php on line 260

    opened by CloCkWeRX 16
  • Is it possible to search for duplicate code on different files in the same project?

    Is it possible to search for duplicate code on different files in the same project?

    Greetings. I am still new to phpcpd, but I think it could really become one of my favorite tools.

    I am trying trying to detect duplicate code on different files, belonging to the same project. I am currently working on old stuff to renew, and I can find lots of cut-paste issues.

    Nevertheless I have the impression that phpcpd allows only to find duplicate code inside each file, not comparing the contents of a file to another different one. Can you confirm this?

    Is there a way to find any possible duplicate code in a project (no problem of memory nor time), examining all existing files, with your tool?

    Thank you for your feedback. Cheers Emanuele

    opened by enanetti 13
  • Add support for nullable type declarations

    Add support for nullable type declarations

    The following functions are detected as copy-pasted but their signatures are different:

    <?php
    
    function foo(?string $foo): ?string
    {
        return $foo;
    }
    
    <?php
    
    function foo(string $foo): string
    {
        return $foo;
    }
    
    enhancement 
    opened by ossinkine 12
  • Can't Install via Composer

    Can't Install via Composer

    First off -- thanks for making this!

    Not sure if anyone else has run into this issue, but can't install via Composer:

    $ composer update
    Loading composer repositories with package information
    Updating dependencies (including require-dev)
    Your requirements could not be resolved to an installable set of packages.
    
      Problem 1
        - Installation request for sebastian/phpcpd * -> satisfiable by sebastian/phpcpd[1.4.1].
        - sebastian/phpcpd 1.4.1 requires sebastian/finder-facade dev-master -> no matching package found.
    

    Looked through #58, but didn't see anything about this.

    opened by vjc 12
  • Feature: hash storage sqlite to reduce memory usage

    Feature: hash storage sqlite to reduce memory usage

    Hi,

    i had some trouble running phpcpd in an environment where memory_limit was not big enough to run phpcpd over a big codebase. So i stored all hashes within a sqlite file to reduce the memory usage.

    With the provided changes it is possible to switch the default storage (internal array) to a temporary sqlite database. Of course this makes the detection slower by using a sqlite database on the filesystem, but you can run phpcpd with a very small memory usage.

    Here are some examples / comparisons running phpcpd on zendframework2 code:

    Running with memory (default) storage (fast but a lot of memory used):

    $ php phpcpd --progress --min-tokens=70 --min-lines=5 vendor/zendframework/
    phpcpd 2.0.1-3-ge862208 by Sebastian Bergmann.
    
    [...]
    
    2.49% duplicated lines out of 303394 total lines of code.
    
    Time: 12.92 seconds, Memory: 177.25Mb
    

    Running with sqlite storage (slower but less memory used):

    $ php phpcpd --progress --min-tokens=70 --min-lines=5 --hash-storage=SQLite vendor/zendframework/
    phpcpd 2.0.1-3-ge862208 by Sebastian Bergmann.
    
    [...]
    
    2.49% duplicated lines out of 303394 total lines of code.
    
    Time: 36.47 seconds, Memory: 16.25Mb
    

    Additionally it is now very easy to add another HashStorageAdapter by providing a class that implements HashStorageInterface.

    Best regards, Matthias

    opened by maglnet 11
  • there is a error when I use phpcpd

    there is a error when I use phpcpd

    phpcpd --log-pmd ./build/logs/phploc.csv ./ phpcpd 1.4.0 by Sebastian Bergmann.

    PHP Fatal error: Class 'Symfony\Component\Finder\Adapter\GnuFindAdapter' not found in /usr/share/pear/Symfony/Component/Finder/Finder.php on line 69 PHP Stack trace: PHP 1. {main}() /usr/bin/phpcpd:0 PHP 2. SebastianBergmann\PHPCPD\TextUI\Command->main() /usr/bin/phpcpd:56 PHP 3. SebastianBergmann\FinderFacade\FinderFacade->findFiles() /usr/share/pear/SebastianBergmann/PHPCPD/TextUI/Command.php:221 PHP 4. Symfony\Component\Finder\Finder->__construct() /usr/share/pear/SebastianBergmann/FinderFacade/FinderFacade.php:93

    I don't know why ? how to fix it , thank you

    opened by terry2010 10
  • Option to exit with a zero code even if any violations are found.

    Option to exit with a zero code even if any violations are found.

    Such option will be useful in a report stage during a CI process. Currently each copy/paste detection will trigger a error exit code. For example such option in phpmd is called --ignore-violations-on-exit.

    opened by pnikolov 9
  • PHP Attributes should be excluded from duplicate detection

    PHP Attributes should be excluded from duplicate detection

    In our projects we use the new PHP attributes for documentation on each controller. Theese are quite a few lines per endpoint.

    As it is totaly fine that two endpoints might have the exact same documentation (for example an create and an update endpoint being called the same way) this should not be detected as a duplicate.

    My suggestion would be to exclude PHP attributes #[...] in general from the detection, like it is already done for comments /** */

    opened by jochen-jung 1
  • Wrong duplication in single file

    Wrong duplication in single file

    Hi Guys,

    I am having a wired duplication on a single file, which I am sure there is no duplication and I can't get that's wrong with it. By removing --fuzzy parameter seems to be working, but I would like to use it. Can you please help?

    • phpcpd 6.03
    • php 7.4.29

    Command:

    phpcpd --fuzzy '/var/www/test/Brand.php'
    

    Expected result:

    No clones found.
    

    Actual result:

    Found 1 clones with 251 duplicated lines in 1 files:
    
      - /var/www/test/Brand.php:31-282 (251 lines)
        /var/www/test/Brand.php:40-291
    
    86.25% duplicated lines out of 291 total lines of code.
    Average size of duplication is 251 lines, largest clone has 251 of lines
    
    Time: 00:00, Memory: 4.00 MB
    

    File Content:

    <?php
    
    namespace CoreBundle\Entity\Company;
    
    use Doctrine\Common\Collections\ArrayCollection;
    use Doctrine\ORM\Mapping as ORM;
    
    use JMS\Serializer\Annotation as JMS;
    use Gedmo\Mapping\Annotation as Gedmo;
    
    /**
     * Class Brand
     *
     * @ORM\Entity(repositoryClass="CoreBundle\Repository\Company\BrandRepository")
     * @ORM\Table(name="brand")
     *
     * @package CoreBundle\Entity\Company
     */
    class Brand
    {
        /* Algolia index name */
        const ALGOLIA_INDEX_NAME = 'BRAND';
    
        /**
         * @var int $id
         *
         * @ORM\Id
         * @ORM\Column(type="integer")
         * @ORM\GeneratedValue(strategy="AUTO")
         */
        protected $id;
    
        /**
         * @var string $name
         *
         * @ORM\Column(name="name", type="string", length=32)
         *
         * @Gedmo\Translatable(fallback=true)
         */
        protected $name;
    
        /**
         * @var string $nameAr
         *
         * @JMS\SerializedName("name_ar")
         * @JMS\Groups({"searchable"})
         */
        protected $nameAr;
    
        /**
         * @var string $slug
         *
         * @ORM\Column(name="slug", type="string")
         *
         * @Gedmo\Slug(fields={"name"}, updatable=false)
         */
        protected $slug;
    
        /**
         * @var bool $enabled
         *
         * @ORM\Column(name="enabled", type="boolean", options={"default":1})
         */
        protected $enabled;
    
        /**
         * @var bool $autoConfirmOrder
         *
         * @ORM\Column(name="auto_confirm_order", type="boolean", options={"default":0})
         */
        protected $autoConfirmOrder;
    
        /**
         * @var bool $cashPaymentAllowed
         *
         * @ORM\Column(name="cash_payment_allowed", type="boolean", options={"default":0})
         */
        protected $cashPaymentAllowed;
    
        /**
         * @var bool $nutritionalEnabled
         *
         * @ORM\Column(name="nutritional_enabled", type="boolean", options={"default":0})
         */
        protected $nutritionalEnabled;
    
        /**
         * @var bool $loyaltyEnabled
         *
         * @ORM\Column(name="loyalty_enabled", type="boolean", options={"default":0})
         */
        protected $loyaltyEnabled;
    
        /**
         * @var int $invoicePrintCopies
         *
         * @ORM\Column(name="invoice_print_copies", type="smallint", options={"default":2})
         */
        protected $invoicePrintCopies;
    
        /**
         * @var bool $aggregate
         *
         * @ORM\Column(name="aggregate", type="boolean", options={"default":0})
         */
        protected $aggregate;
    
        /**
         * @var \DateTime $aggregateDate
         *
         * @ORM\Column(name="aggregate_date", type="date", nullable=true)
         */
        protected $aggregateDate;
    
        /**
         * @var \DateTime $firstOrderDate
         *
         * @ORM\Column(name="first_order_date", type="date", nullable=true)
         */
        protected $firstOrderDate;
    
        /**
         * @var \DateTime $lastOrderDate
         *
         * @ORM\Column(name="last_order_date", type="date", nullable=true)
         */
        protected $lastOrderDate;
    
        /**
         * @var bool $supermarket
         *
         * @ORM\Column(name="supermarket", type="boolean", options={"default":0})
         */
        protected $supermarket;
    
        /**
         * @var MediaEntity $logo
         *
         * @ORM\OneToOne(targetEntity="CoreBundle\Entity\Media", cascade={"persist"})
         * @ORM\JoinColumn(name="logo_media_id", referencedColumnName="id")
         */
        protected $logo;
    
        /**
         * @var string $publicImageUrl
         *
         * @JMS\SerializedName("image_url")
         * @JMS\Groups({"searchable"})
         */
        protected $publicImageUrl;
    
        /**
         * @var MediaEntity $photo
         *
         * @ORM\OneToOne(targetEntity="CoreBundle\Entity\Media", cascade={"persist"})
         * @ORM\JoinColumn(name="photo_media_id", referencedColumnName="id")
         */
        protected $photo;
    
        /**
         * @var MediaEntity $productPhoto
         *
         * @ORM\ManyToOne(targetEntity="CoreBundle\Entity\Media", cascade={"persist"})
         * @ORM\JoinColumn(name="product_photo_media_id", referencedColumnName="id")
         */
        protected $productPhoto;
    
        /**
         * @var \DateTime $closingHour
         *
         * @ORM\Column(name="closing_hour", type="time")
         */
        protected $closingHour;
    
        /**
         * @var bool $vThruTwilioTaskQueue
         *
         * @ORM\Column(name="vthru_twilio_task_queue", type="boolean")
         */
        protected $vThruTwilioTaskQueue;
    
        /**
         * @var string $twilioTaskQueueSid
         *
         * @ORM\Column(name="twilio_task_queue_sid", type="text", nullable=true)
         */
        protected $twilioTaskQueueSid;
    
        /**
         * @var string $compensationEmails
         *
         * @ORM\Column(name="compensation_emails", type="string", nullable=true)
         */
        protected $compensationEmails;
    
        /**
         * @deprecated
         * @var string
         *
         * @ORM\Column(name="gateway_destination_id", type="string", nullable=true)
         */
        protected $gatewayDestinationId;
    
        /**
         * @var FeeEntity $fee
         *
         * @ORM\OneToOne(targetEntity="CoreBundle\Entity\Company\Brand\Fee", inversedBy="brand", cascade={"persist"})
         */
        protected $fee;
    
        /**
         * @var BrandEntity\Financial $financial
         *
         * @ORM\OneToOne(targetEntity="CoreBundle\Entity\Company\Brand\Financial", inversedBy="brand", cascade={"persist"})
         */
        protected $financial;
    
        /**
         * @var LoyaltyEntity $loyalty
         *
         * @ORM\OneToOne(targetEntity="CoreBundle\Entity\Company\Brand\Loyalty", cascade={"persist"})
         * @ORM\JoinColumn(name="loyalty_id", referencedColumnName="id", nullable=true)
         */
        protected $loyalty;
    
        /**
         * @var ArrayCollection $loyalties
         *
         * @ORM\OneToMany(targetEntity="CoreBundle\Entity\Company\Brand\Loyalty", mappedBy="brand", cascade={"persist"})
         */
        protected $loyalties;
    
        /**
         * @var CompanyEntity $company
         *
         * @ORM\ManyToOne(targetEntity="CoreBundle\Entity\Company", inversedBy="brands")
         * @ORM\JoinColumn(name="company_id", referencedColumnName="id")
         */
        protected $company;
    
        /**
         * @var ArrayCollection $stores
         *
         * @ORM\OneToMany(targetEntity="CoreBundle\Entity\Company\Brand\Store", mappedBy="brand")
         */
        protected $stores;
    
        /**
         * @var ArrayCollection $products
         *
         * @ORM\OneToMany(targetEntity="CoreBundle\Entity\Product", mappedBy="brand")
         */
        protected $products;
    
        /**
         * @var ArrayCollection $categories
         *
         * @ORM\OneToMany(targetEntity="CoreBundle\Entity\Product\Category", mappedBy="brand")
         */
        protected $categories;
    
        /**
         * @var ArrayCollection $tags
         *
         * @ORM\ManyToMany(targetEntity="CoreBundle\Entity\Company\Brand\Tag", mappedBy="brands")
         */
        protected $tags;
    
        /**
         * @var WebsiteEntity $website
         *
         * @ORM\OneToOne(targetEntity="CoreBundle\Entity\Company\Brand\Website", inversedBy="brand", cascade={"persist"})
         */
        protected $website;
    
        /**
         * @var IntegrationEntity $integration
         *
         * @ORM\OneToOne(targetEntity="IntegrationBundle\Entity\Integration")
         * @ORM\JoinColumn(name="integration_id", referencedColumnName="id")
         */
        protected $integration;
    
        /**
         * @deprecated
         * @var string $tapDestResponse
         *
         * @ORM\Column(name="tap_dest_response", type="text", nullable=true)
         */
        protected $tapDestResponse;
    }
    
    
    opened by elmoby 0
  • Exclude option not working properly

    Exclude option not working properly

    With version 6 the "--exclude" option is no longer working as expected:

    Command: bin/phpcpd --exclude TCA --fuzzy packages

    This should ignore every file which has "TCA" in its path. With version 5.0 this works great and I only get outputs from files without "TCA" in it's path. Using 6.0 it will also lead to messages about files in a folder called "TCA".

    Output with 5.0.2:

    bin/phpcpd --exclude TCA --fuzzy packages
    phpcpd 5.0.2 by Sebastian Bergmann.
    Found 2 clones with 79 duplicated lines in 4 files:
      - /my-project-path/packages/mypackage/Classes/Domain/Model/Entity.php:248-302 (54 lines)
        /my-project-path/packages/mypackage/Classes/Domain/Model/AnotherEntity.php:140-194
      - /my-project-path/packages/mypackage/Classes/Controller/ExampleController.php:102-127 (25 lines)
        /my-project-path/packages/mypackage/Classes/Controller/AnotherExampleController.php:77-102
    1.56% duplicated lines out of 5049 total lines of code.
    Average size of duplication is 39 lines, largest clone has 54 of lines
    Time: 00:00.051, Memory: 6.00 MB
    

    Output with 6.0.2 (also tested 6.0.3):

    bin/phpcpd --exclude TCA --fuzzy packages
    phpcpd 6.0.2 by Sebastian Bergmann.
    Found 7 clones with 655 duplicated lines in 14 files:
      - /my-project-path/packages/mypackage/Configuration/TCA/some_php.php:10-93 (83 lines)
        /my-project-path/packages/mypackage/Configuration/TCA/some_more_php.php:10-93
      - /my-project-path/packages/mypackage/Configuration/TCA/even_more_php.php:26-105 (79 lines)
        [...]
      - /my-project-path/packages/mypackage/Classes/Domain/Model/Entity.php:248-302 (54 lines)
        /my-project-path/packages/mypackage/Classes/Domain/Model/AnotherEntity.php:140-194
      - /my-project-path/packages/mypackage/Configuration/TCA/some_php2.php:26-69 (43 lines)
        /my-project-path/packages/mypackage/Configuration/TCA/some_more_php2.php:26-69
        /my-project-path/packages/mypackage/Configuration/TCA/even_more_php2.php:26-69
      - /my-project-path/packages/mypackage/Classes/Controller/ExampleController.php:102-127 (25 lines)
        /my-project-path/packages/mypackage/Classes/Controller/AnotherExampleController.php:77-102
    7.90% duplicated lines out of 8288 total lines of code.
    Average size of duplication is 93 lines, largest clone has 83 of lines
    Time: 00:00.023, Memory: 6.00 MB
    

    Hope this description helps a bit.

    Thanks and have a nice day! Alex

    opened by schmitzal 1
  • Add whitelist option

    Add whitelist option

    Hi folks! Using phpcpd in a large project with many cp's found, a whitelist parameter would be helpful.

    I would like to use it like this to only output the c+p from modified files compared to origin/master: phpcpd src --whitelist $(git diff origin/master -G. --diff-filter=AM --name-only | grep src/ | paste -sd "," -)

    This way I can utilize my CI to make sure that new commits never contain C+P code, even though some old code may have c+p parts... at least until someone makes a change in some of the old files, then they have to fix that anyway, which is fine for me.

    I tried using phpcpd --whitelist $(git diff origin/master -G. --diff-filter=AM --name-only | grep src/ | paste -sd " " -) but that only executes phpcpd on the changed files, therefore the files that contain the copied source will most certainly never be in the changelist and there will never be any issues reported by phpcpd.

    A whitelist would work just like phpcpd src with the tiny difference, that the issues found are filtered and only respected when one of the files matches the whitelisted files.

    I hope I managed to write that down somewhat understandable.

    opened by siemendev 0
Owner
Sebastian Bergmann
Sebastian Bergmann is the creator of PHPUnit. He co-founded thePHP.cc and helps PHP teams build better software.
Sebastian Bergmann
A full-scale PHP 5.3.2+ sandbox class that utilizes PHPParser to prevent sandboxed code from running unsafe code.

##DEPRECATED: The PHPSandbox project has transfered to Corveda/PHPSandbox and will be actively maintained there. This branch is no longer being active

Elijah Horton 219 Sep 2, 2022
Library for counting the lines of code in PHP source code

sebastian/lines-of-code Library for counting the lines of code in PHP source code. Installation You can add this library as a local, per-project depen

Sebastian Bergmann 715 Jan 5, 2023
Provides functionality that helps writing PHP code that has runtime-specific (PHP / HHVM) execution paths

sebastian/environment This component provides functionality that helps writing PHP code that has runtime-specific (PHP / HHVM) execution paths. Instal

Sebastian Bergmann 6.5k Jan 3, 2023
Search PHP source code for function & method calls, variables, and more from PHP.

Searching PHP source code made easy Search PHP source code for function & method calls, variable assignments, classes and more directly from PHP. Inst

Permafrost Software 22 Nov 24, 2022
PHP Static Analysis Tool - discover bugs in your code without running it!

PHPStan - PHP Static Analysis Tool PHPStan focuses on finding errors in your code without actually running it. It catches whole classes of bugs even b

PHPStan 11.6k Dec 30, 2022
A PHP code-quality tool

GrumPHP Sick and tired of defending code quality over and over again? GrumPHP will do it for you! This composer plugin will register some git hooks in

PHPro 3.9k Jan 1, 2023
Analyze PHP code with one command

PHPQA Analyze PHP code with one command. Requirements PHP >= 5.4.0 xsl extension for HTML reports Why? Every analyzer has different arguments and opti

edgedesign/phpqa 542 Dec 24, 2022
Performs advanced static analysis on PHP code

PHP Analyzer Please report bugs or feature requests via our website support system ? in bottom right or by emailing [email protected]. Contri

Continuous Inspection 443 Sep 23, 2022
A static php code analysis tool using the Graph Theory

Mondrian Ok guyz, you have a master degree in Graph Theory, you follow Law of Demeter and you live on S.O.L.I.D principles ? Let's have some Fun ! (^ω

Florent Genette 391 Nov 30, 2022
Instant Upgrades and Instant Refactoring of any PHP 5.3+ code

Rector - Speedup Your PHP Development Rector helps you with 2 areas - major code changes and in daily work. Do you have a legacy code base? Do you wan

RectorPHP 6.5k Jan 8, 2023
Deptrac is a static code analysis tool for PHP that helps you communicate, visualize and enforce architectural decisions in your projects

Deptrac is a static code analysis tool for PHP that helps you communicate, visualize and enforce architectural decisions in your projects. You can freely define your architectural layers over classes and which rules should apply to them.

QOSSMIC GmbH 2.2k Dec 30, 2022
phpcs-security-audit is a set of PHP_CodeSniffer rules that finds vulnerabilities and weaknesses related to security in PHP code

phpcs-security-audit v3 About phpcs-security-audit is a set of PHP_CodeSniffer rules that finds vulnerabilities and weaknesses related to security in

Floe design + technologies 655 Jan 3, 2023
A tool to automatically fix PHP Coding Standards issues by Dragon Code.

A tool to automatically fix PHP Coding Standards issues by Dragon Code.

The Dragon Code 24 Aug 27, 2022
PHP code scanner to use with gettext/gettext

PHP code scanner to use with gettext/gettext

Gettext 12 Nov 11, 2022
Code Climate CLI

Code Climate CLI Overview codeclimate is a command line interface for the Code Climate analysis platform. It allows you to run Code Climate engines on

Code Climate 2.4k Dec 26, 2022
Static code analysis to find violations in a dependency graph

PhpDependencyAnalysis PhpDependencyAnalysis is an extendable static code analysis for object-oriented PHP-Projects to generate dependency graphs from

Marco Muths 546 Dec 7, 2022
Automagically generate UML diagrams of your Laravel code.

Laravel UML Diagram Generator Automagically generate UML diagrams of your Laravel code. Installation To install LTU via composer, run the command: com

Andy Abi Haidar 93 Jan 1, 2023
The Stopwatch component provides a way to profile code.

Stopwatch Component The Stopwatch component provides a way to profile code.

Symfony 2.6k Dec 28, 2022
Feel free to create new file, don't hesitate to pull your code, the most important thing is that the file name here must match your nickname so that file does not conflict with other people.

PHP-Projects hacktoberfest Contributing Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to cha

Firmansyah Helmi Kurniawan 43 Nov 28, 2022