Function jdate
has a Cognitive Complexity of 119 (exceeds 5 allowed). Consider refactoring. Open
function jdate($type,$maket='now') {
global $icmsConfig;
icms_loadLanguageFile('core', 'calendar');
$result='';
if ($maket=='now') {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method jdate
has 125 lines of code (exceeds 25 allowed). Consider refactoring. Open
function jdate($type,$maket='now') {
global $icmsConfig;
icms_loadLanguageFile('core', 'calendar');
$result='';
if ($maket=='now') {
Function lastday
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function lastday ($month,$day,$year) {
$lastdayen=date('d',mktime(0,0,0,$month+1,0,$year));
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
$lastdatep=$jday;
while ($jday!='1')
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method jalali_to_gregorian
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
Method jmaketime
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function jmaketime($hour,$minute,$second,$jmonth,$jday,$jyear) {
Function jalali_to_gregorian
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function gregorian_to_jalali
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function gregorian_to_jalali($g_y, $g_m, $g_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$gy = $g_y-1600;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
The function jdate() has 131 lines of code. Current threshold is set to 100. Avoid really long methods. Open
function jdate($type,$maket='now') {
global $icmsConfig;
icms_loadLanguageFile('core', 'calendar');
$result='';
if ($maket=='now') {
- Exclude checks
The function jdate() has a Cyclomatic Complexity of 42. The configured cyclomatic complexity threshold is 10. Open
function jdate($type,$maket='now') {
global $icmsConfig;
icms_loadLanguageFile('core', 'calendar');
$result='';
if ($maket=='now') {
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
Avoid unused local variables such as '$icmsConfig'. Open
global $icmsConfig;
- 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
Avoid unused local variables such as '$jday'. Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- 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
Argument 2 (g_m)
is string
but \gregorian_to_jalali()
takes int
defined at /code/htdocs/include/jalali.php:55
Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Exclude checks
Reference to undeclared constant \_CAL_TUESDAY
Open
else if ($result1=='Tuesday') $result1=_CAL_TUESDAY;
- Exclude checks
Reference to undeclared constant \_CAL_SUFFIX
Open
$result.=_CAL_SUFFIX;
- Exclude checks
Argument 2 (g_m)
is string
but \gregorian_to_jalali()
takes int
defined at /code/htdocs/include/jalali.php:55
Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Exclude checks
Reference to undeclared constant \_CAL_SAT
Open
if ($result1=='Sat') $result1=_CAL_SAT;
- Exclude checks
Reference to undeclared constant \_CAL_WEDNESDAY
Open
else if ($result1=='Wednesday') $result1=_CAL_WEDNESDAY;
- Exclude checks
Reference to undeclared constant \_USE_LOCAL_NUM
Open
$basecheck = defined('_USE_LOCAL_NUM') && _USE_LOCAL_NUM;
- Exclude checks
Reference to undeclared constant \_CAL_TUE
Open
else if ($result1=='Tue') $result1=_CAL_TUE;
- Exclude checks
Reference to undeclared constant \_CAL_MONDAY
Open
else if ($result1=='Monday') $result1=_CAL_MONDAY;
- Exclude checks
Argument 3 (g_d)
is string
but \gregorian_to_jalali()
takes int
defined at /code/htdocs/include/jalali.php:55
Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Exclude checks
Argument 2 (g_m)
is string
but \gregorian_to_jalali()
takes int
defined at /code/htdocs/include/jalali.php:55
Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Exclude checks
Argument 2 (g_m)
is string
but \gregorian_to_jalali()
takes int
defined at /code/htdocs/include/jalali.php:55
Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Exclude checks
Argument 2 (g_m)
is string
but \gregorian_to_jalali()
takes int
defined at /code/htdocs/include/jalali.php:55
Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Exclude checks
Invalid operator: right operand of +
is bool
(expected array or number) Open
for ($i = 0; $g_day_no >= $g_days_in_month[$i] + ($i == 1 && $leap); $i++)
- Exclude checks
Reference to undeclared constant \_CAL_PM
Open
if ($result1=='pm') $result.=_CAL_PM;
- Exclude checks
Reference to undeclared constant \_CAL_FRIDAY
Open
else if ($result1=='Friday') $result1=_CAL_FRIDAY;
- Exclude checks
Reference to undeclared constant \_CAL_AM_LONG
Open
else $result.=_CAL_AM_LONG;
- Exclude checks
Argument 1 (g_y)
is string
but \gregorian_to_jalali()
takes int
defined at /code/htdocs/include/jalali.php:55
Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Exclude checks
Reference to undeclared constant \_CAL_WED
Open
else if ($result1=='Wed') $result1=_CAL_WED;
- Exclude checks
Argument 3 (g_d)
is string
but \gregorian_to_jalali()
takes int
defined at /code/htdocs/include/jalali.php:55
Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Exclude checks
Argument 3 (g_d)
is string
but \gregorian_to_jalali()
takes int
defined at /code/htdocs/include/jalali.php:55
Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Exclude checks
Argument 1 (g_y)
is string
but \gregorian_to_jalali()
takes int
defined at /code/htdocs/include/jalali.php:55
Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Exclude checks
Argument 1 (g_y)
is string
but \gregorian_to_jalali()
takes int
defined at /code/htdocs/include/jalali.php:55
Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Exclude checks
Reference to undeclared constant \_CAL_SUN
Open
else if ($result1=='Sun') $result1=_CAL_SUN;
- Exclude checks
Reference to undeclared constant \_CAL_THU
Open
else if ($result1=='Thu') $result1=_CAL_THU;
- Exclude checks
Reference to undeclared constant \_CAL_SATURDAY
Open
if ($result1=='Saturday') $result1=_CAL_SATURDAY;
- Exclude checks
Argument 2 (g_m)
is string
but \gregorian_to_jalali()
takes int
defined at /code/htdocs/include/jalali.php:55
Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Exclude checks
Argument 2 (g_m)
is string
but \gregorian_to_jalali()
takes int
defined at /code/htdocs/include/jalali.php:55
Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Exclude checks
Argument 3 (g_d)
is string
but \gregorian_to_jalali()
takes int
defined at /code/htdocs/include/jalali.php:55
Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Exclude checks
Reference to undeclared constant \_CAL_FRI
Open
else if ($result1=='Fri') $result1=_CAL_FRI;
- Exclude checks
Argument 2 (g_m)
is string
but \gregorian_to_jalali()
takes int
defined at /code/htdocs/include/jalali.php:55
Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Exclude checks
Argument 1 (g_y)
is string
but \gregorian_to_jalali()
takes int
defined at /code/htdocs/include/jalali.php:55
Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Exclude checks
Argument 3 (g_d)
is string
but \gregorian_to_jalali()
takes int
defined at /code/htdocs/include/jalali.php:55
Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Exclude checks
Argument 6 (year)
is string
but \mktime()
takes int
Open
$lastdayen=date('d',mktime(0,0,0,$month+1,0,$year));
- Exclude checks
Reference to undeclared constant \_CAL_AM
Open
else $result.=_CAL_AM;
- Exclude checks
Reference to undeclared constant \_CAL_THURSDAY
Open
else if ($result1=='Thursday') $result1=_CAL_THURSDAY;
- Exclude checks
Argument 2 (g_m)
is string
but \gregorian_to_jalali()
takes int
defined at /code/htdocs/include/jalali.php:55
Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Exclude checks
Argument 3 (g_d)
is string
but \gregorian_to_jalali()
takes int
defined at /code/htdocs/include/jalali.php:55
Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Exclude checks
Reference to undeclared constant \_CAL_PM_LONG
Open
if ($result1=='pm') $result.=_CAL_PM_LONG;
- Exclude checks
Reference to undeclared constant \_CAL_MON
Open
else if ($result1=='Mon') $result1=_CAL_MON;
- Exclude checks
Argument 1 (g_y)
is string
but \gregorian_to_jalali()
takes int
defined at /code/htdocs/include/jalali.php:55
Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Exclude checks
Argument 1 (g_y)
is string
but \gregorian_to_jalali()
takes int
defined at /code/htdocs/include/jalali.php:55
Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Exclude checks
Argument 1 (g_y)
is string
but \gregorian_to_jalali()
takes int
defined at /code/htdocs/include/jalali.php:55
Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Exclude checks
Argument 3 (g_d)
is string
but \gregorian_to_jalali()
takes int
defined at /code/htdocs/include/jalali.php:55
Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Exclude checks
Argument 3 (j_d)
is '1'
but \jalali_to_gregorian()
takes int
defined at /code/htdocs/include/jalali.php:102
Open
list( $year, $month, $day ) = jalali_to_gregorian($jyear, $jmonth, '1');
- Exclude checks
Argument 1 (g_y)
is string
but \gregorian_to_jalali()
takes int
defined at /code/htdocs/include/jalali.php:55
Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Exclude checks
Argument 3 (g_d)
is string
but \gregorian_to_jalali()
takes int
defined at /code/htdocs/include/jalali.php:55
Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Exclude checks
Argument 3 (g_d)
is string
but \gregorian_to_jalali()
takes int
defined at /code/htdocs/include/jalali.php:55
Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Exclude checks
Argument 3 (g_d)
is string
but \gregorian_to_jalali()
takes int
defined at /code/htdocs/include/jalali.php:55
Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Exclude checks
Argument 2 (g_m)
is string
but \gregorian_to_jalali()
takes int
defined at /code/htdocs/include/jalali.php:55
Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Exclude checks
Argument 2 (g_m)
is string
but \gregorian_to_jalali()
takes int
defined at /code/htdocs/include/jalali.php:55
Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Exclude checks
Invalid operator: right operand of +
is bool
(expected array or number) Open
$g_day_no -= $g_days_in_month[$i] + ($i == 1 && $leap);
- Exclude checks
Argument 1 (g_y)
is string
but \gregorian_to_jalali()
takes int
defined at /code/htdocs/include/jalali.php:55
Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Exclude checks
Argument 3 (g_d)
is string
but \gregorian_to_jalali()
takes int
defined at /code/htdocs/include/jalali.php:55
Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Exclude checks
Argument 1 (g_y)
is string
but \gregorian_to_jalali()
takes int
defined at /code/htdocs/include/jalali.php:55
Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Exclude checks
Argument 2 (g_m)
is string
but \gregorian_to_jalali()
takes int
defined at /code/htdocs/include/jalali.php:55
Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Exclude checks
Reference to undeclared constant \_CAL_SUNDAY
Open
else if ($result1=='Sunday') $result1=_CAL_SUNDAY;
- Exclude checks
Argument 1 (g_y)
is string
but \gregorian_to_jalali()
takes int
defined at /code/htdocs/include/jalali.php:55
Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Exclude checks
Argument 1 (g_y)
is string
but \gregorian_to_jalali()
takes int
defined at /code/htdocs/include/jalali.php:55
Open
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Exclude checks
The method lastday uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$day=0;
$month++;
if ($month==13)
{
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method jdate uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$date=date('Y-m-d',$maket);
list( $year, $month, $day ) = preg_split ( '/-/', $date );
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid assigning values to variables in if clauses and the like (line '188', column '8'). Open
function lastday ($month,$day,$year) {
$lastdayen=date('d',mktime(0,0,0,$month+1,0,$year));
list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
$lastdatep=$jday;
while ($jday!='1')
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Similar blocks of code found in 2 locations. Consider refactoring. Open
case 'D':
$result1=date('D',$need);
if ($result1=='Sat') $result1=_CAL_SAT;
else if ($result1=='Sun') $result1=_CAL_SUN;
else if ($result1=='Mon') $result1=_CAL_MON;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 180.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
case 'l':
$result1=date('l',$need);
if ($result1=='Saturday') $result1=_CAL_SATURDAY;
else if ($result1=='Sunday') $result1=_CAL_SUNDAY;
else if ($result1=='Monday') $result1=_CAL_MONDAY;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 180.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
The parameter $j_y is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
Avoid variables with short names like $jd. Configured minimum length is 3. Open
$jd = $j_day_no+1;
- 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 parameter $j_d is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
Avoid variables with short names like $gm. Configured minimum length is 3. Open
$gm = $g_m-1;
- 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
Avoid variables with short names like $jy. Configured minimum length is 3. Open
$jy = $j_y-979;
- 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
Avoid variables with short names like $gm. Configured minimum length is 3. Open
$gm = $i+1;
- 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 parameter $j_m is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
Avoid variables with short names like $gd. Configured minimum length is 3. Open
$gd = $g_day_no+1;
- 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
Avoid variables with short names like $jm. Configured minimum length is 3. Open
$jm = $i+1;
- 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
Avoid variables with short names like $gd. Configured minimum length is 3. Open
$gd = $g_d-1;
- 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
Avoid variables with short names like $jy. Configured minimum length is 3. Open
$jy = 979+33*$j_np+4*div($j_day_no,1461); /* 1461 = 365*4 + 4/4 */
- 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
Avoid variables with short names like $b. Configured minimum length is 3. Open
function div($a,$b) {
- 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 parameter $g_d is not named in camelCase. Open
function gregorian_to_jalali($g_y, $g_m, $g_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$gy = $g_y-1600;
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
Avoid variables with short names like $a. Configured minimum length is 3. Open
function div($a,$b) {
- 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 parameter $g_m is not named in camelCase. Open
function gregorian_to_jalali($g_y, $g_m, $g_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$gy = $g_y-1600;
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
Avoid variables with short names like $gy. Configured minimum length is 3. Open
$gy = $g_y-1600;
- 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
Avoid variables with short names like $i. Configured minimum length is 3. Open
$i=0;
- 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
Avoid variables with short names like $jm. Configured minimum length is 3. Open
$jm = $j_m-1;
- 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
Avoid variables with short names like $jd. Configured minimum length is 3. Open
$jd = $j_d-1;
- 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
Avoid variables with short names like $gy. Configured minimum length is 3. Open
$gy = 1600 + 400*div($g_day_no, 146097); /* 146097 = 365*400 + 400/4 - 400/100 + 400/400 */
- 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
Avoid variables with short names like $i. Configured minimum length is 3. Open
$i=mktime($hour,$minute,$second,$month,$day,$year);
- 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 parameter $g_y is not named in camelCase. Open
function gregorian_to_jalali($g_y, $g_m, $g_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$gy = $g_y-1600;
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
Incorrect spacing between default value and equals sign for argument "$maket"; expected 1 but found 0 Open
function jdate($type,$maket='now') {
- Exclude checks
Expected 0 spaces before opening parenthesis; 1 found Open
function lastday ($month,$day,$year) {
- Exclude checks
Expected 1 space after comma in function call; 2 found Open
$gy += 100*div($g_day_no, 36524); /* 36524 = 365*100 + 100/4 - 100/100 */
- Exclude checks
Expected "function abc(...)"; found "function abc (...)" Open
function lastday ($month,$day,$year) {
- Exclude checks
Blank line found at end of control structure Open
- Exclude checks
Blank line found at start of control structure Open
{
- Exclude checks
Incorrect spacing between argument "$maket" and equals sign; expected 1 but found 0 Open
function jdate($type,$maket='now') {
- Exclude checks
CASE keyword must be followed by a single space Open
case'F':
- Exclude checks
Inline control structures are not allowed Open
if ($jday<10)$result1='0'.$jday;
- Exclude checks
Inline control structures are not allowed Open
for ($i=0; $i < $jm; ++$i)
- Exclude checks
Inline control structures are not allowed Open
else $result1=$jmonth;
- Exclude checks
Inline control structures are not allowed Open
else if ($result1=='Sun') $result1=_CAL_SUN;
- Exclude checks
Inline control structures are not allowed Open
else if ($result1=='Monday') $result1=_CAL_MONDAY;
- Exclude checks
Inline control structures are not allowed Open
else if ($result1=='Mon') $result1=_CAL_MON;
- Exclude checks
Inline control structures are not allowed Open
else if ($result1=='Thu') $result1=_CAL_THU;
- Exclude checks
Inline control structures are not allowed Open
else $result.=_CAL_AM_LONG;
- Exclude checks
Inline control structures are not allowed Open
if ($result1=='Sat') $result1=_CAL_SAT;
- Exclude checks
Inline control structures are not allowed Open
else if ($result1=='Sunday') $result1=_CAL_SUNDAY;
- Exclude checks
Inline control structures are not allowed Open
for ($i = 0; $i < 11 && $j_day_no >= $j_days_in_month[$i]; ++$i)
- Exclude checks
Inline control structures are not allowed Open
if ($result1=='Saturday') $result1=_CAL_SATURDAY;
- Exclude checks
Inline control structures are not allowed Open
if ($result1=='pm') $result.=_CAL_PM_LONG;
- Exclude checks
Inline control structures are not allowed Open
else if ($result1=='Thursday') $result1=_CAL_THURSDAY;
- Exclude checks
Inline control structures are not allowed Open
else if ($result1=='Friday') $result1=_CAL_FRIDAY;
- Exclude checks
Inline control structures are not allowed Open
else if ($result1=='Wednesday') $result1=_CAL_WEDNESDAY;
- Exclude checks
Inline control structures are not allowed Open
if ($jmonth<10) $result1='0'.$jmonth;
- Exclude checks
Inline control structures are not allowed Open
else if ($result1=='Tuesday') $result1=_CAL_TUESDAY;
- Exclude checks
Inline control structures are not allowed Open
for ($i = 0; $g_day_no >= $g_days_in_month[$i] + ($i == 1 && $leap); $i++)
- Exclude checks
Inline control structures are not allowed Open
if ($jday='1') $lastdatep++;
- Exclude checks
Inline control structures are not allowed Open
else if ($result1=='Tue') $result1=_CAL_TUE;
- Exclude checks
Inline control structures are not allowed Open
for ($i=0; $i < $gm; ++$i)
- Exclude checks
Inline control structures are not allowed Open
if ($gm>1 && (($gy%4==0 && $gy%100!=0) || ($gy%400==0)))
- Exclude checks
Inline control structures are not allowed Open
else $result.=_CAL_AM;
- Exclude checks
Inline control structures are not allowed Open
if ($jday=='1') break;
- Exclude checks
Inline control structures are not allowed Open
else if ($result1=='Fri') $result1=_CAL_FRI;
- Exclude checks
Inline control structures are not allowed Open
if ($g_day_no >= 365)
- Exclude checks
Inline control structures are not allowed Open
else if ($result1=='Wed') $result1=_CAL_WED;
- Exclude checks
Inline control structures are not allowed Open
else $result1=$jday;
- Exclude checks
Inline control structures are not allowed Open
else
- Exclude checks
Inline control structures are not allowed Open
if ($result1=='pm') $result.=_CAL_PM;
- Exclude checks
Expected 1 space after closing parenthesis; found 13 Open
if ($month==13)
- Exclude checks
No space found after comma in function call Open
$maket=jmaketime(date('h'),date('i'),date('s'),$jmonth,$jday,$jyear);
- Exclude checks
No space found after comma in function call Open
$year=date('Y',$need);
- Exclude checks
No space found after comma in function call Open
$result.=lastday ($month,$day,$year);
- Exclude checks
No space found after comma in function call Open
$jy = 979+33*$j_np+4*div($j_day_no,1461); /* 1461 = 365*4 + 4/4 */
- Exclude checks
Expected 1 space between comma and argument "$year"; 0 found Open
function mstart($month,$day,$year) {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
list( $year, $month, $day ) = preg_split ( '/-/', $date );
- Exclude checks
No space found after comma in function call Open
$result.=date('G',$need);
- Exclude checks
No space found after comma in function call Open
$result.=date('h',$need);
- Exclude checks
No space found after comma in function call Open
$g_day_no = 365*$gy+div($gy+3,4)-div($gy+99,100)+div($gy+399,400);
- Exclude checks
Line indented incorrectly; expected at least 2 tabs, found 1 Open
$gy += 100*div($g_day_no, 36524); /* 36524 = 365*100 + 100/4 - 100/100 */
- Exclude checks
No space found after comma in function call Open
$i=mktime($hour,$minute,$second,$month,$day,$year);
- Exclude checks
No space found after comma in function call Open
$maket=jmaketime(date('h'),date('i'),date('s'),$jmonth,$jday,$jyear);
- Exclude checks
No space found after comma in function call Open
$month=date('m',$need);
- Exclude checks
Line indented incorrectly; expected 2 tabs, found 1 Open
else
- Exclude checks
Expected 1 space between comma and argument "$day"; 0 found Open
function mstart($month,$day,$year) {
- Exclude checks
No space found after comma in function call Open
$timestamp=mktime(0,0,0,$month,$day,$year);
- Exclude checks
Expected 1 space between comma and argument "$minute"; 0 found Open
function jmaketime($hour,$minute,$second,$jmonth,$jday,$jyear) {
- Exclude checks
Expected 1 space between comma and argument "$jyear"; 0 found Open
function jmaketime($hour,$minute,$second,$jmonth,$jday,$jyear) {
- Exclude checks
No space found after comma in function call Open
$result1=date('a',$need);
- Exclude checks
No space found after comma in function call Open
$result.=substr($jyear,2,4);
- Exclude checks
No space found after comma in function call Open
$timestamp=mktime(0,0,0,$month,$day,$year);
- Exclude checks
No space found after comma in function call Open
$timestamp=mktime(0,0,0,$month,$day,$year);
- Exclude checks
No space found after comma in function call Open
$timestamp=mktime(0,0,0,$month,$day,$year);
- Exclude checks
No space found after comma in function call Open
$lastdayen=date('d',mktime(0,0,0,$month+1,0,$year));
- Exclude checks
No space found after comma in function call Open
$day=date('d',$need);
- Exclude checks
No space found after comma in function call Open
$result.=date('w',$need);
- Exclude checks
Line indented incorrectly; expected at least 2 tabs, found 1 Open
$g_day_no = $g_day_no % 36524;
- Exclude checks
No space found after comma in function call Open
$i=mktime($hour,$minute,$second,$month,$day,$year);
- Exclude checks
Space before opening parenthesis of function call prohibited Open
$result.=lastday ($month,$day,$year);
- Exclude checks
No space found after comma in function call Open
$g_day_no = 365*$gy+div($gy+3,4)-div($gy+99,100)+div($gy+399,400);
- Exclude checks
Line indented incorrectly; expected at least 2 tabs, found 1 Open
$g_day_no--;
- Exclude checks
No space found after comma in function call Open
$timestamp=mktime(0,0,0,$month,$day,$year);
- Exclude checks
Line indented incorrectly; expected at least 2 tabs, found 1 Open
if ($g_day_no >= 365)
- Exclude checks
No space found after comma in function call Open
$result.=date('g',$need);
- Exclude checks
Expected 1 space between comma and argument "$year"; 0 found Open
function lastday ($month,$day,$year) {
- Exclude checks
No space found after comma in function call Open
$result1=date('a',$need);
- Exclude checks
No space found after comma in function call Open
$result.=date('s',$need);
- Exclude checks
Expected 1 space after closing parenthesis; found " /* 36525 = 365*100 + 100/4 */\n " Open
if ($g_day_no >= 36525) /* 36525 = 365*100 + 100/4 */
- Exclude checks
Line indented incorrectly; expected at least 2 tabs, found 1 Open
$leap = false;
- Exclude checks
Expected 1 space after closing parenthesis; found 5 Open
while ($jday!='1')
- Exclude checks
Expected 1 space after closing parenthesis; found 9 Open
if ($day<$lastdayen)
- Exclude checks
No space found after comma in function call Open
$maket=jmaketime(date('h'),date('i'),date('s'),$jmonth,$jday,$jyear);
- Exclude checks
No space found after comma in function call Open
$result.=date('H',$need);
- Exclude checks
No space found after comma in function call Open
$result.=date('i',$need);
- Exclude checks
Expected 1 space after ELSE keyword; newline found Open
else
- Exclude checks
Expected 1 space after closing parenthesis; found 9 Open
switch ($subtype)
- Exclude checks
Expected 1 space after ELSE keyword; 4 found Open
else $result1=$jday;
- Exclude checks
Expected 1 space between comma and argument "$b"; 0 found Open
function div($a,$b) {
- Exclude checks
Line indented incorrectly; expected at least 2 tabs, found 1 Open
$gy += div($g_day_no, 365);
- Exclude checks
No space found after comma in function call Open
$lastdayen=date('d',mktime(0,0,0,$month+1,0,$year));
- Exclude checks
Expected 1 space after ELSE keyword; 4 found Open
else $result1=$jmonth;
- Exclude checks
Line indented incorrectly; expected at least 2 tabs, found 1 Open
$g_day_no = $g_day_no % 365;
- Exclude checks
No space found after comma in function call Open
$lastdayen=date('d',mktime(0,0,0,$month+1,0,$year));
- Exclude checks
No space found after comma in function call Open
$lastdayen=date('d',mktime(0,0,0,$month+1,0,$year));
- Exclude checks
Expected 1 space between comma and argument "$second"; 0 found Open
function jmaketime($hour,$minute,$second,$jmonth,$jday,$jyear) {
- Exclude checks
Expected 1 space between comma and argument "$jmonth"; 0 found Open
function jmaketime($hour,$minute,$second,$jmonth,$jday,$jyear) {
- Exclude checks
Expected 1 space between comma and argument "$jday"; 0 found Open
function jmaketime($hour,$minute,$second,$jmonth,$jday,$jyear) {
- Exclude checks
No space found after comma in function call Open
$i=mktime($hour,$minute,$second,$month,$day,$year);
- Exclude checks
No space found after comma in function call Open
$i=mktime($hour,$minute,$second,$month,$day,$year);
- Exclude checks
No space found after comma in function call Open
$i=mktime($hour,$minute,$second,$month,$day,$year);
- Exclude checks
No space found after comma in function call Open
$maket=jmaketime(date('h'),date('i'),date('s'),$jmonth,$jday,$jyear);
- Exclude checks
Space before opening parenthesis of function call prohibited Open
list( $year, $month, $day ) = preg_split ( '/-/', $date );
- Exclude checks
Expected 1 space after closing parenthesis; found 5 Open
while ($i<strlen($type))
- Exclude checks
No space found after comma in function call Open
$subtype=substr($type,$i,1);
- Exclude checks
No space found after comma in function call Open
$subtype=substr($type,$i,1);
- Exclude checks
No space found after comma in function call Open
$result1=date('l',$need);
- Exclude checks
No space found after comma in function call Open
$result.=lastday ($month,$day,$year);
- Exclude checks
Line indented incorrectly; expected at least 2 tabs, found 1 Open
$g_day_no--;
- Exclude checks
No space found after comma in function call Open
$lastdayen=date('d',mktime(0,0,0,$month+1,0,$year));
- Exclude checks
No space found after comma in function call Open
$lastdayen=date('d',mktime(0,0,0,$month+1,0,$year));
- Exclude checks
No space found after comma in function call Open
$result.=substr($jyear,2,4);
- Exclude checks
Expected 1 newline at end of file; 0 found Open
}
- Exclude checks
No space found after comma in function call Open
return date('w',$timestamp);
- Exclude checks
Expected 1 space between comma and argument "$day"; 0 found Open
function lastday ($month,$day,$year) {
- Exclude checks
No space found after comma in function call Open
$date=date('Y-m-d',$maket);
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
list( $year, $month, $day ) = preg_split ( '/-/', $date );
- Exclude checks
No space found after comma in function call Open
$g_day_no = 365*$gy+div($gy+3,4)-div($gy+99,100)+div($gy+399,400);
- Exclude checks
Expected 1 space between comma and argument "$maket"; 0 found Open
function jdate($type,$maket='now') {
- Exclude checks
No space found after comma in function call Open
$maket=jmaketime(date('h'),date('i'),date('s'),$jmonth,$jday,$jyear);
- Exclude checks
No space found after comma in function call Open
$result1=date('D',$need);
- Exclude checks
The variable $j_day_no is not named in camelCase. Open
function gregorian_to_jalali($g_y, $g_m, $g_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$gy = $g_y-1600;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $j_m is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $g_day_no is not named in camelCase. Open
function gregorian_to_jalali($g_y, $g_m, $g_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$gy = $g_y-1600;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $j_np is not named in camelCase. Open
function gregorian_to_jalali($g_y, $g_m, $g_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$gy = $g_y-1600;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $j_day_no is not named in camelCase. Open
function gregorian_to_jalali($g_y, $g_m, $g_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$gy = $g_y-1600;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $g_y is not named in camelCase. Open
function gregorian_to_jalali($g_y, $g_m, $g_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$gy = $g_y-1600;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $g_days_in_month is not named in camelCase. Open
function gregorian_to_jalali($g_y, $g_m, $g_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$gy = $g_y-1600;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $g_day_no is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $j_day_no is not named in camelCase. Open
function gregorian_to_jalali($g_y, $g_m, $g_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$gy = $g_y-1600;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $g_day_no is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $j_day_no is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $g_day_no is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $g_day_no is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $g_day_no is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $g_day_no is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $g_day_no is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $g_day_no is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $g_day_no is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $g_day_no is not named in camelCase. Open
function gregorian_to_jalali($g_y, $g_m, $g_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$gy = $g_y-1600;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $g_day_no is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $g_days_in_month is not named in camelCase. Open
function gregorian_to_jalali($g_y, $g_m, $g_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$gy = $g_y-1600;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $g_d is not named in camelCase. Open
function gregorian_to_jalali($g_y, $g_m, $g_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$gy = $g_y-1600;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $g_day_no is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $g_day_no is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $j_days_in_month is not named in camelCase. Open
function gregorian_to_jalali($g_y, $g_m, $g_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$gy = $g_y-1600;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $j_day_no is not named in camelCase. Open
function gregorian_to_jalali($g_y, $g_m, $g_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$gy = $g_y-1600;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $j_day_no is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $j_day_no is not named in camelCase. Open
function gregorian_to_jalali($g_y, $g_m, $g_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$gy = $g_y-1600;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $g_day_no is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $j_day_no is not named in camelCase. Open
function gregorian_to_jalali($g_y, $g_m, $g_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$gy = $g_y-1600;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $g_days_in_month is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $g_day_no is not named in camelCase. Open
function gregorian_to_jalali($g_y, $g_m, $g_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$gy = $g_y-1600;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $g_days_in_month is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $j_day_no is not named in camelCase. Open
function gregorian_to_jalali($g_y, $g_m, $g_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$gy = $g_y-1600;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $g_day_no is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $g_day_no is not named in camelCase. Open
function gregorian_to_jalali($g_y, $g_m, $g_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$gy = $g_y-1600;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $g_day_no is not named in camelCase. Open
function gregorian_to_jalali($g_y, $g_m, $g_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$gy = $g_y-1600;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $j_days_in_month is not named in camelCase. Open
function gregorian_to_jalali($g_y, $g_m, $g_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$gy = $g_y-1600;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $g_day_no is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $g_days_in_month is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $j_day_no is not named in camelCase. Open
function gregorian_to_jalali($g_y, $g_m, $g_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$gy = $g_y-1600;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $j_day_no is not named in camelCase. Open
function gregorian_to_jalali($g_y, $g_m, $g_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$gy = $g_y-1600;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $j_day_no is not named in camelCase. Open
function gregorian_to_jalali($g_y, $g_m, $g_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$gy = $g_y-1600;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $j_days_in_month is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $j_d is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $g_m is not named in camelCase. Open
function gregorian_to_jalali($g_y, $g_m, $g_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$gy = $g_y-1600;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $j_day_no is not named in camelCase. Open
function gregorian_to_jalali($g_y, $g_m, $g_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$gy = $g_y-1600;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $j_day_no is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $j_days_in_month is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $g_day_no is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $g_day_no is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $j_day_no is not named in camelCase. Open
function gregorian_to_jalali($g_y, $g_m, $g_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$gy = $g_y-1600;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $j_day_no is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $g_day_no is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $j_day_no is not named in camelCase. Open
function gregorian_to_jalali($g_y, $g_m, $g_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$gy = $g_y-1600;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $j_y is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $g_day_no is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $g_day_no is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $j_np is not named in camelCase. Open
function gregorian_to_jalali($g_y, $g_m, $g_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$gy = $g_y-1600;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $j_days_in_month is not named in camelCase. Open
function gregorian_to_jalali($g_y, $g_m, $g_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$gy = $g_y-1600;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $g_day_no is not named in camelCase. Open
function jalali_to_gregorian($j_y, $j_m, $j_d) {
$g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
$jy = $j_y-979;
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
Unexpected spaces found. Open
$g_day_no = $g_day_no % 36524;
- Exclude checks
Unexpected spaces found. Open
if ($g_day_no >= 365)
- Exclude checks
Unexpected spaces found. Open
else
- Exclude checks
Unexpected spaces found. Open
$gy += div($g_day_no, 365);
- Exclude checks
Unexpected spaces found. Open
$g_day_no = $g_day_no % 365;
- Exclude checks
Unexpected spaces found. Open
$gy += 100*div($g_day_no, 36524); /* 36524 = 365*100 + 100/4 - 100/100 */
- Exclude checks
Unexpected spaces found. Open
$leap = false;
- Exclude checks
Unexpected spaces found. Open
$g_day_no--;
- Exclude checks
Unexpected spaces found. Open
$g_day_no--;
- Exclude checks