{"id":13713653,"url":"https://github.com/yahoojapan/lcom4go","last_synced_at":"2025-04-12T22:07:40.128Z","repository":{"id":37866864,"uuid":"479193558","full_name":"yahoojapan/lcom4go","owner":"yahoojapan","description":"Compute LCOM4, Lack of Cohesion of Methods metrics ver.4, for golang projects.","archived":false,"fork":false,"pushed_at":"2023-12-13T07:05:01.000Z","size":19,"stargazers_count":22,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-12T22:07:06.167Z","etag":null,"topics":["go","golang","lcom4","metrics"],"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/yahoojapan.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":"2022-04-08T00:41:48.000Z","updated_at":"2025-03-21T11:31:12.000Z","dependencies_parsed_at":"2024-06-19T05:37:19.810Z","dependency_job_id":null,"html_url":"https://github.com/yahoojapan/lcom4go","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yahoojapan%2Flcom4go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yahoojapan%2Flcom4go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yahoojapan%2Flcom4go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yahoojapan%2Flcom4go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yahoojapan","download_url":"https://codeload.github.com/yahoojapan/lcom4go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248637769,"owners_count":21137538,"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":["go","golang","lcom4","metrics"],"created_at":"2024-08-02T23:01:41.438Z","updated_at":"2025-04-12T22:07:40.108Z","avatar_url":"https://github.com/yahoojapan.png","language":"Go","funding_links":[],"categories":["Repositories"],"sub_categories":[],"readme":"# LCOM4go\nLCOM4go is a tool to compute LCOM4, Lack of Cohesion of Methods metrics ver.4, for golang projects.\n\n# Install\n```\n$ go install --ldflags \"-s -w\" --trimpath github.com/yahoojapan/lcom4go/cmd/lcom4@latest\n```\n\n# Usage\n### Directory use installed binary (recommended)\n\n```\n$  $(go env GOPATH)/bin/lcom4 ./...\n...\n\n$  $(go env GOPATH)/bin/lcom4 net/http\n...\n```\n\n### Through the go vet\n\n```\n$  go vet -vettool=$(go env GOPATH)/bin/lcom4 ./...\n...\n\n$  go vet -vettool=$(go env GOPATH)/bin/lcom4 net/http\n...\n```\n\n# LCOM4 definition\nhttps://objectscriptquality.com/docs/metrics/lack-cohesion-methods-lcom4\n\n\n# Examples\n\nThe lcom4 of `s0` is 1 because both `method1` and `method2` use `s0.m`.\n```\ntype s0 struct {\n\tm int\n}\n\nfunc (a s0) method1() int {\n\treturn a.m\n}\nfunc (a s0) method2() int {\n\treturn -a.m\n}\n```\n\n\nThe lcom4 of `s1` is 2 because `method3` uses `a.n` which is not used by `method1` and `method2`.\n```\ntype s1 struct {\n\tm int\n\tn int\n}\n\nfunc (a s1) method1() int {\n\treturn a.m\n}\nfunc (a s1) method2() int {\n\treturn -a.m\n}\nfunc (a s1) method3() int {\n\treturn -a.n\n}\n```\n\n\n# Running the tests\n```\ngo test ./...\n```\n\n\n# License\n\nThis software is released under the MIT License, see the license file.\n# References\n* https://www.aivosto.com/project/help/pm-oo-cohesion.html#LCOM4\n* https://kenchon.github.io/cohesive-code\n* https://objectscriptquality.com/docs/metrics/lack-cohesion-methods-lcom4\n* https://github.com/FujiHaruka/eslint-plugin-lcom\n* https://metacpan.org/release/JOENIO/Analizo-1.20.3/source/lib/Analizo/Metric/LackOfCohesionOfMethods.pm\n* https://github.com/potfur/lcom\n* http://www.isys.uni-klu.ac.at/PDF/1995-0043-MHBM.pdf\n* https://github.com/cleuton/jqana\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyahoojapan%2Flcom4go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyahoojapan%2Flcom4go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyahoojapan%2Flcom4go/lists"}