{"id":19359904,"url":"https://github.com/codacy/codacy-duplication-example-tool","last_synced_at":"2026-04-19T03:01:53.098Z","repository":{"id":44574145,"uuid":"226894308","full_name":"codacy/codacy-duplication-example-tool","owner":"codacy","description":"Docker engine example for a codacy duplication tool","archived":false,"fork":false,"pushed_at":"2026-03-25T12:40:32.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":11,"default_branch":"master","last_synced_at":"2026-03-26T14:03:17.241Z","etag":null,"topics":["codacy","docker","duplication","engine","example","tool"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codacy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2019-12-09T14:43:42.000Z","updated_at":"2026-03-25T11:44:45.000Z","dependencies_parsed_at":"2022-09-11T19:10:37.145Z","dependency_job_id":null,"html_url":"https://github.com/codacy/codacy-duplication-example-tool","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/codacy/codacy-duplication-example-tool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codacy%2Fcodacy-duplication-example-tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codacy%2Fcodacy-duplication-example-tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codacy%2Fcodacy-duplication-example-tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codacy%2Fcodacy-duplication-example-tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codacy","download_url":"https://codeload.github.com/codacy/codacy-duplication-example-tool/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codacy%2Fcodacy-duplication-example-tool/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31992822,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["codacy","docker","duplication","engine","example","tool"],"created_at":"2024-11-10T07:16:29.320Z","updated_at":"2026-04-19T03:01:53.067Z","avatar_url":"https://github.com/codacy.png","language":"Shell","readme":"# Codacy Example Duplication Tool\n\nDocker engine example for a codacy duplication tool\n\n## Documentation\n\n### How to integrate an external metrics tool on Codacy\n\nBy creating a docker and writing code to handle the tool invocation and output,\nyou can integrate the tool of your choice on Codacy!\n\n\u003e To know more about dockers, and how to write a docker file please refer to\n\u003e [https://docs.docker.com/reference/builder/](https://docs.docker.com/reference/builder/)\n\nIn this tutorial, we explain how you can integrate a metrics tool of your choice\nin Codacy. You can check the code of an already implemented tool and if you wish\nfork it to start your own. You are free to modify and use it for your own tools.\n\n### Structure\n\n* To run the tool we provide the configuration file, `/.codacyrc`, with the\n  language to run and optional parameters your tool might need.\n* The files to analyse are located in `/src`, meaning that when provided in the\n  configuration, the paths are relative to `/src`.\n\n#### Structure of `.codacyrc` file\n\n* **language:** Language to run the tool\n* **params:** Object with key/value parameters\n\n```json\n{\n    \"language\": \"Scala\",\n    \"params\": {\n      \"maxTokens\": 5\n    }\n}\n```\n\n##### General tool behavior\n\n**Exit codes**:\n\n* The exit codes can be different, depending if the tool invocation is\n  successful or not:\n  * **0**: The tool executed successfully :tada:\n  * **1**: An unknown error occurred while running the tool :cold_sweat:\n  * **2**: Execution timeout :alarm_clock:\n\n**Environment variables**:\n\n* To run the tool in debug mode, so you can have more detailed logs, you need to\n  set the environment variable `DEBUG` to `true` when invoking the docker.\n* To configure a different timeout for the tool, you have to set the environment\n  variable `TIMEOUT` when invoking the docker, setting it with values like\n  `10 seconds`, `30 minutes` or `2 hours`.\n\n#### Output\n\nYou are free to write this code in the language you want. After you have your\nresults from the tool, you should print them to the standard output in our\n**Result** format, one result per line.\n\n```json\n{\n  \"cloneLines\": \"case class Foo(bar: Int)\",\n  \"nrTokens\": 2,\n  \"nrLines\": 1,\n  \"files\": [\n    { \"filePath\": \"path/to/my/file1.scala\", \"startLine\": 1, \"endLine\": 2 },\n    { \"filePath\": \"path/to/my/file2.scala\", \"startLine\": 5, \"endLine\": 6 }\n  ]\n}\n```\n\n\u003e The filename should not include the prefix `/src/`, the absolute path\n\u003e `/src/folder/file.js` should be returned as `folder/file.js`.\n\n#### Submit the Docker\n\n**Running the docker**:\n\n```bash\ndocker run -t \\\n--net=none \\\n--privileged=false \\\n--cap-drop=ALL \\\n--user=docker \\\n--rm=true \\\n-v \u003cPATH-TO-FOLDER-WITH-FILES-TO-CHECK\u003e:/src:ro \\\n-v \u003cPATH-TO-CODACYRC\u003e:/.codacyrc:ro \\\n\u003cYOUR-DOCKER-NAME\u003e:\u003cYOUR-DOCKER-VERSION\u003e\n```\n\n**Docker restrictions**:\n\n* Docker image size should not exceed 500MB\n* Docker should contain a non-root user named docker with UID/GID 2004\n* All the source code of the docker must be public\n* The docker base must officially be supported on DockerHub\n* Your docker must be provided in a repository through a public git host (ex:\n  GitHub, Bitbucket, ...)\n\n**Docker submission**:\n\n* To submit the docker you should send an email to support@codacy.com with the\n  link to the git repository with your docker definition.\n* The docker will then be subjected to a review by our team and we will then\n  contact you with more details.\n\n#### Test\n\nFollow the instructions at\n[codacy-plugins-test](https://github.com/codacy/codacy-plugins-test/blob/master/README.md#test-definition).\n\nIf you have any question or suggestion regarding this guide please contact us at\nsupport@codacy.com.\n\n## What is Codacy\n\n[Codacy](https://www.codacy.com/) is an Automated Code Review Tool that monitors\nyour technical debt, helps you improve your code quality, teaches best practices\nto your developers, and helps you save time in Code Reviews.\n\n### Among Codacy’s features\n\n* Identify new Static Analysis issues\n* Commit and Pull Request Analysis with GitHub, BitBucket/Stash, GitLab (and\n  also direct git repositories)\n* Auto-comments on Commits and Pull Requests\n* Integrations with Slack, HipChat, Jira, YouTrack\n* Track issues in Code Style, Security, Error Proneness, Performance, Unused\n  Code and other categories\n\nCodacy also helps keep track of Code Coverage, Code Duplication, and Code\nComplexity.\n\nCodacy supports PHP, Python, Ruby, Java, JavaScript, and Scala, among others.\n\n### Free for Open Source\n\nCodacy is free for Open Source projects.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodacy%2Fcodacy-duplication-example-tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodacy%2Fcodacy-duplication-example-tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodacy%2Fcodacy-duplication-example-tool/lists"}