{"id":13490744,"url":"https://github.com/phodal/coca","last_synced_at":"2025-05-16T13:03:48.030Z","repository":{"id":39484091,"uuid":"216841474","full_name":"phodal/coca","owner":"phodal","description":"Coca is a toolbox which is design for legacy system refactoring and analysis, includes call graph, concept analysis, api tree, design patterns suggest. Coca 是一个用于系统重构、系统迁移和系统分析的工具箱。它可以分析代码中的测试坏味道、模块化分析、行数统计、分析调用与依赖、Git 分析以及自动化重构等。","archived":false,"fork":false,"pushed_at":"2024-05-15T10:07:34.000Z","size":5351,"stargazers_count":945,"open_issues_count":2,"forks_count":109,"subscribers_count":26,"default_branch":"master","last_synced_at":"2024-07-30T21:37:16.831Z","etag":null,"topics":["ai","architecture","automation","git","refactor","refactoring","tools"],"latest_commit_sha":null,"homepage":"https://coca.migration.ink/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phodal.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2019-10-22T15:00:51.000Z","updated_at":"2024-07-23T09:34:08.000Z","dependencies_parsed_at":"2024-05-30T12:24:19.087Z","dependency_job_id":null,"html_url":"https://github.com/phodal/coca","commit_stats":null,"previous_names":["modernizing/coca","inherd/coca"],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phodal%2Fcoca","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phodal%2Fcoca/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phodal%2Fcoca/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phodal%2Fcoca/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phodal","download_url":"https://codeload.github.com/phodal/coca/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254535826,"owners_count":22087398,"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":["ai","architecture","automation","git","refactor","refactoring","tools"],"created_at":"2024-07-31T19:00:50.550Z","updated_at":"2025-05-16T13:03:47.985Z","avatar_url":"https://github.com/phodal.png","language":"Go","readme":"# Coca - toolbox for system refactoring and analysis\n\n![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/phodal/coca)\n[![Maintainability](https://api.codeclimate.com/v1/badges/d5a5e060522403b1f79b/maintainability)](https://codeclimate.com/github/phodal/coca/maintainability)\n[![codecov](https://codecov.io/gh/modernizing/coca/branch/master/graph/badge.svg)](https://codecov.io/gh/modernizing/coca)\n![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/phodal/coca)\n[![Build](https://github.com/phodal/coca/actions/workflows/go.yml/badge.svg)](https://github.com/phodal/coca/actions/workflows/go.yml)\n\n\u003e [Coca](https://coca.migration.ink/) is a toolbox which is design for legacy system refactoring and analysis, includes call graph, concept analysis, api tree, design patterns suggest.\n[Coca](https://coca.migration.ink/) 是一个用于系统重构、系统迁移和系统分析的工具箱。它可以分析代码中的测试坏味道、模块化分析、行数统计、分析调用与依赖、Git 分析以及自动化重构等。\n\nRelated Tools: [Coco](https://github.com/inherd/coco) is an effective DevOps analysis and auto-suggest tool.\n\nKotlin version: [Chapi](https://github.com/phodal/chapi)\n\nMigration Guide (Chinese Version): 《[系统重构与迁移指南](https://github.com/phodal/migration)》\n\nInspired by: [newlee](https://github.com/newlee) \u0026 [Tequila](https://github.com/newlee/tequila)\n\nRefactoring Modeling:\n\n![Refactoring Modeling](docs/images/model.svg)\n\n - Languages Support: Java (full features)\n\nFeatures List:\n\n```\nAvailable Commands:\n  analysis    analysis code\n  api         scan HTTP api from annotation\n  arch        project package visualization\n  bs          generate bad smell list and suggestions\n  call        show call graph with specific method\n  cloc        count lines of code with complexity estimation\n  concept     build domain concept from source code\n  count       count most refs function\n  evaluate    evaluate code situation and refactor effort\n  git         analysis git commit history for revs count, summary and suggest\n  help        Help about any command\n  rcall       reverse call graph visualization\n  refactor    auto refactor code\n  suggest     find usable Design Patterns from code\n  tbs         generate tests bad smell\n  todo        scan all todo, and list with time\n  version     version\n```\n\n## Getting started\n\nRequirements: [graphviz](https://www.graphviz.org/) for dot file to image (such as svg, png)\n\nThe easiest way to get coca is to use one of the pre-built release binaries which are available for OSX, Linux, Windows on the [release page](https://github.com/modernizing/coca/releases). \n\nYou can also install yourself : \n\n```bash\ngo install github.com/modernizing/coca@latest\n```\n\n\n## Usage\n\n### Analysis\n\n```\ncoca analysis\n```\n\n### Arch\n\n```\ncoca arch\n```\n\nAndroid Studio Gradle DSL Module (merge header)\n\ncommand: `coca arch -x \"com.android.tools.idea.gradle.dsl\" -H true`\n\n![Gradle Demo](showcases/android-gradle-dsl.svg)\n\nAndroid Studio Gradle DSL Module Elements Part:\n\ncommand: `coca arch -x \"com.android.tools.idea.gradle.dsl.parser.elements\"`\n\n![Gradle Demo](showcases/android-gradle-elements.svg)\n\n### Find Bad Smells\n\n```bash\ncoca bs -s type\n```\n\nExamples Result:\n\n```json\n{\n   \"dataClass\": [\n      {\n         \"File\": \"examples/api/BookController.java\",\n         \"BS\": \"dataClass\"\n      }\n   ],\n   \"lazyElement\": [\n      {\n         \"File\": \"examples/api/model/BookRepresentaion.java\",\n         \"BS\": \"lazyElement\"\n      }\n   ]\n}\n```\n\n### Code Line Count\n\n```\ncoca cloc\n```\n\nResults:\n\n```\n───────────────────────────────────────────────────────────────────────────────\nLanguage                 Files     Lines   Blanks  Comments     Code Complexity\n───────────────────────────────────────────────────────────────────────────────\nGo                          58     31763     7132       890    23741       2847\nJava                        44       971      208        21      742         62\nMarkdown                     8       238       75         0      163          0\nGherkin Specificati…         2        32        2        16       14          0\nDocument Type Defin…         1       293       36         0      257          0\nLicense                      1       201       32         0      169          0\nSQL                          1         2        0         0        2          0\nSVG                          1       199        0        34      165          0\nShell                        1         3        1         1        1          0\nXML                          1        13        0         0       13          0\ngitignore                    1        61        8         4       49          0\n───────────────────────────────────────────────────────────────────────────────\nTotal                      119     33776     7494       966    25316       2909\n───────────────────────────────────────────────────────────────────────────────\nEstimated Cost to Develop $803,822\nEstimated Schedule Effort 14.120551 months\nEstimated People Required 6.743156\n───────────────────────────────────────────────────────────────────────────────\n```\n\nResults to json\n\n```\ncoca cloc --by-file --format json\n```\n\n#### Cloc by directory\n\n```bash\ncoca cloc ~/intellij-community/android/ --by-directory --include-ext=java,kt --not-match=\".*(Test|Tests)\\.(kt|java)\"\n```\n\nresults csv:\n\n```csv\nmodule,summary\nadt-branding,169\nadt-testutils,257\nadt-ui,21987\nadt-ui-model,3450\nandroid,361270\nandroid-adb,497\nandroid-common,3280\nandroid-debuggers,3030\nandroid-kotlin,8816\nandroid-lang,24796\nandroid-lang-databinding,6392\nandroid-layout-inspector,2533\n...\n```\n\n#### Cloc Top File\n\n```bash\ncoca cloc ~/intellij-community/android/designer/src/com/android/tools/idea --top-file --top-size 10\n```\n\noutput to: `coca_reporter/sort_cloc.json` and also:\n\n```bash\n| LENGTH | COMPLEXITY |             LOCATION              |\n|--------|------------|-----------------------------------|\n|   1642 |        236 | ConstraintLayoutHandler.java      |\n|   1492 |        375 | ConstraintComponentUtilities.java |\n|   1189 |        166 | CommonActions.java                |\n|   1184 |        325 | ConstraintWidget.java             |\n|   1169 |        129 | SingleWidgetView.java             |\n|   1115 |        213 | ScoutArrange.java                 |\n|   1097 |        281 | ScoutWidget.java                  |\n|   1081 |        224 | 3d/Rasterize.java                 |\n|   1016 |        159 | LayoutlibSceneManager.java        |\n|   1014 |        220 | TimeLinePanel.java                |\n```\n\n### Build Deps Tree\n\n```\ncoca call -c com.phodal.pholedge.book.BookController.createBook -r com.phodal.pholedge.\n```\n\nExamples Results:\n\n![Call Demo](docs/sample/call_demo.svg)\n\n### Identify Spring API\n\n```\ncoca api -f\n```\n\n![API Demo](docs/sample/api.svg)\n\nWith Count\n\n```\ncoca api -r com.phodal.pholedge. -c \n```\n\nor multi package:\n\n`coca api  -r com.macro.mall.demo.controller.,com.zheng.cms.admin.,com.phodal.pholedge -c` \n\n```bash\n+------+--------+------------------------------------------------+------------------------------------------------------------------------+\n| SIZE | METHOD |                      URI                       |                                 CALLER                                 |\n+------+--------+------------------------------------------------+------------------------------------------------------------------------+\n|   36 | GET    | /aliyun/oss/policy                             | controller.OssController.policy                                        |\n|   21 | POST   | /aliyun/osscallback                            | controller.OssController.callback                                      |\n|   17 | GET    | /subject/list                                  | controller.CmsSubjectController.getList                                |\n|   17 | GET    | /esProduct/search                              | search.controller.EsProductController.search                           |\n|   17 | GET    | /order/list                                    | controller.OmsOrderController.list                                     |\n|   17 | GET    | /productAttribute/list/{cid}                   | controller.PmsProductAttributeController.getList                       |\n|   17 | GET    | /productCategory/list/{parentId}               | controller.PmsProductCategoryController.getList                        |\n|   17 | GET    | /brand/list                                    | controller.PmsBrandController.getList                                  |\n|   17 | GET    | /esProduct/search/simple                       | search.controller.EsProductController.search                           |\n+------+--------+------------------------------------------------+------------------------------------------------------------------------+\n```\n\n### Git Analysis\n\n```\ncoca git -t\n```\n\nResults: \n\n```bash\n+---------------------------------------------------------------------------------------------------------------------+-----------+-------------+\n|                                                     ENTITYNAME                                                      | REVSCOUNT | AUTHORCOUNT |\n+---------------------------------------------------------------------------------------------------------------------+-----------+-------------+\n| build.gradle                                                                                                        |      1326 |          36 |\n| src/asciidoc/index.adoc                                                                                             |       239 |          20 |\n| build-spring-framework/resources/changelog.txt                                                                      |       187 |          10 |\n| spring-core/src/main/java/org/springframework/core/annotation/AnnotationUtils.java                                  |       170 |          10 |\n| spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java                |       159 |          15 |\n| src/docs/asciidoc/web/webmvc.adoc                                                                                   |       121 |          24 |\n| spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassParser.java                   |       118 |           9 |\n| src/dist/changelog.txt                                                                                              |       118 |           9 |\n| spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupport.java       |       116 |          15 |\n| spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java        |       113 |          15 |\n| spring-web/src/main/java/org/springframework/http/HttpHeaders.java                                                  |       111 |          18 |\n| src/docs/asciidoc/web/webflux.adoc                                                                                  |       108 |          21 |\n| spring-core/src/main/java/org/springframework/core/annotation/AnnotatedElementUtils.java                            |       107 |           9 |\n| spring-test/spring-test.gradle                                                                                      |       105 |           7 |\n| spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerAdapter.java |       105 |          13 |\n| spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompBrokerRelayMessageHandler.java         |       101 |          12 |\n| spring-web/src/main/java/org/springframework/web/client/RestTemplate.java                                           |        98 |          17 |\n| spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceHttpRequestHandler.java                |        96 |          14 |\n| org.springframework.core/src/main/java/org/springframework/core/convert/TypeDescriptor.java                         |        93 |           4 |\n| spring-core/src/main/java/org/springframework/core/ResolvableType.java                                              |        92 |          10 |\n+---------------------------------------------------------------------------------------------------------------------+-----------+-------------+\n```\n\n### Concept Analyser\n\n```\ncoca concept\n```\n\nResults Examples:\n\n```\n+------------------+--------+\n|      WORDS       | COUNTS |\n+------------------+--------+\n| context          |    590 |\n| resolve          |    531 |\n| path             |    501 |\n| content          |    423 |\n| code             |    416 |\n| resource         |    373 |\n| property         |    372 |\n| session          |    364 |\n| attribute        |    349 |\n| properties       |    343 |\n| headers          |    330 |\n+------------------+--------+\n```\n\n### Count Refs\n\n```\ncoca count\n```\n\nResults:\n\n```\n+------------+--------------------------------------------------------------------------+\n| REFS COUNT |                                  METHOD                                  |\n+------------+--------------------------------------------------------------------------+\n|          2 | com.phodal.pholedge.book.BookRepository.byId                             |\n|          2 | com.phodal.pholedge.book.model.Book.toRepresentation                     |\n|          2 | com.phodal.pholedge.book.BookRepository.save                             |\n|          2 | com.phodal.coca.analysis.JavaCallApp.parse                               |\n|          2 | com.phodal.pholedge.book.BookRepository.save                             |\n|          2 | com.phodal.coca.analysis.JavaCallApp.parse                               |\n|          1 | com.phodal.pholedge.book.model.Book.save                                 |\n|          1 | evolution.analysis.jv.calls.JavaCallVisitor.parseNewType                 |\n|          1 | evolution.analysis.jv.calls.JavaCallVisitor.isNotSpecialNewWord          |\n|          1 | com.phodal.pholedge.book.BookMapper.byId                                 |\n|          1 | com.phodal.pholedge.book.BookService.updateBook                          |\n|          1 | com.phodal.pholedge.book.BookService.getBooksLists                       |\n|          1 | com.phodal.pholedge.book.BookService.getBookById                         |\n|          1 | com.phodal.pholedge.book.BookMapper.doSave                               |\n|          1 | com.phodal.pholedge.book.BookMapper.list                                 |\n|          1 | com.phodal.pholedge.book.BookService.createBook                          |\n|          1 | com.phodal.pholedge.book.BookFactory.create                              |\n|          1 | com.phodal.pholedge.book.BookRepository.list                             |\n|          1 | com.phodal.pholedge.book.model.Book.create                               |\n+------------+--------------------------------------------------------------------------+\n```\n\n### Reverse Call Graph\n\n```\ncoca rcall -c org.bytedeco.javacpp.tools.TokenIndexer.get\n```\n\nResults:\n\n```\ndigraph G { \nedge [dir=\"back\"];\n\n\"org.bytedeco.javacpp.tools.Parser.extern\" -\u003e \"org.bytedeco.javacpp.tools.Parser.declarations\";\n\"org.bytedeco.javacpp.tools.Parser.declarations\" -\u003e \"org.bytedeco.javacpp.tools.Parser.extern\";\n...\n}\n```\n\n![RCall Demo](docs/sample/rcall.svg)\n\n### Auto Refactor\n\nsupport: \n\n - rename\n - move\n - remove unused import\n - remove unused class\n\n```\ncoca refactor -R rename.coca -p src/main\ncoca refactor -m move.config -p .\n```\n\n### Evaluate\n\n```\ncoca evaluate\n```\n\nArduino Results(Old Version):\n\n```\n+--------------------------------+-------+-----------------------+-------+-----------+\n|              TYPE              | COUNT |         LEVEL         | TOTAL |   RATE    |\n+--------------------------------+-------+-----------------------+-------+-----------+\n| Nullable / Return Null         |     0 | Method                |  1615 | 0.00%     |\n| Utils                          |     7 | Class                 |   252 | 2.78%     |\n| Static Method                  |     0 | Method                |  1615 | 0.43%     |\n| Average Method Num.            |  1615 | Method/Class          |   252 |  6.408730 |\n| Method Num. Std Dev / 标准差   |  1615 | Class                 | -     |  7.344917 |\n| Average Method Length          | 13654 | Without Getter/Setter |  1100 | 12.412727 |\n| Method Length Std Dev / 标准差 |  1615 | Method                | -     | 20.047092 |\n+--------------------------------+-------+-----------------------+-------+-----------+\n```\n\nNew Version:\n\n```\n|              TYPE              | TYPE COUNT |         LEVEL         | LEVEL TOTAL | VALUE = COUNT / TOTAL |\n|--------------------------------|------------|-----------------------|-------------|-----------------------|\n| Nullable / Return Null         |          0 | Method                |           6 | 0.00%                 |\n| Utils                          |          0 | Class                 |          14 | 0.00%                 |\n| Static Method                  |          1 | Method                |           6 | 0.00%                 |\n| Average Method Num.            |          6 | Method/Class          |          14 |              0.428571 |\n| Method Num. Std Dev / 标准差   |          6 | Class                 | -           |              0.646206 |\n| Average Method Length          |          0 | Without Getter/Setter |           0 | NaN                   |\n| Method Length Std Dev / 标准差 |          0 | Method                | -           | NaN                   |\n```\n\nEvaluate.json examples\n\n```json\n{\n\t\"Nullable\": {\n\t\t\"Items\": [\n\t\t\t\"nonnull.Name.testNull\",\n\t\t\t\"nonnull.Name.orElseNull\",\n\t\t\t\"org.ofbiz.base.util.UtilURL.fromResource\",\n\t\t\t\"org.ofbiz.base.util.UtilURL.getOfbizHomeRelativeLocationFromFilePath\",\n\t\t\t\"study.huhao.demo.adapters.outbound.persistence.blog.BlogPO.toDomainModel\",\n\t\t\t\"study.huhao.demo.adapters.outbound.persistence.blog.BlogPO.toDomainModel\",\n\t\t\t\"study.huhao.demo.adapters.outbound.persistence.blog.BlogPO.of\",\n\t\t\t\"study.huhao.demo.infrastructure.persistence.blog.BlogPO.convertDomain\"\n\t\t]\n\t},\n\t\"ServiceSummary\": {\n\t\t\"LifecycleMap\": null,\n\t\t\"ReturnTypeMap\": {\n\t\t\t\"BookRepresentaion\": [\n\t\t\t\t\"com.phodal.pholedge.book.BookService.getBookById\",\n\t\t\t\t\"com.phodal.pholedge.book.BookService.updateBook\"\n\t\t\t]\n\t\t},\n\t\t\"RelatedMethod\": null\n\t},\n\t\"UtilsSummary\": {},\n\t\"Summary\": {\n\t\t\"UtilsCount\": 1,\n\t\t\"ClassCount\": 64,\n\t\t\"MethodCount\": 161,\n\t\t\"StaticMethodCount\": 19\n\t}\n}\n```\n\n### Todo\n\n```\ncoca todo\n```\n\nresults:\n\n```\n+------------+-----------------+--------------------------------+--------------------------------------------------------------------------------------+------+\n|    DATE    |     AUTHOR      |            MESSAGES            |                                       FILENAME                                       | LINE |\n+------------+-----------------+--------------------------------+--------------------------------------------------------------------------------------+------+\n| 2019-12-09 | Cristian Maglie | happens on macosx, don't know  | app/src/cc/arduino/contributions/libraries/ui/ContributedLibraryTableCellJPanel.java |  118 |\n|            |                 | why                            |                                                                                      |      |\n| 2019-12-09 | Cristian Maglie | Make this a method of Theme    | app/src/cc/arduino/contributions/libraries/ui/ContributedLibraryTableCellJPanel.java |  233 |\n| 2019-12-09 | Cristian Maglie | Do a better job in refreshing  | app/src/cc/arduino/contributions/libraries/ui/LibraryManagerUI.java                  |  241 |\n|            |                 | only the needed element        |                                                                                      |      |\n| 2019-12-09 | Cristian Maglie | Do a better job in refreshing  | app/src/cc/arduino/contributions/libraries/ui/LibraryManagerUI.java                  |  273 |\n|            |                 | only the needed element        |                                                                                      |      |\n| 2019-12-09 | Cristian Maglie | Make this a method of Theme    | app/src/cc/arduino/contributions/libraries/ui/MultiLibraryInstallDialog.java         |  149 |\n| 2019-12-09 | Cristian Maglie | happens on macosx, don't know  | app/src/cc/arduino/contributions/packages/ui/ContributedPlatformTableCellJPanel.java |  183 |\n|            |                 | why                            |                                                                                      |      |\n| 2019-12-09 | Cristian Maglie | show error                     | app/src/processing/app/Base.java                                                     | 1440 |\n| 2019-12-09 | Cristian Maglie | error when importing. ignoring | app/src/processing/app/Base.java                                                     | 2423 |\n|            |                 | :(                             |                                                                                      |      |\n| 2019-12-09 | Cristian Maglie | Improve / move error handling  | app/src/processing/app/Editor.java                                                   | 1541 |\n| 2019-12-09 | Cristian Maglie | Should be a Theme value?       | app/src/processing/app/EditorHeader.java                                             |   78 |\n| 2019-12-09 | Cristian Maglie | Should be a Theme value?       | app/src/processing/app/EditorStatus.java                                             |   73 |\n| 2019-12-09 | Cristian Maglie | Improve decoupling             | app/src/processing/app/EditorTab.java                                                |  465 |\n+------------+-----------------+--------------------------------+--------------------------------------------------------------------------------------+------+```\n```\n\n### Suggest\n\n```\ncoca suggest\n```\n\nresults:\n\n```\n+--------+------------------+--------------------------------+\n| CLASS  |     PATTERN      |             REASON             |\n+--------+------------------+--------------------------------+\n| Insect | factory          | too many constructor           |\n| Bee    | factory, builder | complex constructor, too       |\n|        |                  | many constructor, too many     |\n|        |                  | parameters                     |\n+--------+------------------+--------------------------------+\n```\n\n### Test Bad Smells\n\n```\ncoca tbs\n```\n\nresults\n\n```bash\n+---------------------+---------------------------------------------------------------+------+\n|        TYPE         |                           FILENAME                            | LINE |\n+---------------------+---------------------------------------------------------------+------+\n| DuplicateAssertTest | app/test/cc/arduino/i18n/ExternalProcessOutputParserTest.java |  107 |\n| DuplicateAssertTest | app/test/cc/arduino/i18n/ExternalProcessOutputParserTest.java |   41 |\n| DuplicateAssertTest | app/test/cc/arduino/i18n/ExternalProcessOutputParserTest.java |   63 |\n| RedundantPrintTest  | app/test/cc/arduino/i18n/I18NTest.java                        |   71 |\n| RedundantPrintTest  | app/test/cc/arduino/i18n/I18NTest.java                        |   72 |\n| RedundantPrintTest  | app/test/cc/arduino/i18n/I18NTest.java                        |   77 |\n| DuplicateAssertTest | app/test/cc/arduino/net/PACSupportMethodsTest.java            |   19 |\n| DuplicateAssertTest | app/test/processing/app/macosx/SystemProfilerParserTest.java  |   51 |\n| DuplicateAssertTest | app/test/processing/app/syntax/PdeKeywordsTest.java           |   41 |\n| DuplicateAssertTest | app/test/processing/app/tools/ZipDeflaterTest.java            |   57 |\n| DuplicateAssertTest | app/test/processing/app/tools/ZipDeflaterTest.java            |   83 |\n| DuplicateAssertTest | app/test/processing/app/tools/ZipDeflaterTest.java            |  109 |\n+---------------------+---------------------------------------------------------------+------+\n```\n\n### Find unused deps\n\n```\ncoca deps -p _fixtures/deps/maven_sample\n```\n\nresults:\n\n```\n+---------------------------+----------------------------------------+---------+\n|          GROUPID          |               ARTIFACTID               |  SCOPE  |\n+---------------------------+----------------------------------------+---------+\n| org.flywaydb              | flyway-core                            |         |\n| mysql                     | mysql-connector-java                   | runtime |\n| org.springframework.cloud | spring-cloud-starter-contract-verifier | test    |\n+---------------------------+----------------------------------------+---------+\n```\n\n## Showcases\n\nAndroid Studio Analysis Examples. Call with `lookup`: `coca call -l`\n\n![Call Examples](showcases/android-studio-call.svg)\n\n## Roadmap\n\n - bad smell support\n   - [x] sort method size\n   - type\n     - [x] longParameterList\n     - [x] longMethod\n     - [x] repeatedSwitches\n     - [x] complexIf\n     - [x] largeClass\n     - [x] refusedBequest\n     - [x] dataClass\n - CLOC\n - HTTP API Visualization\n    - [x] Spring Support\n    - [x] @Service Support\n    - [x] API Call Size\n - Git\n    - [x] Revs Counts\n    - [x] Summary\n    - [ ] [git-quick-stats](https://github.com/arzzen/git-quick-stats)\n - Concept\n    - [x] words NLP\n    - [ ] to domain        \n - Call \u0026 rcall graph\n    - [x] Count Refs\n - AutoRefactor\n   - [x] remove unused\n   - [x] move files\n - Evaluate\n   - [x] nullable count\n   - [x] static count\n   - [x] method num /length count\n - Todo Summary\n    - [x] Todo with History \u0026 Author   \n - Suggest API for Design Patterns\n   - [x] factory pattern\n   - [x] strategy \n   - [x] builder\n   - [ ] cycle-deps -\u003e adapter / agency\n   - [ ] bad patterns\n       - [ ] singleton\n -  Evaluate API\n    - [x] Average Method Length\n    - [x] Average Class Method Count\n - Tests\n    - [ ] Testable?\n    - [x] Test badsmell -\u003e list [https://testsmells.github.io/pages/testsmells.html]\n      - [x] IgnoreTest: @Ingore\n      - [x] EmptyTest: not call in test\n      - [x] RedundantPrintTest: system.out.println\n      - [x] SleepyTest: Time.sleep\n      - [x] RedundantAssertionTest: assertTrue(True) \n      - [x] UnknownTest: not assert\n      - [x] DuplicateAssertTest: assert \u003e 5\n      - [ ] TestersOnly: method only call by test\n      - [ ] CrossBorderTest: test method which not in system\n      - [ ] General Fixture: JUnit classes having at least one method not using the entire test fixture defined in the setUp() method\n - Arch\n    - [x] Architecture Visualization\n    - [ ] Architecture Guard\n      - [ ] DSL Design\n - Tech Debt from Source Code\n    - [ ] auto create story\n - TBD\n    - Comment Analysis\n      - [ ] incorrect comment ? http://das.encs.concordia.ca/uploads/2018/02/Maldonado_thesis.pdf\n - ~~Online Code Analysis~~\n    - [x] ~~WASM support~~\n    - [ ] ~~expose WASM API~~\n    - [ ] ~~GitHub search code~~\n - [ ] ~~Pluggable~~\n    - [ ] ~~plugin support (Windows Issues)~~\n - [x] Dependence Analysis\n    - [ ] Deps Related Counts\n    - [x] 3rd-party analysis XML or Groovy Scripts\n    - [x] Groovy Support\n      - [x] migrate to Golang Styles\n - [ ] Story Cmd\n    - [ ] Auto create refactor story\n - [ ] Clean Code Suggest\n    - [ ] JavaScript Version [clean-code-javascript](https://github.com/ryanmcdermott/clean-code-javascript)\n - [ ] More CodeSmells\n    - [ ] Source [DesigniteJava](https://github.com/tushartushar/DesigniteJava)\n\nDocuments Todo:\n\n - [ ] Docs\n    - [ ] Lifecycle for new projects: evaluate (cloc, bad smell, api, git, todo) -\u003e design -\u003e patterns (suggest) -\u003e refactoring ()\n - Date Collections\n    - [ ] monolithic\n    - [ ] microservice \n    - [ ] big data\n\nTech Debt\n\n - Test for Windows\n - Duplicate Code\n   - cmd/ -\u003e user builder to refactoring\n\n## Dev\n\nInstall Go\n\n```bash\nbrew install go\n```\n\nEnv\n\n```bash\nexport GOROOT=/usr/local/opt/go/libexec\nexport GOPATH=$HOME/.go\nexport PATH=$PATH:$GOROOT/bin:$GOPATH/bin\n```\n\nclone\n\n```\ngit clone https://github.com/modernizing/coca\n```\n\nTest Frameworks\n\n```\ngo get github.com/onsi/ginkgo\ngo get github.com/onsi/gomega\n```\n\nLicense\n---\n\nArch based on [Tequila](https://github.com/newlee/tequila)\n\nGit Analysis inspired by [Code Maat](https://github.com/adamtornhill/code-maat)\n\nTest bad smells inspired by [Test Smell Examples](https://testsmells.github.io/pages/testsmellexamples.html)\n\n[![Phodal's Idea](http://brand.phodal.com/shields/idea-small.svg)](http://ideas.phodal.com/)\n\n@ 2019 A [Phodal Huang](https://www.phodal.com)'s [Idea](http://github.com/phodal/ideas).  This code is distributed under the MPL license. See `LICENSE` in this directory.\n","funding_links":[],"categories":["Misc","开源类库","Open source library","Go"],"sub_categories":["代码分析","Code Analysis"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphodal%2Fcoca","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphodal%2Fcoca","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphodal%2Fcoca/lists"}