{"action":"created","comment":{"url":"https://api.github.com/repos/Parean/JWB/pulls/comments/115843329","pull_request_review_id":37417834,"id":115843329,"diff_hunk":"@@ -1,35 +1,72 @@\n #pragma once\n \n #include <string>\n+#include <memory>\n #include <vector>\n+#include <forward_list>\n+#include <unordered_map>\n+#include <unordered_set>\n \n #include \"accessModifier.hpp\"\n #include \"interfaceDescription.hpp\"\n \n namespace JWB {\tnamespace details {\n \n+enum class CouplingType\n+{\n+\tATTRIBUTE,\n+\tPARAMETER,\n+\tVARIABLE,\n+\tSTATIC\n+};\n+\n /// @class ClassDescription\n-/// @brief Description of a Java class, contains it's name and attributes\n-///        Should be contained in Node as a part of an inheritance tree\n+/// @brief Description of a Java class, contains it's name, attributes, used and using classes\n class ClassDescription : public InterfaceDescription\n {\n-\tpublic:\n-\t\tClassDescription() = delete;\n-\t\tClassDescription(ClassDescription const&) = delete;\n-\t\tClassDescription(ClassDescription&&) = delete;\n-\t\tClassDescription& operator=(ClassDescription const&) = delete;\n-\t\tClassDescription& operator=(ClassDescription&&) = delete;\n-\n-\t\tClassDescription(std::string className);\n-\t\tvoid addAttribute(AccessModifier modifier, std::string newAttribute);\n-\n-\t\tsize_t getNumberOfAttributes() const;\n-\t\tsize_t getNumberOfPrivateAttributes() const;\n-\t\tsize_t getAverageCyclomaticComplexity() const;\n-\n-\tprivate:\n-\t\tstd::vector<std::string> attributes;\n-\t\tstd::vector<std::string const*> privateAttributes;\n+public:\n+\n+\tClassDescription() = delete;\n+\tClassDescription(ClassDescription const&) = delete;\n+\tClassDescription(ClassDescription&&) = delete;\n+\tClassDescription& operator=(ClassDescription const&) = delete;\n+\tClassDescription& operator=(ClassDescription&&) = delete;\n+\n+\tClassDescription(std::string className);\n+\tvoid addAttribute(AccessModifier modifier, std::string newAttribute);\n+\n+\tvoid addUsedClass(std::string const &className, CouplingType type);\n+\tvoid addUsingClass(std::string const &className, CouplingType type);\n+\n+\t// It is called by one of the previous two functions and implements the addition,\n+\t// taking as third parameter either usedClasses or usingClasses\n+\tvoid addCoupling(\n+\t\tstd::string const &className,\n+\t\tCouplingType type,\n+\t\tstd::unordered_map<std::string, std::shared_ptr <std::forward_list <CouplingType> >> &classes\n+\t);\n+\n+\tstd::unordered_map<std::string, std::shared_ptr <std::forward_list <CouplingType> >> const& getUsedClasses() const;\n+\tstd::unordered_map<std::string, std::shared_ptr <std::forward_list <CouplingType> >> const& getUsingClasses() const;\n+\n+\tsize_t getNumberOfAttributes() const;\n+\tsize_t getNumberOfPrivateAttributes() const;\n+\tsize_t getAverageCyclomaticComplexity() const;\n+\tstd::unordered_set<std::string> const& getAttributes() const;\n+\n+\t// It used to convert variable of enum CouplingType into std::string\n+\tstd::string static getStringCouplingType(CouplingType type);\n+\n+private:\n+\n+\tstd::unordered_set<std::string> attributes;\n+\tstd::vector<std::string const*> privateAttributes;\n+\n+\t// Contains classes, that use current class\n+\tstd::unordered_map<std::string, std::shared_ptr <std::forward_list <CouplingType> >> usingClasses;\n+\n+\t// Contains classes used by the current class\n+\tstd::unordered_map<std::string, std::shared_ptr <std::forward_list <CouplingType> >> usedClasses;","path":"application/inc/classDescription.hpp","position":88,"original_position":88,"commit_id":"3658316444b1c71d889a677a773b754d0ad067e8","original_commit_id":"3658316444b1c71d889a677a773b754d0ad067e8","user":{"login":"alexander-bzikadze","id":15484066,"avatar_url":"https://avatars3.githubusercontent.com/u/15484066?v=3","gravatar_id":"","url":"https://api.github.com/users/alexander-bzikadze","html_url":"https://github.com/alexander-bzikadze","followers_url":"https://api.github.com/users/alexander-bzikadze/followers","following_url":"https://api.github.com/users/alexander-bzikadze/following{/other_user}","gists_url":"https://api.github.com/users/alexander-bzikadze/gists{/gist_id}","starred_url":"https://api.github.com/users/alexander-bzikadze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexander-bzikadze/subscriptions","organizations_url":"https://api.github.com/users/alexander-bzikadze/orgs","repos_url":"https://api.github.com/users/alexander-bzikadze/repos","events_url":"https://api.github.com/users/alexander-bzikadze/events{/privacy}","received_events_url":"https://api.github.com/users/alexander-bzikadze/received_events","type":"User","site_admin":false},"body":"А зачем указатель на форвард_лист?","created_at":"2017-05-10T20:25:01Z","updated_at":"2017-05-10T20:54:57Z","html_url":"https://github.com/Parean/JWB/pull/9#discussion_r115843329","pull_request_url":"https://api.github.com/repos/Parean/JWB/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/Parean/JWB/pulls/comments/115843329"},"html":{"href":"https://github.com/Parean/JWB/pull/9#discussion_r115843329"},"pull_request":{"href":"https://api.github.com/repos/Parean/JWB/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/Parean/JWB/pulls/9","id":118743950,"html_url":"https://github.com/Parean/JWB/pull/9","diff_url":"https://github.com/Parean/JWB/pull/9.diff","patch_url":"https://github.com/Parean/JWB/pull/9.patch","issue_url":"https://api.github.com/repos/Parean/JWB/issues/9","number":9,"state":"open","locked":false,"title":"Metrics for clustering","user":{"login":"Parean","id":16430691,"avatar_url":"https://avatars2.githubusercontent.com/u/16430691?v=3","gravatar_id":"","url":"https://api.github.com/users/Parean","html_url":"https://github.com/Parean","followers_url":"https://api.github.com/users/Parean/followers","following_url":"https://api.github.com/users/Parean/following{/other_user}","gists_url":"https://api.github.com/users/Parean/gists{/gist_id}","starred_url":"https://api.github.com/users/Parean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Parean/subscriptions","organizations_url":"https://api.github.com/users/Parean/orgs","repos_url":"https://api.github.com/users/Parean/repos","events_url":"https://api.github.com/users/Parean/events{/privacy}","received_events_url":"https://api.github.com/users/Parean/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-05-03T11:53:04Z","updated_at":"2017-05-10T20:54:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3ded1c105590a49ca9c8942bd845418f73559136","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/Parean/JWB/pulls/9/commits","review_comments_url":"https://api.github.com/repos/Parean/JWB/pulls/9/comments","review_comment_url":"https://api.github.com/repos/Parean/JWB/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Parean/JWB/issues/9/comments","statuses_url":"https://api.github.com/repos/Parean/JWB/statuses/3658316444b1c71d889a677a773b754d0ad067e8","head":{"label":"Parean:metricsForClustering","ref":"metricsForClustering","sha":"3658316444b1c71d889a677a773b754d0ad067e8","user":{"login":"Parean","id":16430691,"avatar_url":"https://avatars2.githubusercontent.com/u/16430691?v=3","gravatar_id":"","url":"https://api.github.com/users/Parean","html_url":"https://github.com/Parean","followers_url":"https://api.github.com/users/Parean/followers","following_url":"https://api.github.com/users/Parean/following{/other_user}","gists_url":"https://api.github.com/users/Parean/gists{/gist_id}","starred_url":"https://api.github.com/users/Parean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Parean/subscriptions","organizations_url":"https://api.github.com/users/Parean/orgs","repos_url":"https://api.github.com/users/Parean/repos","events_url":"https://api.github.com/users/Parean/events{/privacy}","received_events_url":"https://api.github.com/users/Parean/received_events","type":"User","site_admin":false},"repo":{"id":84555394,"name":"JWB","full_name":"Parean/JWB","owner":{"login":"Parean","id":16430691,"avatar_url":"https://avatars2.githubusercontent.com/u/16430691?v=3","gravatar_id":"","url":"https://api.github.com/users/Parean","html_url":"https://github.com/Parean","followers_url":"https://api.github.com/users/Parean/followers","following_url":"https://api.github.com/users/Parean/following{/other_user}","gists_url":"https://api.github.com/users/Parean/gists{/gist_id}","starred_url":"https://api.github.com/users/Parean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Parean/subscriptions","organizations_url":"https://api.github.com/users/Parean/orgs","repos_url":"https://api.github.com/users/Parean/repos","events_url":"https://api.github.com/users/Parean/events{/privacy}","received_events_url":"https://api.github.com/users/Parean/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Parean/JWB","description":null,"fork":false,"url":"https://api.github.com/repos/Parean/JWB","forks_url":"https://api.github.com/repos/Parean/JWB/forks","keys_url":"https://api.github.com/repos/Parean/JWB/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Parean/JWB/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Parean/JWB/teams","hooks_url":"https://api.github.com/repos/Parean/JWB/hooks","issue_events_url":"https://api.github.com/repos/Parean/JWB/issues/events{/number}","events_url":"https://api.github.com/repos/Parean/JWB/events","assignees_url":"https://api.github.com/repos/Parean/JWB/assignees{/user}","branches_url":"https://api.github.com/repos/Parean/JWB/branches{/branch}","tags_url":"https://api.github.com/repos/Parean/JWB/tags","blobs_url":"https://api.github.com/repos/Parean/JWB/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Parean/JWB/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Parean/JWB/git/refs{/sha}","trees_url":"https://api.github.com/repos/Parean/JWB/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Parean/JWB/statuses/{sha}","languages_url":"https://api.github.com/repos/Parean/JWB/languages","stargazers_url":"https://api.github.com/repos/Parean/JWB/stargazers","contributors_url":"https://api.github.com/repos/Parean/JWB/contributors","subscribers_url":"https://api.github.com/repos/Parean/JWB/subscribers","subscription_url":"https://api.github.com/repos/Parean/JWB/subscription","commits_url":"https://api.github.com/repos/Parean/JWB/commits{/sha}","git_commits_url":"https://api.github.com/repos/Parean/JWB/git/commits{/sha}","comments_url":"https://api.github.com/repos/Parean/JWB/comments{/number}","issue_comment_url":"https://api.github.com/repos/Parean/JWB/issues/comments{/number}","contents_url":"https://api.github.com/repos/Parean/JWB/contents/{+path}","compare_url":"https://api.github.com/repos/Parean/JWB/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Parean/JWB/merges","archive_url":"https://api.github.com/repos/Parean/JWB/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Parean/JWB/downloads","issues_url":"https://api.github.com/repos/Parean/JWB/issues{/number}","pulls_url":"https://api.github.com/repos/Parean/JWB/pulls{/number}","milestones_url":"https://api.github.com/repos/Parean/JWB/milestones{/number}","notifications_url":"https://api.github.com/repos/Parean/JWB/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Parean/JWB/labels{/name}","releases_url":"https://api.github.com/repos/Parean/JWB/releases{/id}","deployments_url":"https://api.github.com/repos/Parean/JWB/deployments","created_at":"2017-03-10T11:57:43Z","updated_at":"2017-04-02T10:04:32Z","pushed_at":"2017-05-09T16:15:26Z","git_url":"git://github.com/Parean/JWB.git","ssh_url":"git@github.com:Parean/JWB.git","clone_url":"https://github.com/Parean/JWB.git","svn_url":"https://github.com/Parean/JWB","homepage":null,"size":79011,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"Parean:development","ref":"development","sha":"5b19276b49b876087b9e73cc0d8f8b15cd6f1d75","user":{"login":"Parean","id":16430691,"avatar_url":"https://avatars2.githubusercontent.com/u/16430691?v=3","gravatar_id":"","url":"https://api.github.com/users/Parean","html_url":"https://github.com/Parean","followers_url":"https://api.github.com/users/Parean/followers","following_url":"https://api.github.com/users/Parean/following{/other_user}","gists_url":"https://api.github.com/users/Parean/gists{/gist_id}","starred_url":"https://api.github.com/users/Parean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Parean/subscriptions","organizations_url":"https://api.github.com/users/Parean/orgs","repos_url":"https://api.github.com/users/Parean/repos","events_url":"https://api.github.com/users/Parean/events{/privacy}","received_events_url":"https://api.github.com/users/Parean/received_events","type":"User","site_admin":false},"repo":{"id":84555394,"name":"JWB","full_name":"Parean/JWB","owner":{"login":"Parean","id":16430691,"avatar_url":"https://avatars2.githubusercontent.com/u/16430691?v=3","gravatar_id":"","url":"https://api.github.com/users/Parean","html_url":"https://github.com/Parean","followers_url":"https://api.github.com/users/Parean/followers","following_url":"https://api.github.com/users/Parean/following{/other_user}","gists_url":"https://api.github.com/users/Parean/gists{/gist_id}","starred_url":"https://api.github.com/users/Parean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Parean/subscriptions","organizations_url":"https://api.github.com/users/Parean/orgs","repos_url":"https://api.github.com/users/Parean/repos","events_url":"https://api.github.com/users/Parean/events{/privacy}","received_events_url":"https://api.github.com/users/Parean/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Parean/JWB","description":null,"fork":false,"url":"https://api.github.com/repos/Parean/JWB","forks_url":"https://api.github.com/repos/Parean/JWB/forks","keys_url":"https://api.github.com/repos/Parean/JWB/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Parean/JWB/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Parean/JWB/teams","hooks_url":"https://api.github.com/repos/Parean/JWB/hooks","issue_events_url":"https://api.github.com/repos/Parean/JWB/issues/events{/number}","events_url":"https://api.github.com/repos/Parean/JWB/events","assignees_url":"https://api.github.com/repos/Parean/JWB/assignees{/user}","branches_url":"https://api.github.com/repos/Parean/JWB/branches{/branch}","tags_url":"https://api.github.com/repos/Parean/JWB/tags","blobs_url":"https://api.github.com/repos/Parean/JWB/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Parean/JWB/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Parean/JWB/git/refs{/sha}","trees_url":"https://api.github.com/repos/Parean/JWB/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Parean/JWB/statuses/{sha}","languages_url":"https://api.github.com/repos/Parean/JWB/languages","stargazers_url":"https://api.github.com/repos/Parean/JWB/stargazers","contributors_url":"https://api.github.com/repos/Parean/JWB/contributors","subscribers_url":"https://api.github.com/repos/Parean/JWB/subscribers","subscription_url":"https://api.github.com/repos/Parean/JWB/subscription","commits_url":"https://api.github.com/repos/Parean/JWB/commits{/sha}","git_commits_url":"https://api.github.com/repos/Parean/JWB/git/commits{/sha}","comments_url":"https://api.github.com/repos/Parean/JWB/comments{/number}","issue_comment_url":"https://api.github.com/repos/Parean/JWB/issues/comments{/number}","contents_url":"https://api.github.com/repos/Parean/JWB/contents/{+path}","compare_url":"https://api.github.com/repos/Parean/JWB/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Parean/JWB/merges","archive_url":"https://api.github.com/repos/Parean/JWB/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Parean/JWB/downloads","issues_url":"https://api.github.com/repos/Parean/JWB/issues{/number}","pulls_url":"https://api.github.com/repos/Parean/JWB/pulls{/number}","milestones_url":"https://api.github.com/repos/Parean/JWB/milestones{/number}","notifications_url":"https://api.github.com/repos/Parean/JWB/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Parean/JWB/labels{/name}","releases_url":"https://api.github.com/repos/Parean/JWB/releases{/id}","deployments_url":"https://api.github.com/repos/Parean/JWB/deployments","created_at":"2017-03-10T11:57:43Z","updated_at":"2017-04-02T10:04:32Z","pushed_at":"2017-05-09T16:15:26Z","git_url":"git://github.com/Parean/JWB.git","ssh_url":"git@github.com:Parean/JWB.git","clone_url":"https://github.com/Parean/JWB.git","svn_url":"https://github.com/Parean/JWB","homepage":null,"size":79011,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Parean/JWB/pulls/9"},"html":{"href":"https://github.com/Parean/JWB/pull/9"},"issue":{"href":"https://api.github.com/repos/Parean/JWB/issues/9"},"comments":{"href":"https://api.github.com/repos/Parean/JWB/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/Parean/JWB/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/Parean/JWB/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Parean/JWB/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/Parean/JWB/statuses/3658316444b1c71d889a677a773b754d0ad067e8"}}}}
{"actor":{"display_login":"alexander-bzikadze"}}