All Projects → Tuurlijk → Typo3scan

Tuurlijk / Typo3scan

Licence: mit
Scans TYPO3 extensions for usage of deprecated and or changed code

Projects that are alternatives of or similar to Typo3scan

Dalfox
🌘🦊 DalFox(Finder Of XSS) / Parameter Analysis and XSS Scanning tool based on golang
Stars: ✭ 791 (+853.01%)
Mutual labels:  cli-app, scanner
Mod0burpuploadscanner
HTTP file upload scanner for Burp Proxy
Stars: ✭ 315 (+279.52%)
Mutual labels:  extension, scanner
typo3-dp cookieconsent
TYPO3 Extension: Enable a cookie consent box. Let you visitors control the usage of cookies and load script or content after a consent. (ePrivacy, TTDSG)
Stars: ✭ 28 (-66.27%)
Mutual labels:  extension, typo3
Calendarize
📆 Best TYPO3 Calendar ever 📆
Stars: ✭ 57 (-31.33%)
Mutual labels:  typo3, extension
Webhackersweapons
⚔️ Web Hacker's Weapons / A collection of cool tools used by Web hackers. Happy hacking , Happy bug-hunting
Stars: ✭ 1,205 (+1351.81%)
Mutual labels:  scanner
Delay Cli
Delay execution for a given amount of seconds
Stars: ✭ 74 (-10.84%)
Mutual labels:  cli-app
Deadtrap
An OSINT tool to gather information about the real owner of a phone number
Stars: ✭ 73 (-12.05%)
Mutual labels:  scanner
Survivio Plus
Easy chicken dinners, the hax way.
Stars: ✭ 72 (-13.25%)
Mutual labels:  extension
Hippo
PHP standards checker.
Stars: ✭ 82 (-1.2%)
Mutual labels:  code-quality
Obsidian Clipper
A Chrome extension that easily clips selections to Obsidian
Stars: ✭ 80 (-3.61%)
Mutual labels:  extension
Signature Base
Signature base for my scanner tools
Stars: ✭ 1,212 (+1360.24%)
Mutual labels:  scanner
Uget Chrome Wrapper
Moved to https://github.com/ugetdm/uget-integrator and https://github.com/ugetdm/uget-extension
Stars: ✭ 74 (-10.84%)
Mutual labels:  extension
Surf
Easy and powerful PHP deployment tool
Stars: ✭ 79 (-4.82%)
Mutual labels:  typo3
Echofon Firefox Unofficial
Echofon Unofficial - maintained version of Echofon: full featured, super clean Twitter app for Firefox.
Stars: ✭ 73 (-12.05%)
Mutual labels:  extension
V2gen
A powerful cross-platform CLI client for V2Ray subscription. 跨平台V2Ray命令行订阅管理客户端
Stars: ✭ 82 (-1.2%)
Mutual labels:  cli-app
Vscode Highlight
Advanced text highlighter based on regexes. Useful for todos, annotations etc.
Stars: ✭ 71 (-14.46%)
Mutual labels:  extension
Rex Diagnostics
Unity extension that enables expression evaluation at runtime to facilitate testing and debugging.
Stars: ✭ 78 (-6.02%)
Mutual labels:  extension
Wasavi
wasavi is an extension for Chrome, Firefox, and Opera. wasavi changes a textarea element to virtual vi editor which supports almost all the vi/ex commands.
Stars: ✭ 1,235 (+1387.95%)
Mutual labels:  extension
Podstation
podStation is a web podcast aggregator for Chrome.
Stars: ✭ 76 (-8.43%)
Mutual labels:  extension
Prettier action
GitHub action for running prettier on your projects pull requests
Stars: ✭ 77 (-7.23%)
Mutual labels:  code-quality

TYPO3 scanner

Scans code for usage of deprecated and or changed code.

What about actually FIXING the broken code automatically?

TYPO3scan only reports on code that needs to be fixed when migrating to a higher version of TYPO3. If you want a tool that automatically fixes the code for you take a look at the TYPO3 Rector project.

What does it do?

demo

TYPO3 publishes breaking changes and deprecations since version 7.

This tool scans a folder for any code that is broken or deprecated. It's a wrapper around the TYPO3 scanner library that has been extracted from the TYPO3 v9 core. You can scan for deprecations and breaking changes for v7, v8, v9 and v10.

Is TYPO3 scan helping you to migrate your TYPO3 site more smoothly?

Then please consider a sponsorship so I can make this tool even more awesome!

Thank you! ♥

Requirements

The scanner requires PHP 7.0 or higher to run. Why? Because this tool was written in 2018! Still running that old site on PHP 5.6? Move your extensions over to a system with PHP 7.0+ to scan them.

If there is enough demand I can downgrade components of the scanner so it can also run on PHP 5.6. This would also mean that the TYPO3 scanner library will need to be adjusted. It is taken from the TYPO3 9 core which requires PHP 7.2 at the time of writing. This sounds like quite a hassle to me, so if you want to run the LTS version of TYPO3 . . . ugrading your PHP version is the preferred practice.

Installation

Install into an existing composer project:

composer require "michielroos/typo3scan"

Usage

Scan a path

Specify a path to scan.

php ./typo3scan.phar scan ~/tmp/source

Scan for changes in certain TYPO3 version

By default the scanner scans for breaking changes and deprecations in the most recent version of TYPO3. At the time of writing, this is version 10.

  • long option: --target
  • short option: -t
  • values: 7, 8, 9 and 10
  • default: 10
php ./typo3scan.phar scan --target 8 ~/tmp/source

Show only certain types of changes

You can filter out specific change types (breaking, deprecation, feature, important)

  • long option: --only
  • short option: -o
  • values: breaking, deprecation, feature, important
  • default: breaking,deprecation,feature,important
php ./typo3scan.phar scan --only breaking ~/tmp/source

php ./typo3scan.phar scan --only breaking,deprecation ~/tmp/source

Show only certain indicator types (strong / weak)

You can filter out specific indicator types (strong, weak)

  • long option: --indicator
  • short option: -i
  • values: strong, weak
  • default: strong,weak
php ./typo3scan.phar scan --indicator weak ~/tmp/source

php ./typo3scan.phar scan --indicator strong ~/tmp/source

Change output format

You can specify a different output format.

  • long option: --format
  • short option: -f
  • values: html, junit, markdown, plain
  • default: plain
php ./typo3scan.phar scan --format markdown ~/tmp/source

Specify report filename

Instead of piping the output to a file, typo3scanner can write directly to a report file

  • long option: --reportFile
  • short option: -r
php ./typo3scan.phar scan -r ~/tmp/report.txt ~/tmp/source

Specify custom template folder

You can output in ANY format of your choosing by specifying a custom templatePath.

  • long option: --templatePath

The scanner looks for a file with the name Format.twig. So if you create a HTML template and store that in ~/path/to/templates/Html.twig, then you can generate a HTML report with the following command:

php ./typo3scan.phar scan --format html --templatePath ~/path/to/templates ~/tmp/source

If you want to output the report as Restructured Text, you would create a Rst.twig template and generate rest using:

php ./typo3scan.phar scan --format rst --templatePath ~/path/to/templates ~/tmp/source

Capture output in a file

You can redirect the output to a file

php ./typo3scan.phar scan --format markdown  ~/tmp/source > source.md

Loop over a list of extensions

If you have a list of extension keys you want to scan, you can do something like:

for e in `cat ~/extensions.txt`;
do
    php ./typo3scan.phar scan --format markdown  ~/tmp/ext/$e > ~/tmp/reports/$e.md;
done

Run the TYPO3scan tool from within Gitlab CI

Check multiple extensions in the folder web/typo3conf/ext/ adjust that path if needed.

The result is an artifact which contains a Build/Report/Deprecations where you have a file per extension and TYPO3 Version 7, 8, 9 and 10.

This way you can easily review each extension.

With the planned junit ouput this can be nicely integrated into the gitlab merge request widget as well.

checkDeprecations:
  image: docker.kay-strobach.de/docker/php:7.1
  stage: test
  variables:
    SCANNER_RELEASE: "https://github.com/Tuurlijk/typo3scan/releases/download/1.3.0/typo3scan.phar"
  script:
    - curl -L $SCANNER_RELEASE --output typo3scan.phar
    - php ./typo3scan.phar
    - mkdir -p Build/Report/Deprecations
    - for d in web/typo3conf/ext/*/ ; do (php ./typo3scan.phar scan --target 7 --format markdown $d > Build/Report/Deprecations/v7-$(basename $d).md); done
    - for d in web/typo3conf/ext/*/ ; do (php ./typo3scan.phar scan --target 8 --format markdown $d > Build/Report/Deprecations/v8-$(basename $d).md); done
    - for d in web/typo3conf/ext/*/ ; do (php ./typo3scan.phar scan --target 9 --format markdown $d > Build/Report/Deprecations/v9-$(basename $d).md); done
    - for d in web/typo3conf/ext/*/ ; do (php ./typo3scan.phar scan --target 10 --format markdown $d > Build/Report/Deprecations/v10-$(basename $d).md); done
  artifacts:
    when: on_success
    expire_in: 7 days
    paths:
    - Build

Example output

You can find example templates in the Resources/Private/Templates folder.

Plain

A part of the plain output for:

typo3scan.phar scan ~/tmp/source/powermail

Looks like this:

powermail

Found 26 matches in 1.09s when checking for changes and deprecations in TYPO3 7

strong	weak	DEPRECATION	BREAKING	
29.41%	70.59%	5.88%	94.12%	

Classes/Finisher/SendParametersFinisher.php
Call to method "isEnabled()" (weak)
60 if ($this->isEnabled()) {
Deprecation: #37171 - Deprecate t3editor->isEnabled()
https://docs.typo3.org/typo3cms/extensions/core/Changelog/7.3/Deprecation-67171-T3editorIsEnabled.html

Configuration/TCA/tx_powermail_domain_model_answer.php
Usage of array key "dividers2tabs" (strong)
14 'dividers2tabs' => true,
Breaking: #62833 - Removed dividers2tabs functionality
https://docs.typo3.org/typo3cms/extensions/core/Changelog/7.0/Breaking-62833-Dividers2Tabs.html

Usage of array key "canNotCollapse" (weak)
240 'canNotCollapse' => 1
Breaking: #67753 - Drop "Show secondary options"
https://docs.typo3.org/typo3cms/extensions/core/Changelog/7.4/Breaking-67753-DropSecondaryOptions.html

Usage of array key "_PADDING" (weak)
206 '_PADDING' => 2,
Breaking: #63846 - FormEngine refactoring
https://docs.typo3.org/typo3cms/extensions/core/Changelog/7.3/Breaking-63846-FormEngineRefactoring.html

ext_localconf.php
Access to array key "formevals" (weak)
71 $TYPO3_CONF_VARS['SC_OPTIONS']['tce']['formevals']['\In2code\Powermail\Tca\EvaluateEmail'] =
Breaking: #67749 - Force class auto loading for various hooks
https://docs.typo3.org/typo3cms/extensions/core/Changelog/7.4/Breaking-67749-ForceAutoloadingForVariousHooks.html

HTML

A part of the html output for:

typo3scan.phar scan ~/tmp/source/coreapi -f html -t 7

Looks like this:

Junit

A part of the junit output for:

typo3scan.phar scan ~/tmp/source/coreapi -f junit -t 7

Looks like this:

Contributing

If you want to help improve this tool to reduce the amount of false positives, improve matchers, add new matchers etc., your contributions are very welcome!

You can contribute here: TYPO3scan src repository

Sponsors

This project was generously sponsored by Stichting Praktijkleren.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].