{"id":18676170,"url":"https://github.com/foospidy/grepbugs","last_synced_at":"2025-04-12T02:12:11.930Z","repository":{"id":18567694,"uuid":"21770115","full_name":"foospidy/GrepBugs","owner":"foospidy","description":"A regex based source code scanner.","archived":false,"fork":false,"pushed_at":"2017-04-08T14:40:58.000Z","size":1682,"stargazers_count":129,"open_issues_count":3,"forks_count":27,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-12T02:12:04.201Z","etag":null,"topics":["cloc","grep","python","regex","scanner","static-analyzer","static-code-analysis"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/foospidy.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":null,"security":null,"support":null}},"created_at":"2014-07-12T15:32:50.000Z","updated_at":"2024-12-17T00:50:39.000Z","dependencies_parsed_at":"2022-08-05T00:15:22.670Z","dependency_job_id":null,"html_url":"https://github.com/foospidy/GrepBugs","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foospidy%2FGrepBugs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foospidy%2FGrepBugs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foospidy%2FGrepBugs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foospidy%2FGrepBugs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/foospidy","download_url":"https://codeload.github.com/foospidy/GrepBugs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248505926,"owners_count":21115354,"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":["cloc","grep","python","regex","scanner","static-analyzer","static-code-analysis"],"created_at":"2024-11-07T09:27:59.412Z","updated_at":"2025-04-12T02:12:11.906Z","avatar_url":"https://github.com/foospidy.png","language":"Python","readme":"GrepBugs\n========\n\nA regex based source code scanner.\n\n## Usage\n```\npython grepbugs.py -d \u003csource directory\u003e\npython grepbugs.py -r github -a \u003caccount\u003e\npython grepbugs.py -r github -a \u003caccount\u003e -f\n```\n\nThe latest regular expressions will be pulled from https://www.grepbugs.com\nYou can now sign-in at https://grepbugs.com/login to contribute regex rules.\n\nA basic HTML report will be generated in the out/ directory.  A \ntab-delimited file with a subset of the information is also created.\n\nExample reports: https://www.grepbugs.com/reports\n\n### Offline Usage\nIf you need to run grepbugs when there is not Internet connection then you should, before going offline, download the rules file from https://grepbugs.com/rules and save it to `GrepBugs/data/grepbugs.json`.\n\n## Configuration\nThe `etc/grepbugs.cfg` file can be used to configure:\n- MySQL database (for storing scan results)\n- Path to grep binary\n\n## Dependencies\n- GNU grep (http://www.gnu.org/software/grep/)\n\t- On Debian run: apt-get install grep\n\t- On OSX, you will need to install gnu grep (see http://www.heystephenwood.com/2013/09/install-gnu-grep-on-mac-osx.html)\n\t- On Windows, download the installer package from http://gnuwin32.sourceforge.net/packages/grep.htm\n\n- cloc (http://cloc.sourceforge.net/)\n\t- On Debian run: `apt-get install cloc`\n\t- On OSX run: `brew install cloc`\n\t- On Windows, download the binary from http://sourceforge.net/projects/cloc/files/cloc/v1.64/\n\n- git (http://git-scm.com/)\n\t- Only required if you want to do repo scanning\n\t- On Debian run: `apt-get install git`\n\t- On OSX, configure Xcode command line tools\n\n- svn (https://subversion.apache.org/)\n\t- Only required if you want to do repo scanning\n\t- On Debian run: `apt-get install subversion`\n\t- On OSX, configure Xcode command line tools\n\n- MySQL support\n\t- On Debian run: `apt-get install python-mysqldb` and if this does not work then try one of these:\n\t\t- `apt-get install libmysqlclient-dev`\n\t\t- `pip install MySQL-python`\n\n- requests (http://docs.python-requests.org/en/latest/)\n\t- On Debian run one of these two options: \n\t\t- `apt-get install python-requests` \n\t\t- `pip install requests`\n\t- On OSX run: `pip install requests`\n\t- On Windows, \n\t\t1. Download tarball: https://github.com/kennethreitz/requests/zipball/master\n\t\t2. Manually install requests via `python setup.py install`\n\n## Using MySQL Database\nCreate a database and run the following create statements.\n\n```\nCREATE TABLE `projects` (\n  `project_id` varchar(36) NOT NULL,\n  `repo` varchar(50) NOT NULL,\n  `account` varchar(50) NOT NULL,\n  `project` varchar(100) DEFAULT NULL,\n  `default_branch` varchar(50) DEFAULT NULL,\n  `last_scan` datetime DEFAULT NULL,\n  PRIMARY KEY (`project_id`),\n  KEY `idx_account` (`account`)\n);\n\nCREATE TABLE `results` (\n  `result_id` varchar(36) NOT NULL,\n  `scan_id` varchar(36) NOT NULL,\n  `language` varchar(50) DEFAULT NULL,\n  `regex_id` int(11) DEFAULT NULL,\n  `regex_text` text,\n  `description` text,\n  PRIMARY KEY (`result_id`),\n  KEY `idx_scan_id` (`scan_id`)\n);\n\nCREATE TABLE `results_detail` (\n  `result_detail_id` varchar(36) NOT NULL,\n  `result_id` varchar(36) NOT NULL,\n  `file` text,\n  `line` int(11) DEFAULT NULL,\n  `code` text,\n  PRIMARY KEY (`result_detail_id`),\n  KEY `idx_result_id` (`result_id`)\n);\n\nCREATE TABLE `scans` (\n  `scan_id` varchar(36) NOT NULL,\n  `project_id` varchar(36) DEFAULT NULL,\n  `date_time` datetime DEFAULT NULL,\n  `cloc_out` text,\n  PRIMARY KEY (`scan_id`),\n  KEY `idx_project_id` (`project_id`)\n);\n```\n\n## Using on Windows\n\nThe Windows instructions are beta (we've done it once!) and we welcome\nsuggestions from users.  Install python on Windows and make sure requests is\ninstalled too.  Install grep and cloc as needed, then modify the configuration\nfile with the full path to the binaries if they are not on the path.  We are\nunsure if you use a single \\\\ or a double one in the PATH or if you can specify\ndrives.  Modify the tmpdir setting to a location which exists.\n\nThen, run grepbugs as normal.  It should work correctly.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoospidy%2Fgrepbugs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoospidy%2Fgrepbugs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoospidy%2Fgrepbugs/lists"}