Visualize Your Code's Quality with PhpMetrics

The installation procedure is described in the post. Get a vagrant box up and running and enter the composer commands.

Composer works on any OS, and is the basis of modern PHP development when using third party libraries and packages. For an introduction, and to make things clear, see this.

It looks like a great tool, easier to install than Jenkins :stuck_out_tongue:

Just a quick note on the results Laravel/Symfony2; it’s important the remind that Laravel uses a lot of Symfony2 components, so I guess if you count them into the codebase of Laravel, which makes sense because Laravel wouldn’t work without those components, Laravel would become heavier.

Note to haters : i’m a huge Laravel fan, and creator of Laravel.fr ; so don’t get pissed off by my comment :slight_smile:

Oh, so It all runs on Perkins, that is a version of Burke, that needs JinXXxx, that has to be installed using Gurkha, that requires a functional “palinDrome”-box, with you can run inside a Charleston-container, that you can compile using “wonderful 2.0” , and so on, etc…?

And who have guessed that such a delicious soup could have been made from only a simple lump of rock?

While I understand your frustration as caused by your failing to keep up, you can also avoid all this, and install it just via the command line with the first three lines on the landing page, into any PHP installation of any type. What I listed above are merely best practices.

wget https://github.com/Halleck45/PhpMetrics/raw/master/build/phpmetrics.phar
chmod +x phpmetrics.phar
mv phpmetrics.phar /usr/local/bin/phpmetrics

If you don’t understand this (which is multiplatform, btw - on Windows, you get these commands through Git Bash), I’m sorry but I don’t know how to help beyond recommending a “basics of terminal” course because without even the most basic terminal knowledge you’ll never get a serious web development job, I guarantee this.

Nope.

wget?
chmod?

Like the people behind this tool, you assume that everyone is running the exact same system as you.

It doesn’t run on OSX Mavericks. A pity.

I do no such thing.

chmod +x means “give execute permission to this file”, which, in Windows environments, can be replaced by simply running PhpMetrics as this:

php phpmetrics.phar

Another approach is just opening the file properties window, since you’re obviously of the GUI type, and just select “executable file” as a permission, or your system’s equivalent.

How do you mean? It works for me.

My employer demands I use MAMPP instead of the inbuilt PHP and Apache webserver. That’s likely the culprit.

You run your development environment unvirtualized?

Unfortunately. I’m not allowed to do otherwise in order “to stay consistent with the other developers”

That sucks.

I would definitely just run what I want (vb + vagrant). So long as you have sudo no one can really stop you…

Not to mention running nfs w/ php5-fpm with apache 2.4 is blazing fast even for a vm.

It boggles my mind that some people don’t understand and/or are to stubborn to use a vm. I quite frankly just won’t stand for it – easier to ask for forgiveness than permission.

I’m curious to run this on Magento EE 1.14.1 also Drupal 7 and 8.

You can stay consistent while virtualized. Just install the same versions of PHP / Apache, whatever, into the VM and you have the exact same environment in a VM, and none’s the wiser. What’s more, you now have a fully destructible and rebuildable environment which you can tear down, rework, and experiment with at will with zero consequences.

Preaching to the choir man, preaching to the choir. I’m trying to convince him, but since workstation layouts do get spot checked I’d rather not risk incurring any wrath.

Spot checked? Someone actually sits down at your station and inspects it? Cause other than that, a Vagrant powered VM is undetectable, it just runs in the background after you run a terminal command. To detect it, someone would have to inspect running processes, there’s literally no other simpler way.

No offense, but it sounds like you work in some kind of totalitarian regime.

No, they’re just set in their ways. Also, ad agency - coding is a necessity of the business with the rise of the Internet, not something the uppermost management had in mind when the place was founded. I’ll look into Vagrant - if I can come up with something that streamlines processes more than we have than I can certainly get the ear of the powers that be.

By the by, if I was going to do a VM I would like to have one that matches Media Temple’s Grid Server environments as closely as possible since that’s what the majority of our deployments are to.

And yeah, the admin can ssh into our boxes at any time and has been known to do it.

You can configure a Vagrant box how ever you see fit - install everything and anything on it and then spread it among other devs so everyone has an identical environment. Configure it to match 100% of your production server, and you have even more parity - instant cloned production environment inside the company, but ready for development and experimentation. Screwed up? Just vagrant destroy and vagrant up a new instance, you’re back where you started with zero code lost, only a reset environment.

Also SSHing into your environment still won’t reveal you running Vagrant. He’d have to get sudo privileges of your computer and scan the process list that way, which, if it’s done regularly, is not only detrimental to morale and productivity, but also to your station’s performance. Seems like a draconian workplace in any case. The only inspection a dev should be subject to is code review.

Maybe a “personal” zip drive that you could plug in could work?

Maybe. I’d rather not end run them though. I like my job.

1 Like

Something is wrong when you have to use MAMP to stay consistent.
Sit down over the weekend, get a vagrant box sorted out for them, show them how wrong they were and get a rise.

1 Like

Nope it does not.

On a system that doesn’t have the command “chmod”
chmod +x doesn’t mean shit.

Using linux-commands as shorthand for English in tutorials, is a bad idea.

…oh never-mind I give up.
Plus, the useless “flat design” on this new comment-system makes it really hard to see who is responding to what.

I’m sure there is some useful info somewhere here, but i don’t have the time to play puzzle-master with it.