{"id":27948434,"url":"https://github.com/systemsdk/phpcpd","last_synced_at":"2026-03-07T06:02:31.012Z","repository":{"id":216847821,"uuid":"741021244","full_name":"systemsdk/phpcpd","owner":"systemsdk","description":"Copy/Paste Detector (CPD) for PHP code.","archived":false,"fork":false,"pushed_at":"2026-02-16T21:02:00.000Z","size":88350,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-02-17T02:59:28.717Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"sebastianbergmann/phpcpd","license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/systemsdk.png","metadata":{"files":{"readme":"readme.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"custom":["https://secure.wayforpay.com/button/b0b1af16db515"]}},"created_at":"2024-01-09T14:37:50.000Z","updated_at":"2026-02-16T20:56:23.000Z","dependencies_parsed_at":"2025-05-07T15:08:36.520Z","dependency_job_id":null,"html_url":"https://github.com/systemsdk/phpcpd","commit_stats":null,"previous_names":["systemsdk/phpcpd"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/systemsdk/phpcpd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemsdk%2Fphpcpd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemsdk%2Fphpcpd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemsdk%2Fphpcpd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemsdk%2Fphpcpd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/systemsdk","download_url":"https://codeload.github.com/systemsdk/phpcpd/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemsdk%2Fphpcpd/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30208801,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T05:23:27.321Z","status":"ssl_error","status_checked_at":"2026-03-07T05:00:17.256Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-07T14:58:32.442Z","updated_at":"2026-03-07T06:02:30.986Z","avatar_url":"https://github.com/systemsdk.png","language":"PHP","funding_links":["https://secure.wayforpay.com/button/b0b1af16db515"],"categories":[],"sub_categories":[],"readme":"# PHP Copy/Paste Detector\n`phpcpd` is a Copy/Paste Detector (CPD) for PHP code.\n\nThis is modified version of [sebastianbergmann/phpcpd](https://github.com/sebastianbergmann/phpcpd) due to `sebastianbergmann/phpcpd` is abandoned and no longer maintained.\n\n[![PHP Copy/Paste Detector](https://github.com/systemsdk/phpcpd/actions/workflows/ci.yml/badge.svg)](https://github.com/systemsdk/phpcpd/actions/workflows/ci.yml)\n[![Coverage Status](https://coveralls.io/repos/github/systemsdk/phpcpd/badge.svg)](https://coveralls.io/github/systemsdk/phpcpd)\n[![MIT licensed](https://img.shields.io/badge/license-BSD-blue.svg)](LICENSE)\n\n[Source code](https://github.com/systemsdk/phpcpd.git)\n\n## Requirements\n* PHP version 8.3 or later\n\n## Installation\n### Using composer\nIf you have installed composer, you can use the next cmd command:\n```bash\ncomposer require systemsdk/phpcpd --dev\n```\n\n### Manual installation\nIf you are not using composer, you have a possibility to download this tool.\n\nDownload the latest version [here](releases/) and put phar archive into your project.\n\nNote: This tool is distributed as a [PHP Archive (PHAR)](https://php.net/phar).\n\n## Usage example\n```\n$ php ./vendor/bin/phpcpd --fuzzy --verbose src tests\nCopy/Paste Detector 8.3.0\n14/14 [==============================\u003e] 100% Loading \u0026 Processing\nFound 1 code clones with 17 duplicated lines in 1 files:\n\n  - /var/www/html/tests/Application/ApiKey/Transport/Controller/Api/v1/ApiKeyControllerTest.php:128-145 (17 lines)\n    /var/www/html/tests/Application/ApiKey/Transport/Controller/Api/v1/ApiKeyControllerTest.php:153-170\n\n    public function testThatFindOneActionForRootUserReturnsSuccessResponse(): void\n    {\n        $client = $this-\u003egetTestClient('john-root', 'password-root');\n\n        $resource = static::getContainer()-\u003eget(ApiKeyResource::class);\n        $apiKeyEntity = $resource-\u003efindOneBy([\n            'description' =\u003e 'ApiKey Description: api',\n        ]);\n        self::assertInstanceOf(ApiKey::class, $apiKeyEntity);\n\n        $client-\u003erequest('GET', static::$baseUrl . '/' . $apiKeyEntity-\u003egetId());\n        $response = $client-\u003egetResponse();\n        $content = $response-\u003egetContent();\n        self::assertNotFalse($content);\n        self::assertSame(Response::HTTP_OK, $response-\u003egetStatusCode(), \"Response:\\n\" . $response);\n        $responseData = JSON::decode($content, true);\n        $this-\u003echeckBasicFieldsInResponse($responseData);\n\n0.05% duplicated lines out of 31339 total lines of code.\nAverage code clone size is 17 lines, the largest code clone has 17 lines\n\nTime: 00:00.100, Memory: 10.00 MB\n```\n\nNote: If you are not using composer and have manual installation, you can use:\n```\nphp phpcpd.phar --fuzzy --verbose src tests\n```\n\n## Html report\nYou are able to generate html report, but you need to have installed [Xalan](https://xalan.apache.org) tool locally or inside your Docker container.\n\nPlease find more details how to generate/use it [here](https://github.com/systemsdk/phpcpd/blob/master/docs/report.md).\n\n## Requirements for the support team\n* Docker Engine version 23.0 or later\n* Docker Compose version 2.0 or later\n* An editor or IDE\n\nNote: OS recommendation - Linux Ubuntu based.\n\n## Components for the support team\n1. PHP 8.5 fpm\n2. Composer 2\n3. Phive 0.16\n4. Phing 3.1\n5. Xalan 1.12\n\n## Setting up Docker and docker compose for the support team\nFor installing Docker Engine with docker compose please follow steps mentioned on page [Docker Engine](https://docs.docker.com/engine/install/).\n\nNote 1: Please run next cmd after above step if you are using Linux OS: `sudo usermod -aG docker $USER`\n\nNote 2: If you are using Docker Desktop for MacOS 12.2 or later - please enable [virtiofs](https://www.docker.com/blog/speed-boost-achievement-unlocked-on-docker-desktop-4-6-for-mac/) for performance (enabled by default since Docker Desktop v4.22).\n\n## Setting up DEV environment for the support team\n1.Clone this repository from GitHub.\n\n2.Edit and set `XDEBUG_CONFIG=` inside `.env` file (optional, by default `XDEBUG_CONFIG=main`).\n\n3.Configure `/docker/dev/xdebug-main.ini` (Linux/Windows) or `/docker/dev/xdebug-osx.ini` (MacOS) (optional).\n\n4.Build, start and install the docker images from your terminal:\n```bash\nmake build-dev\nmake start\nmake setup\n```\n\n## Getting shell to container for the support team\nAfter application will start (`make start`) and in order to get shell access inside php container you can run the following command:\n```bash\nmake ssh\n```\nNote: Please use `exit` command in order to return from container's shell to local shell.\n\n## Building container\nIn case you edited Dockerfile or other environment configuration, you'll need to build container again using next commands:\n```bash\nmake down\nmake build-dev\nmake start\n```\n\n## Start and stop environment containers for the support team\nPlease use next make commands in order to start and stop environment:\n```bash\nmake start\nmake stop\n```\n\n## Stop and remove environment containers, networks for the support team\nPlease use next make commands in order to stop and remove environment containers, networks:\n```bash\nmake down\n```\n\n## Additional main command available for the support team\n```bash\nmake build-dev\n\nmake start\n\nmake stop\n\nmake down\n\nmake restart\n\nmake ssh\nmake ssh-root\n\nmake setup\n\nmake update\n\nmake composer-audit\n\nmake info\nmake help\n\nmake phar\nmake signed-phar\n\nmake phpunit\nmake phpcs\nmake ecs\nmake ecs-fix\nmake phpstan\n\nmake phpcpd-run\nmake phpcpd-html-report\n\nmake logs\n\netc....\n```\nNotes: Please see more commands in Makefile\n\n## Architecture \u0026 packages\n* [cli-parser](https://packagist.org/packages/sebastian/cli-parser)\n* [version](https://packagist.org/packages/sebastian/version)\n* [php-file-iterator](https://packagist.org/packages/phpunit/php-file-iterator)\n* [php-timer](https://packagist.org/packages/phpunit/php-timer)\n* [phpunit](https://packagist.org/packages/phpunit/phpunit)\n* [composer-bin-plugin](https://packagist.org/packages/bamarni/composer-bin-plugin)\n* [security-advisories](https://packagist.org/packages/roave/security-advisories)\n* [easy-coding-standard](https://packagist.org/packages/symplify/easy-coding-standard)\n* [phpstan](https://packagist.org/packages/phpstan/phpstan)\n* [php-coveralls](https://github.com/php-coveralls/php-coveralls)\n\n## Guidelines for the support team\n* [Report](https://github.com/systemsdk/phpcpd/blob/master/docs/report.md)\n* [Schema](https://github.com/systemsdk/phpcpd/blob/master/docs/schema.md)\n* [Phive](https://github.com/phar-io/phive)\n* [Phing](https://www.phing.info)\n* [Xalan](https://xalan.apache.org)\n\n## Working on the project for the support team\n1. For new feature development, fork `develop` branch into a new branch with one of the two patterns:\n    * `feature/{ticketNo}`\n2. Commit often and write descriptive commit messages, so it's easier to follow steps taken when reviewing.\n3. Push this branch to the repo and create pull request into `develop` to get feedback, with the format `feature/{ticketNo}` - \"Short descriptive title of Jira task\".\n4. Iterate as needed.\n5. Make sure that \"All checks have passed\" on CircleCI(or another one in case you are not using CircleCI) and status is green.\n6. When PR is approved, it will be squashed \u0026 merged, into `develop` and later merged into `release/{No}` for deployment.\n\nNote: You can find git flow detail example [here](https://danielkummer.github.io/git-flow-cheatsheet).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsystemsdk%2Fphpcpd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsystemsdk%2Fphpcpd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsystemsdk%2Fphpcpd/lists"}