Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: ECA: Event - Condition - Action 3.1.8 Minor update available for module eca (3.1.8). Release: Kordiam 1.0.14 Minor update available for module kordiam (1.0.14). Release: WissKI 8.x-4.4 Minor update available for module wisski (8.x-4.4). Release: AI Empathy Evaluation 1.3.0 Minor update available for module ai_empathy (1.3.0). Release: Zefix 1.0.5 Minor update available for module zefix (1.0.5). Release: Ui Suite Dsfr 1.15.2 Minor update available for theme ui_suite_dsfr (1.15.2). Release: Behat javascript 1.2.0 Minor update available for module behat_javascript (1.2.0). Release: Canvas Map 1.0.1 Minor update available for module canvas_map (1.0.1). Usage Milestone: Term CSV Export Import Module term_csv_export_import crossed 1,000 active installs. Module Revived: Behat javascript 1.2.1 Module behat_javascript updated after 23 months of inactivity (1.2.1).

ai_refactor

No security coverage

Part of the AI ecosystem · 302 projects

View on drupal.org

AIRefactor uses AI to analyze and automatically refactor PHP methods within Drupal. It provides code comparisons and optimizations via Drush commands, helping to improve code readability and performance.

Welcome to AIRefactor — Your Intelligent Code Refactoring Companion!

Transform the way you maintain and enhance your codebase with AIRefactor, the smart assistant that leverages AI to analyze, refactor, and optimize your PHP methods directly within Drupal. No more tedious code reviews or manual optimizations—let AIRefactor handle the heavy lifting and bring your code into the modern age!

Why Choose AIRefactor?

  • AI-Powered Insights – Harness the power of AI to detect code improvements and automatically refactor methods, enhancing readability and performance.
  • Instant Code Analysis – With just a Drush command, analyze and refactor entire files, all while receiving helpful code comparisons and suggested optimizations.
  • Drupal 10 Ready – Built to integrate seamlessly with Drupal 10, AIRefactor updates your code to align with the latest standards and practices.
  • Easy Confirmation Process – Preview refactored code side-by-side with the original, so you stay in control of every change.

🔐 Authentication Requirement

To use AIRefactor, you must provide a valid OpenAI API key. This key should be created at OpenAI's API Key Settings page.

Once you have your key, add it in the following locations within your Drupal admin:

  • System Keys: /admin/config/system/keys – Create a key entry named openai_api_key (or as configured).
  • OpenAI Provider Settings: /admin/config/ai/providers/openai – Select the appropriate key and model settings to enable the integration.

🚀 How It Works 🚀

Using AIRefactor is as easy as a Drush command:

drush ai_refactor:analyze path/to/your/file.php

AIRefactor analyzes each method in the specified file, identifies opportunities for improvement, and presents you with optimized alternatives using OpenAI's capabilities.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Nov 2024
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 2
Maintenance
Dormant

Releases

Version Type Core Release date
1.1.x-dev Dev 10–11 Nov 8, 2024
1.0.x-dev Dev 10 Nov 7, 2024