GithubHelp home page GithubHelp logo

archguard / scanner Goto Github PK

View Code? Open in Web Editor NEW
29.0 29.0 7.0 12.57 MB

ArchGuard Scanner for scan Git change history, scan source code by Chapi for Java, TypeScript, Kotlin, Go..、Java bytecode use for JVM languages, scan Jacoco test coverage.

License: MIT License

Kotlin 87.32% Java 8.76% Shell 0.26% Go 0.07% TypeScript 2.32% JavaScript 0.08% Scala 0.04% C# 1.14% Python 0.01%

scanner's Introduction

ArchGuard backend

CI codecov GitHub release languages Java support License Gitpod Ready-to-Code Maven Central

ArchGuard is an architecture governance tool that can analysis architecture in container, component, code level, database, create architecture fitness functions, and test for architecture rules.

Chinese: ArchGuard 是一个针对于微服务(分布式场景)下的架构工作台/治理工具。它可以帮助架构师、开发人员进行架构自助,自定义架构的洞察、 分析系统间的远程服务依赖情况、数据库依赖、API 依赖等。并根据一些架构治理模型,对现有系统提出改进建议。

Architecture

特性(Features):

  • 设计态
  • 开发态
    • 架构扫描
      • 扫描配置
      • 插件化规则定制
      • 规则化治理:Code Smell, Test Code Smell, SQL Smell, API Smell, Documentation Smell, etc.
    • 架构可视化
      • 基于 C4 模型的可视化分析
        • 上下文:API 服务地图(API 生产者支持语言:Java、Kotlin、C#,API 消费者支持语言:TypeScript/JavaScript、Kotlin、Java 等)
        • 容器分析。数据库地图(支持 MyBatis、JDBI、JPA)
        • 组件分析
        • 代码分析:支持级别模块、包、类、方法四个级别。
      • 高级分析 + 可视化
        • 系统不稳定性模块分析。
        • 容器间:精准测试/变化分析
    • 架构指标(单体DONE,分布式DOING)
      • 体量维度:过大的组件
      • 耦合维度:枢纽组件,过深调用,循环依赖
      • 内聚维度:霰弹式修改
      • 冗余维度:冗余元素,过度泛化
      • 质量维度:测试保护
    • 代码分析
      • CLOCO:代码复杂度 #79
      • SCA 分析
      • OpenAPI 分析
      • Architecture analysis
  • 运行态
    • APM(TODO)
  • 架构工作台

Features:

  • Design State
  • Development state
    • Schema scan
      • Scan configuration
      • Plug-in rule customization
      • Rule-based governance: Code Smell, Test Code Smell, SQL Smell, API Smell, Documentation Smell, etc.
    • Architecture visualization
      • Visual analysis based on C4 model
        • Context: API service map (API producer supported languages: Java, Kotlin, C#, API consumer supported languages: TypeScript/JavaScript, Kotlin, Java, etc.)
        • Container analysis. Database map (support MyBatis, JDBI, JPA)
        • Component analysis
        • Code analysis: supports four levels of modules, packages, classes, and methods.
      • Advanced Analysis + Visualization
        • System instability module analysis.
        • Between containers: precise testing/variation analysis
    • Architecture metrics (single DONE, distributed DOING)
      • Volume dimension: oversize components
      • Coupling dimension: hub components, too deep calls, circular dependencies
      • Cohesive Dimension: Shotgun Modification
      • Redundant dimensions: redundant elements, overgeneralization
      • Quality dimension: test protection
      • Continuous Integration
    • External analysis
      • CLOCO: Code Complexity #79
      • SCA analysis
      • OpenAPI analysis
      • Architecture analysis
  • Running state
    • APM (TODO)
  • Architecture Workbench

Screenshots:

1 2
3 4

Languages parse by Chapi

Features/Languages Java Python Go Kotlin TypeScript C C# Scala C++
http api decl 🆕 🆕 🆕 🆕 🆕
syntax parse 🆕
function call 🆕
arch/package 🆕
real world validate

Custom Backend

case example:

use Scanner CLI you can customize your backend. For more detail, see in: ArchGuardHttpClient

HTTP examples:

POST http://127.0.0.1:8765/scanner/:systemId/reporting/class-items

POST http://127.0.0.1:8765/scanner/:systemId/reporting/openapi

POST http://127.0.0.1:8765/scanner/:systemId/reporting/container-services

POST http://127.0.0.1:8765/scanner/:systemId/reporting/datamap-relations

...

Chat

关注我们:

wechat

欢迎加入我们:

wechat

(PS:如果群满,请添加微信 phodal02,并注明 ArchGuard)

Thanks

JetBrains support:

JetBrains Logo (Main) logo

License

This code is distributed under the MIT license. See LICENSE in this directory.

scanner's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

scanner's Issues

Multiple dataformat support for output

Describe the solution you'd like

  • output API in csv for analysis in Excel

Describe alternatives you've considered

  • create a Data convert in other module

Additional context
Add any other context or screenshots about the feature request here.

Look me:ArchGuard 部署搭建 —— help !!!

本人小白一枚,最近刚刚接触ArchGuard,在部署搭建过程中遇到一些问题,麻烦大佬们各显神通,救救小菜鸡。
以下操作按照READ.ME进行,如有理解不当,还请大家多多指教。
ArchGuard scanner - scan source code, binary data and othes, and feed to database.
ArchGuard frontend - visualization results & dashboard
ArchGuard backend - connect scanner and show data.

ArchGuard scanner

scan_git

执行./gradlew :scan_git:run --args="--path=xxx(自己代码仓地址)",出现以下错误

Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

* Where:
Build file '/5g_build/5g_Main/scanner/diff_changes/build.gradle.kts' line: 1

* What went wrong:
Plugin [id: 'org.jetbrains.kotlin.jvm', version: '1.6.10'] was not found in any of the following sources:

- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.6.10')
  Searched in the following repositories:
    Gradle Central Plugin Repository

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 3m 8s

scan_sourcecode

执行java "-Ddburl=jdbc:mysql://localhost:3306/archguard?user=root&password=&useSSL=false" -jar scan_sourcecode-1.1.7-all.jar --system-id=8 --path=scan_git --language=kotlin,出现以下错误

ssword=&useSSL=false" -jar scan_sourcecode-1.1.7-all.jar --system-id=8 --path=scan_git --language=kotlin
Error: Unable to access jarfile scan_sourcecode-1.1.7-all.jar

Arch as Code

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Code Structure Style Identify

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Design a structured scanner:auto attach language,dynamic load libs,nested scanner

Is your feature request related to a problem? Please describe.
No

Describe the solution you'd like
探针+扫描器

Describe alternatives you've considered
探针扫描语言和项目结构,判断是否适用该扫描器
扫描器执行扫描(基于接口)
扫描器可以嵌套,例如kotlin嵌套spring嵌套jpa

Additional context
插件化 pipeline filter模式

Data too long for column 'key' at row 。。。。

1、Download scan_sourcecode-1.4.3-all.jar
2、create database archguard
3、start archguard-1.5.1.jar by use java -jar to create tables
4、use java "-Ddburl=jdbc:mysql://localhost:3306/archguard?user=root&password=&useSSL=false" -jar scan
_sourcecode-1.4.3-all.jar --system-id=6 --language=java --path=. to scan soucecode

appear exception info at last
org.jdbi.v3.core.statement.UnableToExecuteStatementException: java.sql.BatchUpdateException: Data truncation: Data
too long for column 'key' at row 115 [statement:"null", rewritten:"null", parsed:"null", arguments:{positional:{}, name
d:{}, finder:[]}]

refactor Rule with visitor patterns

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.