{"action":"closed","issue":{"url":"https://api.github.com/repos/sebastianbergmann/phploc/issues/68","labels_url":"https://api.github.com/repos/sebastianbergmann/phploc/issues/68/labels{/name}","comments_url":"https://api.github.com/repos/sebastianbergmann/phploc/issues/68/comments","events_url":"https://api.github.com/repos/sebastianbergmann/phploc/issues/68/events","html_url":"https://github.com/sebastianbergmann/phploc/issues/68","id":21826115,"number":68,"title":"Is Average Method Length (LLOC) calculated correctly","user":{"login":"hver","id":3062750,"avatar_url":"https://avatars.githubusercontent.com/u/3062750?v=3","gravatar_id":"","url":"https://api.github.com/users/hver","html_url":"https://github.com/hver","followers_url":"https://api.github.com/users/hver/followers","following_url":"https://api.github.com/users/hver/following{/other_user}","gists_url":"https://api.github.com/users/hver/gists{/gist_id}","starred_url":"https://api.github.com/users/hver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hver/subscriptions","organizations_url":"https://api.github.com/users/hver/orgs","repos_url":"https://api.github.com/users/hver/repos","events_url":"https://api.github.com/users/hver/events{/privacy}","received_events_url":"https://api.github.com/users/hver/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2013-10-30T13:57:05Z","updated_at":"2015-03-04T16:37:26Z","closed_at":"2015-03-04T16:37:26Z","body":"I have a question about Average Method Length (LLOC).\r\nIn the File phploc/src/Analyser.php at 217-223:\r\n```php\r\nif ($count['classes'] > 0) {\r\n    $count['llocByNoc'] = $count['llocClasses'] / $count['classes'];\r\n}\r\n\r\nif ($count['methods'] > 0) {\r\n    $count['llocByNom'] = $count['llocClasses'] / $count['methods'];\r\n}\r\n```\r\nThe number of average lines in method (*llocByNom*) is calculated by dividing **number of lines in classes** by **number of methods**.\r\nMore correct would be to use the\r\n **number of lines in methods** devided by **number of methods**\r\n, because in the classes you also have traits, variable, constants, etc. lines. "}}