Skip to content

Conversation

@aicodeguard
Copy link
Owner

@aicodeguard aicodeguard commented Apr 2, 2025

PR Type

enhancement, bug_fix


Description

  • Refactor and enhance language handling logic

  • Improve code analysis with new AST parsing methods

  • Add detailed logging and error handling in core analyzer

  • Simplify and optimize token handling logic


Changes walkthrough 📝

Relevant files
Enhancement
language_handler.py
Refactor language handling and file sorting logic               

ai_review/algo/language_handler.py

  • Refactor language handling with new data structures
  • Add functions for file extension and bad extension filtering
  • Improve file sorting by language
  • +96/-51 
    token_handler.py
    Simplify and optimize token handling logic                             

    ai_review/algo/token_handler.py

  • Simplify TokenHandler initialization
  • Improve token counting logic
  • Add detailed docstrings
  • +29/-31 
    utils.py
    Remove unused utilities and optimize imports                         

    ai_review/algo/utils.py

    • Remove unused utility functions
    • Clean up and optimize imports
    +0/-1080
    ast_parser.py
    Enhance AST analysis with complexity and usage checks       

    ai_review/analyzers/ast_parser.py

  • Enhance AST analysis with new methods
  • Add complexity calculation and unused variable checks
  • Improve docstrings and type annotations
  • +63/-14 
    analyzer.py
    Add logging and enhance rule execution in analyzer             

    ai_review/core/analyzer.py

  • Add detailed logging and error handling
  • Use dataclass for findings representation
  • Improve rule loading and execution logic
  • +82/-29 

    Need help?
  • Type /help how to ... in the comments thread for any questions about CodeGuard usage.
  • Check out the documentation for more information.
  • Signed-off-by: aicodeguard <zifeiyu19980606@gmail.com>
    Signed-off-by: aicodeguard <zifeiyu19980606@gmail.com>
    Signed-off-by: aicodeguard <zifeiyu19980606@gmail.com>
    Signed-off-by: aicodeguard <zifeiyu19980606@gmail.com>
    @codeprotai codeprotai bot added enhancement New feature or request bug_fix labels Apr 2, 2025
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Labels

    bug_fix enhancement New feature or request

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    2 participants