GithubHelp home page GithubHelp logo

Comments (11)

shinobu avatar shinobu commented on June 24, 2024

this tool https://github.com/sebastianbergmann/phpcpd might proof usefull for refactoring files as well

from erfurt.

shinobu avatar shinobu commented on June 24, 2024

I've tried using the phpdcd and it throws a bunch of errors, but still gives output (with most likely many false positives). I'm going to check those entries and sort out as many false positives as I can, and afterwards you should recheck the updated list. Any complaints about this @pfrischmuth @white-gecko ? Here is the log for reference: phpcdc.txt

I've searched for more ways to find dead code, this feature seems to be pretty rare. One other thing i found was https://phpmd.org/ sadly it doesn't search for unused functions right now, but we can find unused variables which is already a useful feature

https://github.com/exakat/php-static-analysis-tools lists a lot of more or less useful tools - maybe one of the analysers actually can list dead code as well. I might look into them prior to going through the logfile from phpdcd

from erfurt.

k00ni avatar k00ni commented on June 24, 2024

Hi @shinobu, you should exclude the vendor folder in the search, because it only contains foreign software.

from erfurt.

shinobu avatar shinobu commented on June 24, 2024

@k00ni iirc I ran it in `library/Erfurt' so the vendor folder was ignored

from erfurt.

k00ni avatar k00ni commented on June 24, 2024

@shinobu: according to your phpcdc.txt file you have lines like:

Notice: Undefined index:  in /home/shino/git/Erfurt/vendor/sebastian/phpdcd/src/Analyser.php on line 274

According to that line, it checked the vendor folder too (vendor/sebastian).

from erfurt.

shinobu avatar shinobu commented on June 24, 2024

The undefined index is in the vendor path because vendor/sebastion/phpdcd is the program i execute to check the Erfurt Code (as mentioned above) @k00ni

from erfurt.

k00ni avatar k00ni commented on June 24, 2024

You are right, thanks for the info, my bad.

from erfurt.

shinobu avatar shinobu commented on June 24, 2024

This is the Log of the phpmd (as mentioned above mostly unused variables)
phpmd.txt

from erfurt.

shinobu avatar shinobu commented on June 24, 2024

Another thing, as phpdcd versions 1.0.0 1.0.1 1.0.2/stable Composer Package all have errors, it would be great if you could check if they run on your setups without errors @pfrischmuth @white-gecko (that shouldn't take longer than 5 minutes)

from erfurt.

shinobu avatar shinobu commented on June 24, 2024

priorize deleting outcommented code snippets, beware to not delete comments

afterwards go through the phpdcd results

from erfurt.

white-gecko avatar white-gecko commented on June 24, 2024

Commend out code should be done in #140 .
The phpdcd is complicated to handle and we don't know, if the result brings much.
The next step should be phpcpd and phpmd.

from erfurt.

Related Issues (20)

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.