Method _retrieveCurrentVersions
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _retrieveCurrentVersions()
{
if (!function_exists('curl_init')) {
// Override the OK Message - Even if this passes we can't be 100% sure they are accurate since we didn't fetch the latest version
$this->_message_ok = 'You are running a current stable version of PHP!
Avoid unused local variables such as '$timeout'. Open
$timeout = 5;
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
HACK found Open
// HACK: Force to grab current versions - this will fetch the latest version
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class PhpSecInfo_Test_Core_Version extends PhpSecInfo_Test_Core
- Exclude checks
The property $recommended_value is not named in camelCase. Open
class PhpSecInfo_Test_Core_Version extends PhpSecInfo_Test_Core
{
/**
* This should be a <b>unique</b>, human-readable identifier for this test
*
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $test_name is not named in camelCase. Open
class PhpSecInfo_Test_Core_Version extends PhpSecInfo_Test_Core
{
/**
* This should be a <b>unique</b>, human-readable identifier for this test
*
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The class PhpSecInfo_Test_Core_Version is not named in CamelCase. Open
class PhpSecInfo_Test_Core_Version extends PhpSecInfo_Test_Core
{
/**
* This should be a <b>unique</b>, human-readable identifier for this test
*
- Read upRead up
- Exclude checks
CamelCaseClassName
Since: 0.2
It is considered best practice to use the CamelCase notation to name classes.
Example
class class_name {
}
Source
The property $last_eol_value is not named in camelCase. Open
class PhpSecInfo_Test_Core_Version extends PhpSecInfo_Test_Core
{
/**
* This should be a <b>unique</b>, human-readable identifier for this test
*
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
Avoid variables with short names like $ch. Configured minimum length is 3. Open
$ch = curl_init();
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
The property $_message_ok is not named in camelCase. Open
class PhpSecInfo_Test_Core_Version extends PhpSecInfo_Test_Core
{
/**
* This should be a <b>unique</b>, human-readable identifier for this test
*
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 24 and the first side effect is on line 16. Open
<?php
- Exclude checks
Property name "$_message_ok" should not be prefixed with an underscore to indicate visibility Open
private $_message_ok = 'You are running a current stable version of PHP!';
- Exclude checks
Method name "_retrieveCurrentValue" should not be prefixed with an underscore to indicate visibility Open
public function _retrieveCurrentValue()
- Exclude checks
Method name "_execTest" should not be prefixed with an underscore to indicate visibility Open
public function _execTest()
- Exclude checks
Method name "_retrieveCurrentVersions" should not be prefixed with an underscore to indicate visibility Open
public function _retrieveCurrentVersions()
- Exclude checks
Method name "_setMessages" should not be prefixed with an underscore to indicate visibility Open
public function _setMessages()
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
$this->setMessageForResult(PHPSECINFO_TEST_RESULT_NOTICE, 'en',
- Exclude checks
Line exceeds 120 characters; contains 153 characters Open
<br /><strong>NOTE:</strong> CURL was unable to fetch the latest PHP Versions from the internet. This test may not be accurate if
- Exclude checks
Line exceeds 120 characters; contains 141 characters Open
$uri = 'https://raw.githubusercontent.com/ZerooCool/phpsecinfo/phpsecinfo-zeroocool-v0.2.1/20070406-phpsecinfo-v0.2.1/.version.json';
- Exclude checks
Line exceeds 120 characters; contains 141 characters Open
// Override the OK Message - Even if this passes we can't be 100% sure they are accurate since we didn't fetch the latest version
- Exclude checks
Line exceeds 120 characters; contains 140 characters Open
if (version_compare($this->current_value, $version['stable'], '<') && version_compare($this->current_value, $version['eol'], '>')) {
- Exclude checks
Line exceeds 120 characters; contains 210 characters Open
$this->setMessageForResult(PHPSECINFO_TEST_RESULT_WARN, 'en', 'You are running a version of PHP that has reached End of Life for support. You should upgrade to the latest version of PHP immediately.');
- Exclude checks
Line exceeds 120 characters; contains 219 characters Open
'You are running a version of PHP that is not the most recent and may be near End of Life for support. You should begin to migrate to the latest version of PHP as soon as possible.');
- Exclude checks
Line exceeds 120 characters; contains 141 characters Open
// Override the OK Message - Even if this passes we can't be 100% sure they are accurate since we didn't fetch the latest version
- Exclude checks
Line exceeds 120 characters; contains 140 characters Open
// Mettre à jour la valeur recommandée locale (elle est utilisée ailleurs et nous ne voulons pas modifier ce code pour l'instant)
- Exclude checks
Line exceeds 120 characters; contains 153 characters Open
<br /><strong>NOTE:</strong> CURL was unable to fetch the latest PHP Versions from the internet. This test may not be accurate if
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
// Cette ligne ne semble pas influencer la version recommandée qui est gérée depuis le fichier .version.json directement.
- Exclude checks
Class name "PhpSecInfo_Test_Core_Version" is not in camel caps format Open
class PhpSecInfo_Test_Core_Version extends PhpSecInfo_Test_Core
- Exclude checks
Multi-line function call not indented correctly; expected 8 spaces but found 35 Open
'You are running a version of PHP that is not the most recent and may be near End of Life for support. You should begin to migrate to the latest version of PHP as soon as possible.');
- Exclude checks
Opening parenthesis of a multi-line function call must be the last content on the line Open
$this->setMessageForResult(PHPSECINFO_TEST_RESULT_NOTICE, 'en',
- Exclude checks
Closing parenthesis of a multi-line function call must be on a line by itself Open
'You are running a version of PHP that is not the most recent and may be near End of Life for support. You should begin to migrate to the latest version of PHP as soon as possible.');
- Exclude checks
The method _retrieveCurrentVersions is not named in camelCase. Open
public function _retrieveCurrentVersions()
{
if (!function_exists('curl_init')) {
// Override the OK Message - Even if this passes we can't be 100% sure they are accurate since we didn't fetch the latest version
$this->_message_ok = 'You are running a current stable version of PHP!
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method _setMessages is not named in camelCase. Open
public function _setMessages()
{
parent::_setMessages();
// HACK: Force to grab current versions - this will fetch the latest version
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method _retrieveCurrentValue is not named in camelCase. Open
public function _retrieveCurrentValue()
{
$this->current_value = PHP_VERSION;
// $this->current_value = '5.4.15';
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method _execTest is not named in camelCase. Open
public function _execTest()
{
// Get versions
$version = $this->_retrieveCurrentVersions();
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}