{"id":13771710,"url":"https://github.com/lafolle/flen","last_synced_at":"2026-01-12T06:15:47.305Z","repository":{"id":57501976,"uuid":"53780384","full_name":"lafolle/flen","owner":"lafolle","description":"Flen provides stats on functions/methods lengths in a Golang package.","archived":false,"fork":false,"pushed_at":"2018-03-11T06:23:47.000Z","size":19,"stargazers_count":50,"open_issues_count":3,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-17T07:34:30.168Z","etag":null,"topics":["golang"],"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/lafolle.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":"2016-03-13T10:58:46.000Z","updated_at":"2024-10-05T15:16:56.000Z","dependencies_parsed_at":"2022-09-13T07:24:26.748Z","dependency_job_id":null,"html_url":"https://github.com/lafolle/flen","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lafolle%2Fflen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lafolle%2Fflen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lafolle%2Fflen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lafolle%2Fflen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lafolle","download_url":"https://codeload.github.com/lafolle/flen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253518941,"owners_count":21921074,"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":["golang"],"created_at":"2024-08-03T17:00:54.617Z","updated_at":"2026-01-12T06:15:47.227Z","avatar_url":"https://github.com/lafolle.png","language":"Go","readme":"## Get info on length of functions in a Go package.\n\nGiven package is searched in  directories provided by envs in following order: GOPATH, GOROOT. AST is generated only for Go source files present in package path, ie, `flen crypto` shall only parse `crypto.go`. For parsing `crypto/sha1`, full package path needs to be provided, ie `flen crypto/sha1`. For externally implemented functions, line number will be 0, as their is no enough information available to get their line numbers.\n\n### Install\n`go get github.com/lafolle/flen/cmd/flen`\n\n### Usage\n```\nUsage: flen [options] \u003cpkg\u003e\n  -bs int\n        bucket size (natural number) (default 5)\n  -l int\n        min length (inclusive)\n  -t    include tests files\n  -u int\n        max length (exclusive) (default 1000000)\t\n```\n### Examples\nSimple usage  \n```\n$ flen strings\nFull path of pkg:  /usr/local/go/src/strings\nExternally implemented funcs\n+-------+-----------+-------------------------------------------+---------+------+\n| INDEX |   NAME    |                 FILEPATH                  | LINE NO | SIZE |\n+-------+-----------+-------------------------------------------+---------+------+\n|     0 | IndexByte | /usr/local/go/src/strings/strings_decl.go |       0 |    0 |\n+-------+-----------+-------------------------------------------+---------+------+\n\n[1-6)   -       ∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎\n[6-11)  -       ∎∎∎∎∎∎∎∎∎∎\n[11-16) -       ∎∎∎∎∎∎∎∎∎∎∎∎\n[16-21) -       ∎∎∎∎∎\n[21-26) -       ∎∎∎\n[26-31) -       ∎∎∎∎\n[31-36) -       ∎∎∎∎\n[36-41) -       ∎∎∎\n[41-46) -       ∎∎\n[46-51) -       ∎\n[51-56) -\n[56-61) -       ∎\n[61-66) -\n$\n```  \n\n### Range of lengths\nTo get all function/methods whose lengths fall in given range:   \n```\nflen -l 16 -u 41 strings\nFull path of pkg:  /usr/local/go/src/strings\nFunctions with length in range [16, 41)\n+-------+---------------------+--------------------------------------+---------+------+\n| INDEX |        NAME         |               FILEPATH               | LINE NO | SIZE |\n+-------+---------------------+--------------------------------------+---------+------+\n|     0 | Replace             | /usr/local/go/src/strings/replace.go |     365 |   17 |\n|     1 | Seek                | /usr/local/go/src/strings/reader.go  |     109 |   17 |\n|     2 | Join                | /usr/local/go/src/strings/strings.go |     388 |   18 |\n|     3 | WriteString         | /usr/local/go/src/strings/replace.go |     432 |   20 |\n|     4 | isSeparator         | /usr/local/go/src/strings/strings.go |     502 |   20 |\n|     5 | WriteString         | /usr/local/go/src/strings/replace.go |     385 |   22 |\n|     6 | genSplit            | /usr/local/go/src/strings/strings.go |     281 |   23 |\n|     7 | explode             | /usr/local/go/src/strings/strings.go |      17 |   25 |\n|     8 | Replace             | /usr/local/go/src/strings/replace.go |     461 |   26 |\n|     9 | WriteString         | /usr/local/go/src/strings/replace.go |     490 |   27 |\n|    10 | makeGenericReplacer | /usr/local/go/src/strings/replace.go |     240 |   29 |\n|    11 | FieldsFunc          | /usr/local/go/src/strings/strings.go |     353 |   30 |\n|    12 | Replace             | /usr/local/go/src/strings/strings.go |     681 |   31 |\n|    13 | Index               | /usr/local/go/src/strings/strings.go |     147 |   33 |\n|    14 | LastIndex           | /usr/local/go/src/strings/strings.go |     184 |   33 |\n|    15 | lookup              | /usr/local/go/src/strings/replace.go |     193 |   33 |\n|    16 | Map                 | /usr/local/go/src/strings/strings.go |     422 |   37 |\n|    17 | WriteString         | /usr/local/go/src/strings/replace.go |     312 |   38 |\n|    18 | makeStringFinder    | /usr/local/go/src/strings/search.go  |      48 |   40 |\n+-------+---------------------+--------------------------------------+---------+------+\n\n[1-6)   -       ∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎\n[6-11)  -       ∎∎∎∎∎∎∎∎∎∎\n[11-16) -       ∎∎∎∎∎∎∎∎∎∎∎∎\n[16-21) -       ∎∎∎∎∎\n[21-26) -       ∎∎∎\n[26-31) -       ∎∎∎∎\n[31-36) -       ∎∎∎∎\n[36-41) -       ∎∎∎\n[41-46) -       ∎∎\n[46-51) -       ∎\n[51-56) -\n[56-61) -       ∎\n[61-66) -\n```\n\n### Including test files\nBy default, test files are ignored. Enable parsing test files by `-t` flag\n```\n$ flen -t strings\nFull path of pkg:  /usr/local/go/src/strings\n\nExternally implemented funcs\n+-------+-----------+-------------------------------------------+---------+------+\n| INDEX |   NAME    |                 FILEPATH                  | LINE NO | SIZE |\n+-------+-----------+-------------------------------------------+---------+------+\n|     0 | IndexByte | /usr/local/go/src/strings/strings_decl.go |       0 |    0 |\n+-------+-----------+-------------------------------------------+---------+------+\n\n[1-6)\t\t-\t∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎\n[6-11)\t\t-\t∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎\n[11-16)\t\t-\t∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎\n[16-21)\t\t-\t∎∎∎∎∎∎∎∎∎∎∎∎\n[21-26)\t\t-\t∎∎∎∎∎\n[26-31)\t\t-\t∎∎∎∎∎∎\n[31-36)\t\t-\t∎∎∎∎\n[36-41)\t\t-\t∎∎∎∎\n[41-46)\t\t-\t∎∎∎∎∎∎∎\n[46-51)\t\t-\t∎\n[51-56)\t\t-\t∎\n[56-61)\t\t-\t∎\n[61-66)\t\t-\t\n[66-71)\t\t-\t∎\n[71-76)\t\t-\t\n[76-81)\t\t-\t\n[81-86)\t\t-\t\n[86-91)\t\t-\t\n[91-96)\t\t-\t\n[96-101)\t-\t\n[101-106)\t-\t\n[106-111)\t-\t\n[111-116)\t-\t\n[116-121)\t-\t\n[121-126)\t-\t\n[126-131)\t-\t\n[131-136)\t-\t\n[136-141)\t-\t\n[141-146)\t-\t\n[146-151)\t-\t\n[151-156)\t-\t\n[156-161)\t-\t\n[161-166)\t-\t\n[166-171)\t-\t\n[171-176)\t-\t\n[176-181)\t-\t\n[181-186)\t-\t\n[186-191)\t-\t\n[191-196)\t-\t\n[196-201)\t-\t\n[201-206)\t-\t\n[206-211)\t-\t\n[211-216)\t-\t\n[216-221)\t-\t\n[221-226)\t-\t\n[226-231)\t-\t\n[231-236)\t-\t\n[236-241)\t-\t\n[241-246)\t-\t\n[246-251)\t-\t\n[251-256)\t-\t\n[256-261)\t-\t\n[261-266)\t-\t∎\n[266-271)\t-\t\n```\n","funding_links":[],"categories":["Misc","Linters","Programming Languages"],"sub_categories":["Reports"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flafolle%2Fflen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flafolle%2Fflen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flafolle%2Fflen/lists"}