Giter Club home page Giter Club logo

rexfactor's Introduction

REDAXO-AddOn: rexfactor

Adds automated code upgrades to REDAXO improving developer productivity and code quality.

The AddOn integrates rector with the developer in mind, meaning it eases use for often used migration/upgrade use-cases. If you are a rector expert you don't need this AddOn.

Primary purpose is to allow people less experienced with developer tooling to automate migration tasks.

Users apply the changes after a preview in a diff view.

use cases

PHP Version Migrations

This use case helps updating the PHP version used in a project to a newer one according to the official php.net migration guide. This can involve migrating code to be compatible with the new version and updating any deprecated features to the recommended replacements.

Improve Code Quality

  • Unify Code Quality: In this use case, the goal is to ensure that all code in a project adheres to the same coding standards and best practices.

  • Remove Dead Code: This use case involves identifying and removing code that is no longer used or needed in the codebase.

  • Infer Type Declarations: In this use case, the goal is to automatically infer native return-types or parameter-types of methods&functions in the codebase.

  • Reduce Symbol Visibility (Privatization): This use case involves reducing the visibility of symbols in the codebase to ease future refactoring and reduce the chance of unintended use.

  • Use Early Returns: In this use case, the goal is to reduce the complexity of code by using early returns.

PHPUnit Version Migrations:

This use cases involve updating the version of PHPUnit used in a project to a newer one. This can involve migrating test code to be compatible with the new version and updating any deprecated features to the recommended replacements.

These migrations are only available to AddOns which contain a tests/ folder.

Improve Test-Code Quality:

This use cases involve improving the quality of test code by making it more maintainable, readable, and efficient. This can include refactoring existing test code to follow best practices, removing duplication, and improving the structure of test suites.

These migrations are only available to AddOns which contain a tests/ folder.

Misc

  • REDAXO Specific Code Style: This use case ensures that code written follows the REDAXO code style guidelines. This can include adhering to naming conventions, using appropriate formatting, and following the coding standards recommended by the REDAXO community.

  • More Explicit Coding Style: This use case involves ensuring that code is written in a more explicit and clear manner, so that it is easier to read and maintain. This can include using more descriptive variable names, avoiding ambiguous function names, and using appropriate comments.

rexfactor's People

Contributors

aeberhard avatar bloep avatar dependabot[bot] avatar michael-kreatif avatar skerbis avatar staabm avatar

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

michael-kreatif

rexfactor's Issues

error while exceuting

Error while running any option on addon adminer.

InvalidArgumentException: Invalid json: Syntax error
File: redaxo/src/addons/rexfactor/lib/RectorResult.php
Line: 16

Stacktrace
Function File Line
rexfactor\RectorResult->__construct redaxo/src/addons/rexfactor/lib/RexFactor.php 127
rexfactor\RexFactor::runRexFactor redaxo/src/addons/rexfactor/pages/preview.php 43
require redaxo/src/core/lib/packages/package.php 233
rex_package->includeFile redaxo/src/core/lib/be/controller.php 505
rex_be_controller::{closure} redaxo/src/core/lib/util/timer.php 62
rex_timer::measure redaxo/src/core/lib/be/controller.php 487
rex_be_controller::includePath redaxo/src/core/lib/be/controller.php 453
rex_be_controller::includeCurrentPageSubPath redaxo/src/addons/rexfactor/pages/index.php 7
require redaxo/src/core/lib/packages/package.php 233
rex_package->includeFile redaxo/src/core/lib/be/controller.php 505
rex_be_controller::{closure} redaxo/src/core/lib/util/timer.php 62
rex_timer::measure redaxo/src/core/lib/be/controller.php 487
rex_be_controller::includePath redaxo/src/core/lib/be/controller.php 436
rex_be_controller::includeCurrentPage redaxo/src/core/backend.php 241
require redaxo/src/core/boot.php 155
require redaxo/index.php 9
System report (REDAXO 5.15.1, PHP 8.2.0, MySQL 5.7.39)
REDAXO
Version 5.15.1
PHP
Version 8.2.0
OPcache no
Xdebug no
Database
Version MySQL 5.7.39
Character set utf8mb4
Server
OS Darwin
SAPI cgi-fcgi
Webserver Apache/2.4.54
Request
Browser Chrome/113.0.0.0
Protocol HTTP/1.1
HTTPS yes
Packages
adminer 1.9.2
backup 2.9.0
be_style 3.2.0
be_style/redaxo 3.2.0
cke5 5.2.0
cronjob 2.10.0
developer 3.9.1
focuspoint 4.0.2
gridblock 1.1.6
gridblock/contentsettings 1.6.2
gridblock/synchronizer 1.0
install 2.11.1
maintenance 2.8.5
mblock 3.4.7
media_manager 2.14.0
mediapool 2.13.0
metainfo 2.10.0
mform 7.2.2
navigation_array 1.2.1
phpmailer 2.12.0
project dev
rexfactor 0.1
structure 2.15.0
structure/content 2.15.0
theme_lock 1.0.0
uikit_collection 3.0.6
users 2.10.0
yform 4.0.4
yform/email 4.0.4
yform/manager 4.0.4
yrewrite 2.9.1

Type coverage erklären

Feature description / Feature Beschreibung

Die Qualität der refacotrings ist abhängig von nativem type coverage, was mit rexstan messbar ist.

Diesen Zusammenhang erklären

blockierenden loader verwenden nach use-case wahl

Feature description / Feature Beschreibung
damit der user merkt dass man nach wahl des use-case warten muss, weil der prozess bereits läuft (aber rector ein paar sekunden brauch, je nach anzahl der zu verarbeitenden addons)

Allow to blacklist certain rules

Feature description / Feature Beschreibung

Bei unify code quality gibts manchmal noch bei uns intern Diskussions-Spielraum, welche Syntax besser ist…
z.B.
count($array) -> wird zu $array !== []…oder
‘test’ === $value möchte er auch umschreiben
haben uns gewöhnt, bei statischen Prüfungen immer links den statischen Wert zu haben, um die Prüfung schneller lesen zu können

blacklisting certain rules out of a set could help to allow use of the pre-configured sets even though the rexfactor user does not like a few rules

test with dark mode

Feature description / Feature Beschreibung

Bekannte probleme

  • diff Ansicht

Default Target PHP setzen

vielleicht automatisch direkt auf die Mindest-Version der aktuell verwendeten REDAXO-Version oder des AddOns (package.yml)

Reduce symbol visibility (privatization) - Änderung von protected -> private bei Commands wird vorgeschlagen und führt zu Fehler bei rexstan

Description / Beschreibung
rexfactor schlägt folgende Änderungen vor

image

Das führt dann in rexstan zu folgendem Fehler:

image

Affected versions / Verwendete Versionen*

System report (REDAXO 5.15.1, PHP 8.2.0, MariaDB 10.4.14)
REDAXO
Version 5.15.1
PHP
Version 8.2.0
OPcache no
Xdebug no
Database
Version MariaDB 10.4.14
Character set utf8mb4
Server
OS WINNT
SAPI cgi-fcgi
Webserver Apache/2.4.46
Request
Browser Chrome/111.0.0.0
Protocol HTTP/1.1
HTTPS yes
Packages
adminer 1.9.3
backup 2.9.0
be_style 3.2.0
be_style/customizer 3.2.0
be_style/redaxo 3.2.0
consent_manager 5.0.0
cronjob 2.10.0
demo_fullpage 2.0.8
developer 3.9.2
for_sa11y 0.1.0
install 2.11.1
media_manager 2.14.0
mediapool 2.13.0
metainfo 2.10.0
project dev
rexfactor 0.1.5
rexstan 1.0.109
structure 2.15.0
structure/content 2.15.0
users 2.10.0

use-case beschreibung

Feature description / Feature Beschreibung
kurz beschreibung was die use-cases tun und was das ziel ist des use-cases

Whoops bei Unify code quality

Whoops bei Unify code quality

image

REDAXO: siehe unten System-Report ...
PHP:
Database:
Browser:
AddOns:

Did it whoops? / Whoops erhalten? Ja

Habe per dump rausgefunden dass im JSON eine Warning ausgegeben wird.

image2

Evtl. kann man ja die Warnings per Option unterdrücken bzw. gibt es auch eine Option für InlineHTML

In der theme.php ist HTML sowie auch CSS und JavaScript vorhanden.

InvalidArgumentException: Invalid json: Syntax error
File: redaxo\src\addons\rexfactor\lib\RectorResult.php
Line: 24

Stacktrace
Function File Line
rexfactor\RectorResult->__construct redaxo\src\addons\rexfactor\lib\RexFactor.php 150
rexfactor\RexFactor::runRexFactor redaxo\src\addons\rexfactor\pages\preview.php 53
require redaxo\src\core\lib\packages\package.php 233
rex_package->includeFile redaxo\src\core\lib\be\controller.php 503
rex_be_controller::{closure} redaxo\src\core\lib\util\timer.php 56
rex_timer::measure redaxo\src\core\lib\be\controller.php 485
rex_be_controller::includePath redaxo\src\core\lib\be\controller.php 453
rex_be_controller::includeCurrentPageSubPath redaxo\src\addons\rexfactor\pages\index.php 13
require redaxo\src\core\lib\packages\package.php 233
rex_package->includeFile redaxo\src\core\lib\be\controller.php 503
rex_be_controller::{closure} redaxo\src\core\lib\util\timer.php 56
rex_timer::measure redaxo\src\core\lib\be\controller.php 485
rex_be_controller::includePath redaxo\src\core\lib\be\controller.php 436
rex_be_controller::includeCurrentPage redaxo\src\core\backend.php 241
require redaxo\src\core\boot.php 155
require redaxo\index.php 9
System report (REDAXO 5.15.1, PHP 8.2.0, MariaDB 10.4.14)
REDAXO
Version 5.15.1
PHP
Version 8.2.0
OPcache no
Xdebug no
Database
Version MariaDB 10.4.14
Character set utf8mb4
Server
OS WINNT
SAPI cgi-fcgi
Webserver Apache/2.4.46
Request
Browser Chrome/114.0.0.0
Protocol HTTP/1.1
HTTPS yes
Packages
aceeditor 1.2.1
activity_log 0.0.2
adminer 1.9.3
backup 2.9.0
be_style 3.2.0
be_style/customizer 3.2.0
be_style/redaxo 3.2.0
cheatsheet 0.0.1
consent_manager 4.1.4
cronjob 2.10.0
demo_addon 1.3.0
insert_text 2.0.1
install 2.11.1
media_manager 2.14.0
mediapool 2.13.0
metainfo 2.10.0
phpmailer 2.12.0
properties 1.3.3
rex_gitapi 0.0.1
rexfactor 0.1.11
rexstan 1.0.121
sprog 1.5.1
structure 2.15.0
structure/content 2.15.0
thumbhash 1.0.0
users 2.10.0

onboarding

Feature description / Feature Beschreibung
den prozess des addons/das vorgehen wie man es bedienen sollte skizzieren/erklären

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.