# ming1016/smcheckproject architecture

> Architecture diagram of the GitHub repository ming1016/smcheckproject, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ming1016/smcheckproject
- Repository: https://github.com/ming1016/smcheckproject

## Overview

##### Main Components

a. Core Processing Components:
- File Scanner System
- Parser System
- Method Analysis System
- Code Cleaning System

b. Data Models:
- File Structure Model
- Method Structure Model
- Import Structure Model
- Object Structure Model

##### File Processing
- File Scanner (CleanUnusedImports.swift)
- File Tree Walker
- File Content Reader

##### Parsing System
- Base Parser (ParsingBase.swift)
- Specialized Parsers:
- Import Parser (ParsingImport.swift)
- Interface Parser (ParsingInterface.swift)
- Implementation Parser (ParsingImplementation.swift)
- Method Parser (ParsingMethod.swift)
- Property Parser (ParsingProperty.swift)
- Protocol Parser (ParsingProtocol.swift)
- Macro Parser (ParsingMacro.swift)

##### Analysis System
- Method Detection
- Usage Analysis
- Dependency Tracker

##### Cleaning System
- Code Modifier
- Comment Generator
- File Writer

##### Technical Details

Key data structures:
**File {**
- type: FileType
- name: String
- content: String
- methods: [Method]
- imports: [Import]
**}**

**Method {**
- classMethodTf: Bool
- returnType: String
- params: [MethodParam]
- usedMethod: [Method]
- filePath: String
- pnameId: String
**}**

##### Process Flow Notes

Annotations showing:

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Input
        ProjectFiles[Project Files]:::input
    end

    subgraph "File Scanner System"
        FileScanner["File Scanner"]:::scanner
        FileTreeWalker["File Tree Walker"]:::scanner
        FileReader["File Content Reader"]:::scanner
    end
    click FileScanner "https://github.com/ming1016/SMCheckProject/blob/master/SMCheckProject/CleanUnusedImports.swift"
    click FileTreeWalker "https://github.com/ming1016/SMCheckProject/blob/master/SMCheckProject/File.swift"
    click FileReader "https://github.com/ming1016/SMCheckProject/blob/master/SMCheckProject/File.swift"

    subgraph "Parser System"
        BaseParser["Base Parser"]:::parser
        subgraph "Specialized Parsers"
            ImportParser["Import Parser"]:::parser
            InterfaceParser["Interface Parser"]:::parser
            ImplementationParser["Implementation Parser"]:::parser
            MethodParser["Method Parser"]:::parser
            PropertyParser["Property Parser"]:::parser
            ProtocolParser["Protocol Parser"]:::parser
            MacroParser["Macro Parser"]:::parser
            MethodContentParser["Method Content Parser"]:::parser
        end
    end
    click BaseParser "https://github.com/ming1016/SMCheckProject/blob/master/SMCheckProject/ParsingBase.swift"
    click ImportParser "https://github.com/ming1016/SMCheckProject/blob/master/SMCheckProject/ParsingImport.swift"
    click InterfaceParser "https://github.com/ming1016/SMCheckProject/blob/master/SMCheckProject/ParsingInterface.swift"
    click ImplementationParser "https://github.com/ming1016/SMCheckProject/blob/master/SMCheckProject/ParsingImplementation.swift"
    click MethodParser "https://github.com/ming1016/SMCheckProject/blob/master/SMCheckProject/ParsingMethod.swift"
    click PropertyParser "https://github.com/ming1016/SMCheckProject/blob/master/SMCheckProject/ParsingProperty.swift"
    click ProtocolParser "https://github.com/ming1016/SMCheckProject/blob/master/SMCheckProject/ParsingProtocol.swift"
    click MacroParser "https://github.com/ming1016/SMCheckProject/blob/master/SMCheckProject/ParsingMacro.swift"
    click MethodContentParser "https://github.com/ming1016/SMCheckProject/blob/master/SMCheckProject/ParsingMethodContent.swift"

    subgraph "Analysis System"
        MethodDetection["Method Detection"]:::analysis
        UsageAnalysis["Usage Analysis"]:::analysis
        DependencyTracker["Dependency Tracker"]:::analysis
    end
    click MethodDetection "https://github.com/ming1016/SMCheckProject/blob/master/SMCheckProject/CleanUnusedMethods.swift"
    click UsageAnalysis "https://github.com/ming1016/SMCheckProject/blob/master/SMCheckProject/CleanUnusedMethods.swift"
    click DependencyTracker "https://github.com/ming1016/SMCheckProject/blob/master/SMCheckProject/CleanUnusedMethods.swift"

    subgraph "Cleaning System"
        CodeModifier["Code Modifier"]:::cleaning
        CommentGenerator["Comment Generator"]:::cleaning
        FileWriter["File Writer"]:::cleaning
    end
    click CodeModifier "https://github.com/ming1016/SMCheckProject/blob/master/SMCheckProject/CleanUnusedMethods.swift"
    click CommentGenerator "https://github.com/ming1016/SMCheckProject/blob/master/SMCheckProject/CleanUnusedMethods.swift"
    click FileWriter "https://github.com/ming1016/SMCheckProject/blob/master/SMCheckProject/CleanUnusedMethods.swift"

    subgraph "Data Models"
        FileModel["File Structure Model"]:::model
        MethodModel["Method Structure Model"]:::model
        ImportModel["Import Structure Model"]:::model
    end
    click FileModel "https://github.com/ming1016/SMCheckProject/blob/master/SMCheckProject/File.swift"

    subgraph "User Interface"
        ViewController["View Controller"]:::ui
        DragView["Drag View"]:::ui
        MainStoryboard["Main Storyboard"]:::ui
    end
    click ViewController "https://github.com/ming1016/SMCheckProject/blob/master/SMCheckProject/ViewController.swift"
    click DragView "https://github.com/ming1016/SMCheckProject/blob/master/SMCheckProject/DragView.swift"
    click MainStoryboard "https://github.com/ming1016/SMCheckProject/blob/master/SMCheckProject/Base.lproj/Main.storyboard"

    subgraph Output
        CleanedFiles["Cleaned Project Files"]:::output
    end

    %% Connections
    ProjectFiles --> FileScanner
    FileScanner --> FileTreeWalker
    FileTreeWalker --> FileReader
    FileReader --> BaseParser
    BaseParser --> ImportParser & InterfaceParser & ImplementationParser & MethodParser & PropertyParser & ProtocolParser & MacroParser & MethodContentParser
    ImportParser & InterfaceParser & ImplementationParser & MethodParser & PropertyParser & ProtocolParser & MacroParser & MethodContentParser --> MethodDetection
    MethodDetection --> UsageAnalysis
    UsageAnalysis --> DependencyTracker
    DependencyTracker --> CodeModifier
    CodeModifier --> CommentGenerator
    CommentGenerator --> FileWriter
    FileWriter --> CleanedFiles

    %% Data Model Connections
    FileReader --> FileModel
    MethodParser --> MethodModel
    ImportParser --> ImportModel

    %% UI Connections
    ViewController --> FileScanner
    DragView --> ViewController

    %% Styles
    classDef input fill:#a8d1ff,stroke:#333,stroke-width:2px
    classDef output fill:#a8d1ff,stroke:#333,stroke-width:2px
    classDef scanner fill:#90EE90,stroke:#333,stroke-width:2px
    classDef parser fill:#98FB98,stroke:#333,stroke-width:2px
    classDef analysis fill:#FFD700,stroke:#333,stroke-width:2px
    classDef cleaning fill:#FF6B6B,stroke:#333,stroke-width:2px
    classDef model fill:#D3D3D3,stroke:#333,stroke-width:2px
    classDef ui fill:#DDA0DD,stroke:#333,stroke-width:2px
```
