{"id":13823237,"url":"https://github.com/WolframResearch/codeinspector","last_synced_at":"2025-07-08T17:33:01.351Z","repository":{"id":38796832,"uuid":"254171558","full_name":"WolframResearch/codeinspector","owner":"WolframResearch","description":"Find and report problems in Wolfram Language code","archived":false,"fork":false,"pushed_at":"2022-12-19T12:12:30.000Z","size":4127,"stargazers_count":64,"open_issues_count":1,"forks_count":6,"subscribers_count":21,"default_branch":"master","last_synced_at":"2024-08-05T09:11:40.725Z","etag":null,"topics":["codeinspector","codetools","lint","linter","linting","mathematica","static-analysis","wolfram-language","wolfram-mathematica"],"latest_commit_sha":null,"homepage":"","language":"Mathematica","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WolframResearch.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-08T18:42:03.000Z","updated_at":"2024-07-12T06:59:16.000Z","dependencies_parsed_at":"2023-01-29T21:31:19.365Z","dependency_job_id":null,"html_url":"https://github.com/WolframResearch/codeinspector","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WolframResearch%2Fcodeinspector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WolframResearch%2Fcodeinspector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WolframResearch%2Fcodeinspector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WolframResearch%2Fcodeinspector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WolframResearch","download_url":"https://codeload.github.com/WolframResearch/codeinspector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225453279,"owners_count":17476696,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["codeinspector","codetools","lint","linter","linting","mathematica","static-analysis","wolfram-language","wolfram-mathematica"],"created_at":"2024-08-04T09:00:25.677Z","updated_at":"2024-11-20T01:30:21.309Z","avatar_url":"https://github.com/WolframResearch.png","language":"Mathematica","funding_links":[],"categories":["Linters"],"sub_categories":[],"readme":"# CodeInspector\n\nCodeInspector is a package for finding and reporting problems in Wolfram Language code.\nCodeInspector has a large collection of rules that can be used to inspect Wolfram Language source code files and can be customized to your preferences.\n\nIn a stand-alone kernel:\n```\nNeeds[\"CodeInspector`\"]\n\nCodeInspectSummarize[\"If[a,b,b]\"]\n```\n```\nOut[2]= If[a,b,b]\n\n        line 1:  If[a,b,b]\n                      ^ ^  \n                DuplicateClauses Error Both branches are the same.\n```\n\nIn a front end:\\\n![CodeInspectSummarize](docs/summarize.png)\n\n[Static Analysis Tools in the Wolfram Language](https://blog.wolfram.com/2021/04/06/static-analysis-tools-in-the-wolfram-language/)\n\n[\"CodeParser and CodeInspector\" on community.wolfram.com](https://community.wolfram.com/groups/-/m/t/1931315)\n\n[Finding Bugs in the Wolfram Language from WTC 2019: Watch Video (youtube)](https://www.youtube.com/watch?v=jMUVwLglt-c)\n\n[Finding Bugs in the Wolfram Language from WTC 2019: Watch Video (wolfram.com)](https://www.wolfram.com/broadcast/video.php?v=2911)\n\n[Finding Bugs in the Wolfram Language from WTC 2019: Download Presentation](https://files.wolframcdn.com/pub/www.wolfram.com/technology-conference/2019/Thursday/2019BrentonBostickFindingBugsInTheWL.nb)\n\n\n## Setup\n\nCodeInspector depends on [CodeParser paclet](https://github.com/WolframResearch/codeparser) and [CodeFormatter paclet](https://github.com/WolframResearch/codeformatter).\n\nCodeInspector and its dependencies are included in Mathematica 12.2 and above.\n\nFor older versions, install CodeInspector paclet and dependencies from the public paclet server:\n```\nPacletInstall[\"CodeParser\"]\nPacletInstall[\"CodeFormatter\"]\nPacletInstall[\"CodeInspector\"]\n```\n\n[Build and install the CodeInspector paclet locally](HowToBuild.md)\n\n\n## Using CodeInspector\n\nAfter CodeParser and CodeInspector are installed, CodeInspector can be used.\n\nReturn the list of all problems found in a string of code:\n```\nNeeds[\"CodeInspector`\"]\n\nCodeInspect[\"If[a,b,b]\"]\n```\n```\nOut[2]= {DuplicateClauses Error Both branches are the same.}\n```\n\nSummarize the problems found in a source code file:\n\n![Collatz](docs/collatz.png)\n\nThe input to `CodeInspect` and `CodeInspectSummarize` may be a string, a `File`, or a list of bytes.\n\nSee this tutorial in the Wolfram System help browser:\n\n* CodeInspector/tutorial/CodeInspectorTutorial\n\n\n## Troubleshooting\n\nMake sure that the paclets can be found on your system:\n```\nNeeds[\"CodeInspector`\"]\n```\n\nand try a basic example:\n```\nCodeInspect[\"If[a, b, b]\"]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWolframResearch%2Fcodeinspector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FWolframResearch%2Fcodeinspector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWolframResearch%2Fcodeinspector/lists"}