Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_values undefined #45

Closed
tomjn opened this issue Sep 5, 2014 · 7 comments
Closed

_values undefined #45

tomjn opened this issue Sep 5, 2014 · 7 comments
Labels

Comments

@tomjn
Copy link

tomjn commented Sep 5, 2014

I'm having issues running PHPMetrics, it displays the maintainability page, and the relations map, but the other charts and tables aren't shown, here's the error in the JS Console on chrome 38:

screen shot 2014-09-05 at 12 23 41

Uncaught TypeError: Cannot read property '_values' of undefined 
@Halleck45 Halleck45 added the bug label Sep 5, 2014
@UFOMelkor
Copy link
Member

Which OS do you use?

@Halleck45
Copy link
Collaborator

Which version of PhpMetrics do you use ? (phpmetrics.phar --version)

@tomjn
Copy link
Author

tomjn commented Sep 5, 2014

OS X 10.9.4

I installed PHPMetrics today within an hour or two of creating the issue:

PhpMetrics, by Jean-François Lépine (https://twitter.com/Halleck45) version 1.0.0

and

PHP 5.4.32 (cli) (built: Aug 26 2014 12:09:27)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans

@Trismegiste
Copy link

I've the same problem on Chrome+Windows :

"Uncaught TypeError: Cannot read property '_values' of undefined"

Only Maintenability and Realtions graphs are ok.

flo@HAL9000 ~/Documents/NetBeansProjects
$ phpmetrics.phar --version
PhpMetrics, by Jean-François Lépine (https://twitter.com/Halleck45) version 1.0.0

flo@HAL9000 ~/Documents/NetBeansProjects
$ php -v
PHP 5.4.3 (cli) (built: May  8 2012 00:51:31)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
    with Xdebug v2.2.0, Copyright (c) 2002-2012, by Derick Rethans

In the same time : it works fine on Chrome+Ubuntu and PHP 5.5

@UFOMelkor
Copy link
Member

@Halleck45
Today I had a look at https://peteraba.com/blog/phpmetrics-of-popular-projects/ and discovered that (at least) most of the reports are broken (same error message as above).
It looks like there is a problem with php in the path. Replacing report-tabular.js.twig#L112 with if(!e.name.match(/\.php$/)) { works for me.

@Trismegiste
Might you try #44? How do you execute phpmetrics? Absolute path or relative? With or without trailing slash?

@Trismegiste
Copy link

Ok guyz' there's definitely a clash between the slash/backslash

What I've tried : (with html report and chrome)

  • in the old windows prompt : php phpmetrics.phar --report-html=toto.html src\ OK ⭕
  • in the old windows prompt : php phpmetrics.phar --report-html=toto.html src OK ⭕
  • in the GIT bash on windows : phpmetrics.phar --report-html=toto.html src OK ⭕
  • in the GIT bash on windows : phpmetrics.phar --report-html=toto.html src/ FAIL ❌
  • on Ubuntu 1404 : everything works fine of course 😆

When it fails, here is chunk of the console output for filename : src/\Visitor\Vertex

There's a slash and a backslash, I think it is the origin of the issue (I have not seen the code so far), just intuition...

Hope this help 🍻

@UFOMelkor
Copy link
Member

#44 should fix this problem 😊

Halleck45 pushed a commit that referenced this issue Dec 16, 2014
fix #45 (error with php in path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants