Giter Club home page Giter Club logo

typo3scan's People

Contributors

can0199msh avatar danielsiepmann avatar garfieldius avatar kaystrobach avatar markuspoerschke avatar mbrodala avatar mschwemer avatar nicoweio avatar nikonierer avatar peterkraume avatar susannemoog avatar tuurlijk 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar

typo3scan's Issues

Currently not installable via composer

When tryining to install the package with

composer req --dev michielroos/typo3scan

it ends up with the following error:

michielroos/typo3scan 1.6.3 requires typo3/cms-scanner dev-master -> no matching package found.

The package typo3/cms-scanner seems to be removed, because I cannot find it on packagist.org.

[BUG] Scanning bigger project resolves in error.

I have a project with 86 extensions, and when I want to scan the entire typo3conf/ext directory i get following error:

$ typo3scan scan --only breaking --format markdown --target 8 . > ../report.md

In Name.php line 222:

  Name cannot be empty

scan [-t|--target [TARGET]] [-o|--only [ONLY]] [-f|--format [FORMAT]] [-r|--reportFile [REPORTFILE]] [--templatePath [TEMPLATEPATH]] [--] <path>

Any ideas what could cause this? When I do every single extension manually, every single on works.

But I would prefer a project total overview.

Thanks in advance.

Cannot install with PHP 7.0

Since PHP 7.0 is still common I tried to install this package but failed:

$ composer req --dev michielroos/typo3scan typo3/cms-scanner:dev-master
Using version ^1.4 for michielroos/typo3scan
./composer.json has been updated
Loading composer repositories with package information                                                                                                         Updating dependencies (including require-dev)         Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - symfony/console v4.1.7 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
    - symfony/console v4.1.6 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
    - symfony/console v4.1.5 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
    - symfony/console v4.1.4 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
    - symfony/console v4.1.3 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
    - symfony/console v4.1.2 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
    - symfony/console v4.1.1 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
    - symfony/console v4.1.0 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
    - michielroos/typo3scan 1.4.0 requires symfony/console ^4.1 -> satisfiable by symfony/console[v4.1.0, v4.1.1, v4.1.2, v4.1.3, v4.1.4, v4.1.5, v4.1.6, v4.1.7].
    - Installation request for michielroos/typo3scan ^1.4 -> satisfiable by michielroos/typo3scan[1.4.0].


Installation failed, reverting ./composer.json to its original content.

Can you lower your Symfony requirements to 3.4?

[FEATURE] Possibility to mark false positives

Hi,

We have set up monitoring for our TYPO3 Scanner reports, but some of the reports results are false positives, marked as Breaking/Deprecated, but isn't deprecated, just a use of same Classname, but I different namespace.

It would help us quite a lot, if there was a way to mark breaking/deprecated changes as false positives, to have green reports.

I don't have any idea on the top of my head how this could be implemented, I would be happy to help though if any ideas are provided.

HTML Report CSS?

Hi,

Do I need to setup anything else besides templatePath to get the styles HTML reports?
Mine is still looking plan simple unstyled :)

HTML Report CSS

I recommend to add to the CSS for pre
overflow: auto
to prevent this:
bildschirmfoto 2019-01-18 um 09 49 15

Filter by indicator

It would be useful if there was a CLI option to filter by indicator (weak / strong). This way one can focus on the strong matches first and afterwards check if the weak matches are relevant.

Feature Request: Scan for deprecated Typoscript

It would be really nice to be able to scan for deprecated Typoscript too (if not already possible, I didn't see anything about it in the Readme).

Would you consider it, and if not, what would it take for you to consider it? :-)

Best Regards
Tizian

PHP 8.2 Deprecations and Warnings

Hi, I'm in the process to update my TYPO3 v11 Project to PHP 8.2 and I'm using your awesome tool.
with PR #45 you added support for PHP 8, but when running the extension scanner with PHP 8.2 I'm getting some deprecations and warnings:


Deprecated: Return type of Symfony\Component\Finder\Finder::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Finder.php on line 566

Deprecated: Return type of Symfony\Component\Finder\Finder::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Finder.php on line 637

Deprecated: Return type of Symfony\Component\Finder\Iterator\FilterIterator::rewind() should either be compatible with FilterIterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Iterator/FilterIterator.php on line 32

Deprecated: Return type of Symfony\Component\Finder\Iterator\FileTypeFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php on line 42

Deprecated: Return type of Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator::getChildren() should either be compatible with RecursiveDirectoryIterator::getChildren(): RecursiveDirectoryIterator, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php on line 89

Deprecated: Return type of Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator::rewind() should either be compatible with FilesystemIterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php on line 117

Deprecated: Return type of Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator::current() should either be compatible with FilesystemIterator::current(): SplFileInfo|FilesystemIterator|string, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php on line 65

Deprecated: Return type of Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php on line 55

Deprecated: Return type of Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator::hasChildren() should either be compatible with RecursiveIterator::hasChildren(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php on line 71

Deprecated: Return type of Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator::getChildren() should either be compatible with RecursiveIterator::getChildren(): ?RecursiveIterator, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php on line 76

Deprecated: Return type of Symfony\Component\Finder\Iterator\FilterIterator::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Iterator/FilterIterator.php on line 32

Deprecated: Return type of Symfony\Component\Finder\Iterator\FilenameFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Iterator/FilenameFilterIterator.php on line 28

Deprecated: Return type of Symfony\Component\Finder\Iterator\PathFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/symfony/finder/Iterator/PathFilterIterator.php on line 27

Warning: Undefined property: PhpParser\Node\VariadicPlaceholder::$unpack in phar:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/typo3/cms-scanner/src/Matcher/AbstractCoreMatcher.php on line 172

Warning: Undefined property: PhpParser\Node\VariadicPlaceholder::$unpack in phar:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/typo3/cms-scanner/src/Matcher/AbstractCoreMatcher.php on line 172```

Are you aware of these deprecations and warnings or is that some configuration error on my end?

[FEATURE] Only display Breaking Changes in Reports

Hi,

When maintaining bigger Projects (100+ extensions) the breaking changes have priority over deprecations.

It would be could if one could add a Option parameter to only show Breaking changes.

I know that I should run the report on extension level too, but for progress monitoring and overview and aggregated report is really helpful.

Let me know what you think, would be happy to help implementing if the idea gets a thumbs up.

[BUG] HTML Twig template must escape html of code segments

Hi,

I've a problem when scanning the ext:crawler
https://github.com/aoepeople/crawler

$ git clone https://github.com/aoepeople/crawler
$ typo3scan scan --format html --target 9 crawler -r crawler.html

Then it only shows me the problems in the Classes/Backend/BackendModule.php and that only part of the problems.

In total the scanner says:

Found 144 matches in 1.31s when checking for changes and deprecations in TYPO3 9

But in the BackendModule itself there are "only" 58 issues to take care of, so some files are still missing in the report.

I sort of expect it to be due to the amount of findings, because if I scan the subdirectories individually it works fine. But don't want to go through multiple reports if it works with one.

And the -vvv debug modus gives me no additional information.

Box Requirements Checker
========================

> Using PHP 7.1.28
> PHP is using the following php.ini file:
  /usr/local/etc/php/7.1/php.ini

> Checking Box requirements:
  ✔ The application requires the version ">=7.0.8" or greater.
  ✔ The application requires the extension "zlib".
  ✔ The package "nikic/php-parser" requires the extension "tokenizer".


 [OK] Your system is ready to run the application.

require uses wrong folder for vendor/autoload.php

I installed latest dev with

composer config minimum-stability dev
composer config repositories.tuurlijk-scanner vcs https://github.com/Tuurlijk/scanner
composer require --update-no-dev  "michielroos/typo3scan:*"

(thus #2 is fixed and typo3scan finally shows up). Nevertheless I can't run the command:

$ pwd
/path/to/myext
$ vendor/bin/typo3scan 
PHP Warning:  require_once(/path/to/myext/vendor/michielroos/typo3scan/bin/../vendor/autoload.php): failed to open stream: No such file or directory in /path/to/myext/vendor/michielroos/typo3scan/bin/typo3scan on line 26

Warning: require_once(/path/to/myext/vendor/michielroos/typo3scan/bin/../vendor/autoload.php): failed to open stream: No such file or directory in /path/to/myext/vendor/michielroos/typo3scan/bin/typo3scan on line 26
PHP Fatal error:  require_once(): Failed opening required '/path/to/myext/vendor/michielroos/typo3scan/bin/../vendor/autoload.php' (include_path='.:/usr/local/Cellar/[email protected]/7.1.22/share/[email protected]/pear') in /path/to/myext/vendor/michielroos/typo3scan/bin/typo3scan on line 26

Fatal error: require_once(): Failed opening required '/path/to/myext/vendor/michielroos/typo3scan/bin/../vendor/autoload.php' (include_path='.:/usr/local/Cellar/[email protected]/7.1.22/share/[email protected]/pear') in /path/to/myext/vendor/michielroos/typo3scan/bin/typo3scan on line 26

typo3 bin itself works

$ vendor/bin/typo3

Uncaught TYPO3 Exception #1381507733: The PackageStates.php file is either corrupt or unavailable.
thrown in file /path/to/myext/typo3/sysext/core/Classes/Package/PackageManager.php
in line 247

I used my local ext dev folder, not a complete TYPO3 install as the install suggested that this wouldn't be necessary due to the composer init.
Is this perhaps a regression due to #2?

Some .rst files are missing

I just used the scanner with version 1.6.0 and got no output at all while scanning an extension with target version 8. Reason is, that not all necessary rst files are to be found in this repository.

In my case /8.6/Deprecation-51291-PageRepositoryShouldFieldBeOverlaid.rst is missing, which then leads to an error in `\MichielRoos\TYPO3Scan\Command\ScanCommand::findRstFile``

Here's the complete stack trace of both a warning and an error thrown:

PHP Notice:  Undefined index: Deprecation-51291-PageRepositoryShouldFieldBeOverlaid.rst in ./typo3scan/src/TYPO3Scan/Command/ScanCommand.php on line 466
PHP Stack trace:
PHP   1. {main}() ./typo3scan/bin/typo3scan:0
PHP   2. MichielRoos\TYPO3Scan\Console\Application->run($input = *uninitialized*, $output = *uninitialized*) ./typo3scan/bin/typo3scan:37
PHP   3. MichielRoos\TYPO3Scan\Console\Application->doRun($input = *uninitialized*, $output = *uninitialized*) ./typo3scan/vendor/symfony/console/Application.php:148
PHP   4. MichielRoos\TYPO3Scan\Console\Application->doRunCommand($command = *uninitialized*, $input = *uninitialized*, $output = *uninitialized*) ./typo3scan/vendor/symfony/console/Application.php:248
PHP   5. MichielRoos\TYPO3Scan\Command\ScanCommand->run($input = *uninitialized*, $output = *uninitialized*) ./typo3scan/vendor/symfony/console/Application.php:953
PHP   6. MichielRoos\TYPO3Scan\Command\ScanCommand->execute($input = *uninitialized*, $output = *uninitialized*) ./typo3scan/vendor/symfony/console/Command/Command.php:255
PHP   7. Twig_TemplateWrapper->render($context = *uninitialized*) ./typo3scan/src/TYPO3Scan/Command/ScanCommand.php:179
PHP   8. __TwigTemplate_285667e7cde5e68772a4c77b1d12193b4fd1d2ed99a979cb119fb044d821ceaf->render($context = *uninitialized*) ./typo3scan/vendor/twig/twig/lib/Twig/TemplateWrapper.php:43
PHP   9. __TwigTemplate_285667e7cde5e68772a4c77b1d12193b4fd1d2ed99a979cb119fb044d821ceaf->display($context = *uninitialized*, $blocks = *uninitialized*) ./typo3scan/vendor/twig/twig/lib/Twig/Template.php:375
PHP  10. __TwigTemplate_285667e7cde5e68772a4c77b1d12193b4fd1d2ed99a979cb119fb044d821ceaf->displayWithErrorHandling($context = *uninitialized*, $blocks = *uninitialized*) ./typo3scan/vendor/twig/twig/lib/Twig/Template.php:367
PHP  11. __TwigTemplate_285667e7cde5e68772a4c77b1d12193b4fd1d2ed99a979cb119fb044d821ceaf->doDisplay($context = *uninitialized*, $blocks = *uninitialized*) ./typo3scan/vendor/twig/twig/lib/Twig/Template.php:390
PHP  12. MichielRoos\TYPO3Scan\Command\ScanCommand->MichielRoos\TYPO3Scan\Command\{closure:./typo3scan/src/TYPO3Scan/Command/ScanCommand.php:283-286}($path = *uninitialized*) ./typo3scan/vendor/twig/twig/lib/Twig/Environment.php(378) : eval()'d code:268
PHP  13. MichielRoos\TYPO3Scan\Command\ScanCommand->findRstFile($path = *uninitialized*) ./typo3scan/src/TYPO3Scan/Command/ScanCommand.php:284
#0 ./typo3scan/src/TYPO3Scan/Command/ScanCommand.php(284): MichielRoos\TYPO3Scan\Command\ScanCommand->findRstFile('/8.6/Deprecatio...')
#1 ./typo3scan/vendor/twig/twig/lib/Twig/Environment.php(378) : eval()'d code(268): MichielRoos\TYPO3Scan\Command\ScanCommand->MichielRoos\TYPO3Scan\Command\{closure}('/8.6/Deprecatio...')
#2 ./typo3scan/vendor/twig/twig/lib/Twig/Template.php(390): __TwigTemplate_285667e7cde5e68772a4c77b1d12193b4fd1d2ed99a979cb119fb044d821ceaf->doDisplay(Array, Array)
#3 ./typo3scan/vendor/twig/twig/lib/Twig/Template.php(367): Twig_Template->displayWithErrorHandling(Array, Array)
#4 ./typo3scan/vendor/twig/twig/lib/Twig/Template.php(375): Twig_Template->display(Array)
#5 /V in ./typo3scan/src/TYPO3Scan/Command/ScanCommand.php on line 466

Add an option to suppress the scan time

I am often versioning the results and every time I run the scanner, I get at least one line changed per file:

<p>Found <strong>0</strong> matches in <strong>0.07s</strong> when

Would it be possible to add an option to hide the render time in the results? Or what do you think about removing that entirely?

Personally, I wouldn't need to know the scan time. It's done when it's done. The results matter, nothing else.

PHP 8 compatibility

It would be great if the scanner also supports PHP 8.
I haven't dived deeper yet but the "biggest" problem is that "match" is a reserved keyword in PHP 8 which leads to the following error:

Parse error: syntax error, unexpected token "::", expecting "(" in phar:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/typo3/cms-scanner/src/Scanner.php on line 25
PHP Parse error:  syntax error, unexpected token "::", expecting "(" in phar:///var/www/html/vendor/michielroos/typo3scan/typo3scan/vendor/typo3/cms-scanner/src/Scanner.php on line 25

Error on PHP 7.4

Twig and PHP Parser need to be updated to newer Versions for PHP 7.4 compatiblity.

Binary is missing when installing with composer

Thanks for a super awesome tool.

When installing with composer the binary is missing:

$ ls -l vendor/bin/
doctrine-dbal -> ../doctrine/dbal/bin/doctrine-dbal
fluid -> ../typo3fluid/fluid/bin/fluid
php-parse -> ../nikic/php-parser/bin/php-parse
phpunit -> ../phpunit/phpunit/phpunit
typo3cms -> ../helhum/typo3-console/typo3cms

Did I forget something?

[FEATURE] Add support for TYPO3 10

I know that TYPO3 10 isn't LTS yet, but there shouldn't be more breaking changes introduced.

It would be nice if the scanner could help me identify problems regarding breaking and deprecation for version 10 as well.

Thanks

Feature reuquest: Scan multiple directories

As a developer, while developing extensions, I often need to scan Classes/, Configuration/ and Tests/ (and maybe Resources), but not the complete directory, as I need to not scan vendor/ (or .Build/vendor/in my case) as those contains 3rd-party classes I have no influence over. I would like to scan multiple directory at once in order to save time, e.g., like this:

typo3scan scan -t 6 Classes/ Configuration/ Tests/

Currently, this command results in the following error message:

Too many arguments, expected arguments "command" "path".  

False positive for TYPO3\CMS\Core\Messaging\FlashMessage in Extension Scanner

The first definition in the file cms-scanner/config/Matcher/v7/ClassNameMatcher.php is for the "removed" class TYPO3\CMS\Core\Messaging\FlashMessage, but the class isn't removed, not even in v9.
With every use of FlashMessage::WARNING a false positive is shown.

The flash message handling was updated in ticket no #57382 (https://review.typo3.org/#/c/28912/)

The only removed class in v7 is TYPO3\CMS\Extbase\Mvc\Controller\FlashMessageContainer

Add possiblity to ignore files or folders

It would be really great to have a way to exclude folders from scanning. One reason might be that an extension has its own vendor folder (eg. because of using phpstan inside the extension). Another example might be the tests folder, which we want to exclude from scanning.
Maybe add some parameter like --exclude=path/to/exclude

[FEATURE] Findings returns with exit != 0 in cli

I would like to have the possibility to run this tool within my CI process, and for that I need an exit different than exit 0; so that the job will fail on findings.

What do you think about the idea? Would be happy to help implement, test, review etc.

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.