{"id":36702772,"url":"https://github.com/walkmod/walkmod-dead-code-cleaner-plugin","last_synced_at":"2026-01-12T11:39:48.857Z","repository":{"id":28404261,"uuid":"31918639","full_name":"walkmod/walkmod-dead-code-cleaner-plugin","owner":"walkmod","description":"Walkmod plugin to remove unused variables, methods and fields","archived":false,"fork":false,"pushed_at":"2018-10-26T03:08:22.000Z","size":43,"stargazers_count":2,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-28T17:34:00.220Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"SudoZhange/ProcessInjection","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/walkmod.png","metadata":{"files":{"readme":"README.asciidoc","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-09T19:38:58.000Z","updated_at":"2020-01-09T05:20:36.000Z","dependencies_parsed_at":"2022-09-06T23:31:15.168Z","dependency_job_id":null,"html_url":"https://github.com/walkmod/walkmod-dead-code-cleaner-plugin","commit_stats":null,"previous_names":["rpau/walkmod-clean-dead-code-plugin"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/walkmod/walkmod-dead-code-cleaner-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walkmod%2Fwalkmod-dead-code-cleaner-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walkmod%2Fwalkmod-dead-code-cleaner-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walkmod%2Fwalkmod-dead-code-cleaner-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walkmod%2Fwalkmod-dead-code-cleaner-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/walkmod","download_url":"https://codeload.github.com/walkmod/walkmod-dead-code-cleaner-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walkmod%2Fwalkmod-dead-code-cleaner-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28338972,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T10:58:46.209Z","status":"ssl_error","status_checked_at":"2026-01-12T10:58:42.742Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":"2026-01-12T11:39:48.202Z","updated_at":"2026-01-12T11:39:48.847Z","avatar_url":"https://github.com/walkmod.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"walkmod-dead-code-cleaner-plugin\n================================\nRaquel Pau \u003craquelpau@gmail.com\u003e\n\nimage:https://travis-ci.org/walkmod/walkmod-dead-code-cleaner-plugin.svg?branch=master[\"Build Status\", link=\"https://travis-ci.org/walkmod/walkmod-dead-code-cleaner-plugin\"]\n\nThis is a walkmod plugin to remove unused declarations (imports, variables and private fields, methods and types) in Java source files. \nIt applies the clean procedure in cascade. For example, if a unused method uses some types that are just used in this method, the imports \nrelated to these types are also removed.\n\n== Example\nLet's see an example. Take a look to this code. There is a private method called `hello` that is never referenced and \nalso a variable in the `goodBye` method that also is never used. \n\n```java\npackage example;\n\nimport java.util.*;\n\npublic class Foo{\n  private void hello(File file){\n    ...\n  }\n  public void goodBye(){\n    String s=\"bye\";\n    System.out.println(\"bye\");\n  }\n}\n```\n\nWhat this plugins generates is the following modified code:\n```java\npackage example;\n\npublic class Foo{\n  public void goodBye(){\n    System.out.println(\"bye\");\n  }\n}\n```\n\n== Usage\n\nCheck that your walkmod version is at least 2.0.\n\n. Add the https://github.com/rpau/walkmod-maven-plugin[walkmod-maven-plugin] into your `walkmod.xml` as a configuration provider. \nThis plugin will interpret your classpath accoding your `pom.xml` and will build your project to make the application \nclasspath available for walkmod.\n\n. Add the transformation `dead-code-cleaner` into your  `walkmod.xml`.\n\n```XML\n\u003c!DOCTYPE walkmod PUBLIC \"-//WALKMOD//DTD\" \"http://www.walkmod.com/dtd/walkmod-1.1.dtd\"\u003e\n\u003cwalkmod\u003e\n    \u003cconf-providers\u003e\n        \u003cconf-provider type=\"maven\"/\u003e\n    \u003c/conf-providers\u003e\n    \u003cchain name=\"default\"\u003e\n        \u003ctransformation type=\"dead-code-cleaner\"/\u003e\n    \u003c/chain\u003e\n\u003c/walkmod\u003e\n```\n\nYou can apply walkmod-dead-code-cleaner-plugin via walkmod. \n\n  $ walkmod apply\n\nOr, you can also check which would be the modified classes typing:\n\n  $ walkmod check\n  \nOptionally, the plugin allows to select which elements are candidates to remove: private types, private methods, \nprivate fields, variables or imports:\n\n```XML\n\t \u003ctransformation type=\"dead-code-cleaner\"\u003e\n\t \t\u003cparam name=\"removeUnusedImports\"\u003etrue\u003c/param\u003e\n\t \t\u003cparam name=\"removeUnusedVariables\"\u003etrue\u003c/param\u003e\n\t \t\u003cparam name=\"removeUnusedClasses\"\u003etrue\u003c/param\u003e\n\t \t\u003cparam name=\"removeUnusedInterfaces\"\u003etrue\u003c/param\u003e\n\t \t\u003cparam name=\"removeUnusedAnnotationTypes\"\u003etrue\u003c/param\u003e\n\t \t\u003cparam name=\"removeUnusedEnumerations\"\u003etrue\u003c/param\u003e\n\t \t\u003cparam name=\"removeUnusedMethods\"\u003etrue\u003c/param\u003e\n\t \t\u003cparam name=\"removeUnusedFields\"\u003etrue\u003c/param\u003e\n\t \u003c/transformation\u003e\n```\n\n\n== Contributing\n\nIf you want to hack on this, fork it, improve it and send me a pull request.\n\nTo get started using it, just clone it and call mvn install. \n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwalkmod%2Fwalkmod-dead-code-cleaner-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwalkmod%2Fwalkmod-dead-code-cleaner-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwalkmod%2Fwalkmod-dead-code-cleaner-plugin/lists"}