{"id":40741762,"url":"https://github.com/blizzy78/varnamelen","last_synced_at":"2026-01-21T15:07:55.731Z","repository":{"id":37031743,"uuid":"407709089","full_name":"blizzy78/varnamelen","owner":"blizzy78","description":"Go analyzer checking that the length of a variable's name matches its usage scope","archived":false,"fork":false,"pushed_at":"2023-08-08T14:27:20.000Z","size":89,"stargazers_count":15,"open_issues_count":3,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-18T23:15:33.152Z","etag":null,"topics":["analyzer","go","golang","golangci-lint","linter"],"latest_commit_sha":null,"homepage":"","language":"Go","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/blizzy78.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-18T00:01:29.000Z","updated_at":"2024-05-11T17:37:13.000Z","dependencies_parsed_at":"2024-06-18T22:58:07.662Z","dependency_job_id":null,"html_url":"https://github.com/blizzy78/varnamelen","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/blizzy78/varnamelen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blizzy78%2Fvarnamelen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blizzy78%2Fvarnamelen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blizzy78%2Fvarnamelen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blizzy78%2Fvarnamelen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blizzy78","download_url":"https://codeload.github.com/blizzy78/varnamelen/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blizzy78%2Fvarnamelen/sbom","scorecard":{"id":243574,"data":{"date":"2025-08-11","repo":{"name":"github.com/blizzy78/varnamelen","commit":"a11a91e5dd206ae1ae00e871116dc05b1bca0eec"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.4,"checks":[{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/coverage.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/blizzy78/varnamelen/coverage.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/coverage.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/blizzy78/varnamelen/coverage.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/blizzy78/varnamelen/lint.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/blizzy78/varnamelen/lint.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/lint.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/blizzy78/varnamelen/lint.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/blizzy78/varnamelen/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/blizzy78/varnamelen/test.yml/master?enable=pin","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":0,"reason":"Found 1/23 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":10,"reason":"GitHub workflow tokens follow principle of least privilege","details":["Info: topLevel 'contents' permission set to 'read': .github/workflows/coverage.yml:6","Info: topLevel 'pull-requests' permission set to 'read': .github/workflows/coverage.yml:7","Info: topLevel 'contents' permission set to 'read': .github/workflows/lint.yml:13","Info: topLevel 'pull-requests' permission set to 'read': .github/workflows/lint.yml:14","Info: topLevel 'contents' permission set to 'read': .github/workflows/test.yml:6","Info: topLevel 'pull-requests' permission set to 'read': .github/workflows/test.yml:7","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 8 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T07:05:14.095Z","repository_id":37031743,"created_at":"2025-08-17T07:05:14.096Z","updated_at":"2025-08-17T07:05:14.096Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28635123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T14:50:40.221Z","status":"ssl_error","status_checked_at":"2026-01-21T14:48:59.225Z","response_time":86,"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":["analyzer","go","golang","golangci-lint","linter"],"created_at":"2026-01-21T15:07:55.660Z","updated_at":"2026-01-21T15:07:55.722Z","avatar_url":"https://github.com/blizzy78.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GoDoc](https://pkg.go.dev/badge/github.com/blizzy78/varnamelen)](https://pkg.go.dev/github.com/blizzy78/varnamelen)\n\n\nvarnamelen\n==========\n\nA Go Analyzer that checks that the length of a variable's name matches its usage scope:\n\nVariables with short names can be hard to use if the variable is used over a longer span of lines of code.\nA longer variable name may be easier to comprehend.\n\nThe analyzer also checks constants, parameters, named return values, method receivers, and type parameters.\n\nArbitrary declarations such as `f *foo` can be ignored, as well as idiomatic `ok` variables.\nConventional Go parameters such as `ctx context.Context` or `t *testing.T` will always be ignored.\n\n**Example output**\n\n```\ntest.go:4:2: variable name 'x' is too short for the scope of its usage (varnamelen)\n        x := 123\n        ^\ntest.go:6:2: variable name 'i' is too short for the scope of its usage (varnamelen)\n        i := 10\n        ^\n```\n\n\ngolangci-lint Integration\n-------------------------\n\nvarnamelen is integrated into [golangci-lint] (though it may not always be the most recent version.)\n\nExample configuration for golangci-lint:\n\n```yaml\nlinters-settings:\n  varnamelen:\n    # The longest distance, in source lines, that is being considered a \"small scope.\" (defaults to 5)\n    # Variables used in at most this many lines will be ignored.\n    max-distance: 5\n    # The minimum length of a variable's name that is considered \"long.\" (defaults to 3)\n    # Variable names that are at least this long will be ignored.\n    min-name-length: 3\n    # Check method receivers. (defaults to false)\n    check-receiver: false\n    # Check named return values. (defaults to false)\n    check-return: false\n    # Check type parameters. (defaults to false)\n    check-type-param: false\n    # Ignore \"ok\" variables that hold the bool return value of a type assertion. (defaults to false)\n    ignore-type-assert-ok: false\n    # Ignore \"ok\" variables that hold the bool return value of a map index. (defaults to false)\n    ignore-map-index-ok: false\n    # Ignore \"ok\" variables that hold the bool return value of a channel receive. (defaults to false)\n    ignore-chan-recv-ok: false\n    # Optional list of variable names that should be ignored completely. (defaults to empty list)\n    ignore-names:\n      - err\n    # Optional list of variable declarations that should be ignored completely. (defaults to empty list)\n    # Entries must be in one of the following forms (see below for examples):\n    # - for variables, parameters, named return values, method receivers, or type parameters:\n    #   \u003cname\u003e \u003ctype\u003e  (\u003ctype\u003e can also be a pointer/slice/map/chan/...)\n    # - for constants: const \u003cname\u003e\n    ignore-decls:\n      - c echo.Context\n      - t testing.T\n      - f *foo.Bar\n      - e error\n      - i int\n      - const C\n      - T any\n      - m map[string]int\n```\n\n\nStandalone Usage\n----------------\n\nThe `cmd/` folder provides a standalone command line utility. You can build it like this:\n\n```\ngo build -o varnamelen ./cmd/\n```\n\n**Usage**\n\n```\nvarnamelen: checks that the length of a variable's name matches its scope\n\nUsage: varnamelen [-flag] [package]\n\nA variable with a short name can be hard to use if the variable is used\nover a longer span of lines of code. A longer variable name may be easier\nto comprehend.\n\nFlags:\n  -V\tprint version and exit\n  -all\n    \tno effect (deprecated)\n  -c int\n    \tdisplay offending line with this many lines of context (default -1)\n  -checkReceiver\n    \tcheck method receiver names\n  -checkReturn\n    \tcheck named return values\n  -checkTypeParam\n    \tcheck type parameter names\n  -cpuprofile string\n    \twrite CPU profile to this file\n  -debug string\n    \tdebug flags, any subset of \"fpstv\"\n  -fix\n    \tapply all suggested fixes\n  -flags\n    \tprint analyzer flags in JSON\n  -ignoreChanRecvOk\n    \tignore 'ok' variables that hold the bool return value of a channel receive\n  -ignoreDecls value\n    \tcomma-separated list of ignored variable declarations\n  -ignoreMapIndexOk\n    \tignore 'ok' variables that hold the bool return value of a map index\n  -ignoreNames value\n    \tcomma-separated list of ignored variable names\n  -ignoreTypeAssertOk\n    \tignore 'ok' variables that hold the bool return value of a type assertion\n  -json\n    \temit JSON output\n  -maxDistance int\n    \tmaximum number of lines of variable usage scope considered 'short' (default 5)\n  -memprofile string\n    \twrite memory profile to this file\n  -minNameLength int\n    \tminimum length of variable name considered 'long' (default 3)\n  -source\n    \tno effect (deprecated)\n  -tags string\n    \tno effect (deprecated)\n  -trace string\n    \twrite trace log to this file\n  -v\tno effect (deprecated)\n```\n\n\nLicense\n-------\n\nThis package is licensed under the MIT license.\n\n\n\n[golangci-lint]: https://github.com/golangci/golangci-lint\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblizzy78%2Fvarnamelen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblizzy78%2Fvarnamelen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblizzy78%2Fvarnamelen/lists"}