mambax7/extcal

View on GitHub

Showing 1,163 of 1,163 total issues

Similar blocks of code found in 28 locations. Consider refactoring.
Open

            case '1TU':

                $ts        = \mktime(0, 0, 0, $month, 1, $year);
                $dayOfWeek = \date('w', $ts);
                $ts        = (2 == \date('w', $ts)) ? $ts + (\_EXTCAL_TS_DAY * 7) : $ts;
Severity: Major
Found in class/EventHandler.php and 27 other locations - About 2 hrs to fix
class/EventHandler.php on lines 1695..1707
class/EventHandler.php on lines 1708..1720
class/EventHandler.php on lines 1734..1746
class/EventHandler.php on lines 1747..1759
class/EventHandler.php on lines 1760..1772
class/EventHandler.php on lines 1773..1785
class/EventHandler.php on lines 1786..1798
class/EventHandler.php on lines 1799..1811
class/EventHandler.php on lines 1812..1824
class/EventHandler.php on lines 1825..1837
class/EventHandler.php on lines 1838..1850
class/EventHandler.php on lines 1851..1863
class/EventHandler.php on lines 1864..1876
class/EventHandler.php on lines 1877..1889
class/EventHandler.php on lines 1890..1902
class/EventHandler.php on lines 1903..1915
class/EventHandler.php on lines 1916..1928
class/EventHandler.php on lines 1929..1941
class/EventHandler.php on lines 1942..1954
class/EventHandler.php on lines 1955..1967
class/EventHandler.php on lines 1968..1980
class/EventHandler.php on lines 1981..1993
class/EventHandler.php on lines 1994..2006
class/EventHandler.php on lines 2007..2019
class/EventHandler.php on lines 2020..2032
class/EventHandler.php on lines 2033..2045
class/EventHandler.php on lines 2046..2058

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 132.

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

Further Reading

Similar blocks of code found in 28 locations. Consider refactoring.
Open

            case '3SU':

                $ts        = \mktime(0, 0, 0, $month, 14, $year);
                $dayOfWeek = \date('w', $ts);
                $ts        = (0 == \date('w', $ts)) ? $ts + (\_EXTCAL_TS_DAY * 7) : $ts;
Severity: Major
Found in class/EventHandler.php and 27 other locations - About 2 hrs to fix
class/EventHandler.php on lines 1695..1707
class/EventHandler.php on lines 1708..1720
class/EventHandler.php on lines 1721..1733
class/EventHandler.php on lines 1734..1746
class/EventHandler.php on lines 1747..1759
class/EventHandler.php on lines 1760..1772
class/EventHandler.php on lines 1773..1785
class/EventHandler.php on lines 1786..1798
class/EventHandler.php on lines 1799..1811
class/EventHandler.php on lines 1812..1824
class/EventHandler.php on lines 1825..1837
class/EventHandler.php on lines 1838..1850
class/EventHandler.php on lines 1851..1863
class/EventHandler.php on lines 1864..1876
class/EventHandler.php on lines 1890..1902
class/EventHandler.php on lines 1903..1915
class/EventHandler.php on lines 1916..1928
class/EventHandler.php on lines 1929..1941
class/EventHandler.php on lines 1942..1954
class/EventHandler.php on lines 1955..1967
class/EventHandler.php on lines 1968..1980
class/EventHandler.php on lines 1981..1993
class/EventHandler.php on lines 1994..2006
class/EventHandler.php on lines 2007..2019
class/EventHandler.php on lines 2020..2032
class/EventHandler.php on lines 2033..2045
class/EventHandler.php on lines 2046..2058

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 132.

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

Further Reading

Similar blocks of code found in 28 locations. Consider refactoring.
Open

            case '1SU':

                $ts        = \mktime(0, 0, 0, $month, 1, $year);
                $dayOfWeek = \date('w', $ts);
                $ts        = (0 == \date('w', $ts)) ? $ts + (\_EXTCAL_TS_DAY * 7) : $ts;
Severity: Major
Found in class/EventHandler.php and 27 other locations - About 2 hrs to fix
class/EventHandler.php on lines 1708..1720
class/EventHandler.php on lines 1721..1733
class/EventHandler.php on lines 1734..1746
class/EventHandler.php on lines 1747..1759
class/EventHandler.php on lines 1760..1772
class/EventHandler.php on lines 1773..1785
class/EventHandler.php on lines 1786..1798
class/EventHandler.php on lines 1799..1811
class/EventHandler.php on lines 1812..1824
class/EventHandler.php on lines 1825..1837
class/EventHandler.php on lines 1838..1850
class/EventHandler.php on lines 1851..1863
class/EventHandler.php on lines 1864..1876
class/EventHandler.php on lines 1877..1889
class/EventHandler.php on lines 1890..1902
class/EventHandler.php on lines 1903..1915
class/EventHandler.php on lines 1916..1928
class/EventHandler.php on lines 1929..1941
class/EventHandler.php on lines 1942..1954
class/EventHandler.php on lines 1955..1967
class/EventHandler.php on lines 1968..1980
class/EventHandler.php on lines 1981..1993
class/EventHandler.php on lines 1994..2006
class/EventHandler.php on lines 2007..2019
class/EventHandler.php on lines 2020..2032
class/EventHandler.php on lines 2033..2045
class/EventHandler.php on lines 2046..2058

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 132.

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

Further Reading

Similar blocks of code found in 28 locations. Consider refactoring.
Open

            case '1MO':

                $ts        = \mktime(0, 0, 0, $month, 1, $year);
                $dayOfWeek = \date('w', $ts);
                $ts        = (1 == \date('w', $ts)) ? $ts + (\_EXTCAL_TS_DAY * 7) : $ts;
Severity: Major
Found in class/EventHandler.php and 27 other locations - About 2 hrs to fix
class/EventHandler.php on lines 1695..1707
class/EventHandler.php on lines 1721..1733
class/EventHandler.php on lines 1734..1746
class/EventHandler.php on lines 1747..1759
class/EventHandler.php on lines 1760..1772
class/EventHandler.php on lines 1773..1785
class/EventHandler.php on lines 1786..1798
class/EventHandler.php on lines 1799..1811
class/EventHandler.php on lines 1812..1824
class/EventHandler.php on lines 1825..1837
class/EventHandler.php on lines 1838..1850
class/EventHandler.php on lines 1851..1863
class/EventHandler.php on lines 1864..1876
class/EventHandler.php on lines 1877..1889
class/EventHandler.php on lines 1890..1902
class/EventHandler.php on lines 1903..1915
class/EventHandler.php on lines 1916..1928
class/EventHandler.php on lines 1929..1941
class/EventHandler.php on lines 1942..1954
class/EventHandler.php on lines 1955..1967
class/EventHandler.php on lines 1968..1980
class/EventHandler.php on lines 1981..1993
class/EventHandler.php on lines 1994..2006
class/EventHandler.php on lines 2007..2019
class/EventHandler.php on lines 2020..2032
class/EventHandler.php on lines 2033..2045
class/EventHandler.php on lines 2046..2058

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 132.

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

Further Reading

Similar blocks of code found in 28 locations. Consider refactoring.
Open

            case '1WE':

                $ts        = \mktime(0, 0, 0, $month, 1, $year);
                $dayOfWeek = \date('w', $ts);
                $ts        = (3 == \date('w', $ts)) ? $ts + (\_EXTCAL_TS_DAY * 7) : $ts;
Severity: Major
Found in class/EventHandler.php and 27 other locations - About 2 hrs to fix
class/EventHandler.php on lines 1695..1707
class/EventHandler.php on lines 1708..1720
class/EventHandler.php on lines 1721..1733
class/EventHandler.php on lines 1747..1759
class/EventHandler.php on lines 1760..1772
class/EventHandler.php on lines 1773..1785
class/EventHandler.php on lines 1786..1798
class/EventHandler.php on lines 1799..1811
class/EventHandler.php on lines 1812..1824
class/EventHandler.php on lines 1825..1837
class/EventHandler.php on lines 1838..1850
class/EventHandler.php on lines 1851..1863
class/EventHandler.php on lines 1864..1876
class/EventHandler.php on lines 1877..1889
class/EventHandler.php on lines 1890..1902
class/EventHandler.php on lines 1903..1915
class/EventHandler.php on lines 1916..1928
class/EventHandler.php on lines 1929..1941
class/EventHandler.php on lines 1942..1954
class/EventHandler.php on lines 1955..1967
class/EventHandler.php on lines 1968..1980
class/EventHandler.php on lines 1981..1993
class/EventHandler.php on lines 1994..2006
class/EventHandler.php on lines 2007..2019
class/EventHandler.php on lines 2020..2032
class/EventHandler.php on lines 2033..2045
class/EventHandler.php on lines 2046..2058

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 132.

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

Further Reading

Similar blocks of code found in 28 locations. Consider refactoring.
Open

            case '4TU':

                $ts        = \mktime(0, 0, 0, $month, 21, $year);
                $dayOfWeek = \date('w', $ts);
                $ts        = (2 == \date('w', $ts)) ? $ts + (\_EXTCAL_TS_DAY * 7) : $ts;
Severity: Major
Found in class/EventHandler.php and 27 other locations - About 2 hrs to fix
class/EventHandler.php on lines 1695..1707
class/EventHandler.php on lines 1708..1720
class/EventHandler.php on lines 1721..1733
class/EventHandler.php on lines 1734..1746
class/EventHandler.php on lines 1747..1759
class/EventHandler.php on lines 1760..1772
class/EventHandler.php on lines 1773..1785
class/EventHandler.php on lines 1786..1798
class/EventHandler.php on lines 1799..1811
class/EventHandler.php on lines 1812..1824
class/EventHandler.php on lines 1825..1837
class/EventHandler.php on lines 1838..1850
class/EventHandler.php on lines 1851..1863
class/EventHandler.php on lines 1864..1876
class/EventHandler.php on lines 1877..1889
class/EventHandler.php on lines 1890..1902
class/EventHandler.php on lines 1903..1915
class/EventHandler.php on lines 1916..1928
class/EventHandler.php on lines 1929..1941
class/EventHandler.php on lines 1942..1954
class/EventHandler.php on lines 1955..1967
class/EventHandler.php on lines 1968..1980
class/EventHandler.php on lines 1981..1993
class/EventHandler.php on lines 2007..2019
class/EventHandler.php on lines 2020..2032
class/EventHandler.php on lines 2033..2045
class/EventHandler.php on lines 2046..2058

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 132.

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

Further Reading

Similar blocks of code found in 28 locations. Consider refactoring.
Open

            case '4SA':

                $ts        = \mktime(0, 0, 0, $month, 21, $year);
                $dayOfWeek = \date('w', $ts);
                $ts        = (6 == \date('w', $ts)) ? $ts + (\_EXTCAL_TS_DAY * 7) : $ts;
Severity: Major
Found in class/EventHandler.php and 27 other locations - About 2 hrs to fix
class/EventHandler.php on lines 1695..1707
class/EventHandler.php on lines 1708..1720
class/EventHandler.php on lines 1721..1733
class/EventHandler.php on lines 1734..1746
class/EventHandler.php on lines 1747..1759
class/EventHandler.php on lines 1760..1772
class/EventHandler.php on lines 1773..1785
class/EventHandler.php on lines 1786..1798
class/EventHandler.php on lines 1799..1811
class/EventHandler.php on lines 1812..1824
class/EventHandler.php on lines 1825..1837
class/EventHandler.php on lines 1838..1850
class/EventHandler.php on lines 1851..1863
class/EventHandler.php on lines 1864..1876
class/EventHandler.php on lines 1877..1889
class/EventHandler.php on lines 1890..1902
class/EventHandler.php on lines 1903..1915
class/EventHandler.php on lines 1916..1928
class/EventHandler.php on lines 1929..1941
class/EventHandler.php on lines 1942..1954
class/EventHandler.php on lines 1955..1967
class/EventHandler.php on lines 1968..1980
class/EventHandler.php on lines 1981..1993
class/EventHandler.php on lines 1994..2006
class/EventHandler.php on lines 2007..2019
class/EventHandler.php on lines 2020..2032
class/EventHandler.php on lines 2033..2045

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 132.

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

Further Reading

Similar blocks of code found in 28 locations. Consider refactoring.
Open

            case '4WE':

                $ts        = \mktime(0, 0, 0, $month, 21, $year);
                $dayOfWeek = \date('w', $ts);
                $ts        = (3 == \date('w', $ts)) ? $ts + (\_EXTCAL_TS_DAY * 7) : $ts;
Severity: Major
Found in class/EventHandler.php and 27 other locations - About 2 hrs to fix
class/EventHandler.php on lines 1695..1707
class/EventHandler.php on lines 1708..1720
class/EventHandler.php on lines 1721..1733
class/EventHandler.php on lines 1734..1746
class/EventHandler.php on lines 1747..1759
class/EventHandler.php on lines 1760..1772
class/EventHandler.php on lines 1773..1785
class/EventHandler.php on lines 1786..1798
class/EventHandler.php on lines 1799..1811
class/EventHandler.php on lines 1812..1824
class/EventHandler.php on lines 1825..1837
class/EventHandler.php on lines 1838..1850
class/EventHandler.php on lines 1851..1863
class/EventHandler.php on lines 1864..1876
class/EventHandler.php on lines 1877..1889
class/EventHandler.php on lines 1890..1902
class/EventHandler.php on lines 1903..1915
class/EventHandler.php on lines 1916..1928
class/EventHandler.php on lines 1929..1941
class/EventHandler.php on lines 1942..1954
class/EventHandler.php on lines 1955..1967
class/EventHandler.php on lines 1968..1980
class/EventHandler.php on lines 1981..1993
class/EventHandler.php on lines 1994..2006
class/EventHandler.php on lines 2020..2032
class/EventHandler.php on lines 2033..2045
class/EventHandler.php on lines 2046..2058

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 132.

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

Further Reading

Similar blocks of code found in 28 locations. Consider refactoring.
Open

            case '4MO':

                $ts        = \mktime(0, 0, 0, $month, 21, $year);
                $dayOfWeek = \date('w', $ts);
                $ts        = (1 == \date('w', $ts)) ? $ts + (\_EXTCAL_TS_DAY * 7) : $ts;
Severity: Major
Found in class/EventHandler.php and 27 other locations - About 2 hrs to fix
class/EventHandler.php on lines 1695..1707
class/EventHandler.php on lines 1708..1720
class/EventHandler.php on lines 1721..1733
class/EventHandler.php on lines 1734..1746
class/EventHandler.php on lines 1747..1759
class/EventHandler.php on lines 1760..1772
class/EventHandler.php on lines 1773..1785
class/EventHandler.php on lines 1786..1798
class/EventHandler.php on lines 1799..1811
class/EventHandler.php on lines 1812..1824
class/EventHandler.php on lines 1825..1837
class/EventHandler.php on lines 1838..1850
class/EventHandler.php on lines 1851..1863
class/EventHandler.php on lines 1864..1876
class/EventHandler.php on lines 1877..1889
class/EventHandler.php on lines 1890..1902
class/EventHandler.php on lines 1903..1915
class/EventHandler.php on lines 1916..1928
class/EventHandler.php on lines 1929..1941
class/EventHandler.php on lines 1942..1954
class/EventHandler.php on lines 1955..1967
class/EventHandler.php on lines 1968..1980
class/EventHandler.php on lines 1994..2006
class/EventHandler.php on lines 2007..2019
class/EventHandler.php on lines 2020..2032
class/EventHandler.php on lines 2033..2045
class/EventHandler.php on lines 2046..2058

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 132.

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

Further Reading

Similar blocks of code found in 28 locations. Consider refactoring.
Open

            case '4TH':

                $ts        = \mktime(0, 0, 0, $month, 21, $year);
                $dayOfWeek = \date('w', $ts);
                $ts        = (4 == \date('w', $ts)) ? $ts + (\_EXTCAL_TS_DAY * 7) : $ts;
Severity: Major
Found in class/EventHandler.php and 27 other locations - About 2 hrs to fix
class/EventHandler.php on lines 1695..1707
class/EventHandler.php on lines 1708..1720
class/EventHandler.php on lines 1721..1733
class/EventHandler.php on lines 1734..1746
class/EventHandler.php on lines 1747..1759
class/EventHandler.php on lines 1760..1772
class/EventHandler.php on lines 1773..1785
class/EventHandler.php on lines 1786..1798
class/EventHandler.php on lines 1799..1811
class/EventHandler.php on lines 1812..1824
class/EventHandler.php on lines 1825..1837
class/EventHandler.php on lines 1838..1850
class/EventHandler.php on lines 1851..1863
class/EventHandler.php on lines 1864..1876
class/EventHandler.php on lines 1877..1889
class/EventHandler.php on lines 1890..1902
class/EventHandler.php on lines 1903..1915
class/EventHandler.php on lines 1916..1928
class/EventHandler.php on lines 1929..1941
class/EventHandler.php on lines 1942..1954
class/EventHandler.php on lines 1955..1967
class/EventHandler.php on lines 1968..1980
class/EventHandler.php on lines 1981..1993
class/EventHandler.php on lines 1994..2006
class/EventHandler.php on lines 2007..2019
class/EventHandler.php on lines 2033..2045
class/EventHandler.php on lines 2046..2058

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 132.

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

Further Reading

Similar blocks of code found in 28 locations. Consider refactoring.
Open

            case '4FR':

                $ts        = \mktime(0, 0, 0, $month, 21, $year);
                $dayOfWeek = \date('w', $ts);
                $ts        = (5 == \date('w', $ts)) ? $ts + (\_EXTCAL_TS_DAY * 7) : $ts;
Severity: Major
Found in class/EventHandler.php and 27 other locations - About 2 hrs to fix
class/EventHandler.php on lines 1695..1707
class/EventHandler.php on lines 1708..1720
class/EventHandler.php on lines 1721..1733
class/EventHandler.php on lines 1734..1746
class/EventHandler.php on lines 1747..1759
class/EventHandler.php on lines 1760..1772
class/EventHandler.php on lines 1773..1785
class/EventHandler.php on lines 1786..1798
class/EventHandler.php on lines 1799..1811
class/EventHandler.php on lines 1812..1824
class/EventHandler.php on lines 1825..1837
class/EventHandler.php on lines 1838..1850
class/EventHandler.php on lines 1851..1863
class/EventHandler.php on lines 1864..1876
class/EventHandler.php on lines 1877..1889
class/EventHandler.php on lines 1890..1902
class/EventHandler.php on lines 1903..1915
class/EventHandler.php on lines 1916..1928
class/EventHandler.php on lines 1929..1941
class/EventHandler.php on lines 1942..1954
class/EventHandler.php on lines 1955..1967
class/EventHandler.php on lines 1968..1980
class/EventHandler.php on lines 1981..1993
class/EventHandler.php on lines 1994..2006
class/EventHandler.php on lines 2007..2019
class/EventHandler.php on lines 2020..2032
class/EventHandler.php on lines 2046..2058

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 132.

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

Further Reading

Function htmlCreate has 63 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        htmlCreate: function () {
            if (!hs.fireEvent(this, 'onBeforeGetContent')) return;

            this.content = hs.getCacheBinding(this.a);
            if (!this.content)
Severity: Major
Found in assets/js/highslide-full.js - About 2 hrs to fix

    Method truncateHtml has 63 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
        {
            if ($considerHtml) {
                // if the plain text is shorter than the maximum length, return the whole text
                if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
    Severity: Major
    Found in class/Common/SysUtility.php - About 2 hrs to fix

      Identical blocks of code found in 3 locations. Consider refactoring.
      Open

              removeEventListener: function (el, event, func) {
                  try {
                      el.removeEventListener(event, func, false);
                  } catch (e) {
                      try {
      Severity: Major
      Found in assets/js/highslide-with-gallery.js and 2 other locations - About 2 hrs to fix
      assets/js/highslide-full.js on lines 868..878
      assets/js/highslide.js on lines 529..539

      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 85.

      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

      Further Reading

      Identical blocks of code found in 3 locations. Consider refactoring.
      Open

              removeEventListener: function (el, event, func) {
                  try {
                      el.removeEventListener(event, func, false);
                  } catch (e) {
                      try {
      Severity: Major
      Found in assets/js/highslide.js and 2 other locations - About 2 hrs to fix
      assets/js/highslide-full.js on lines 868..878
      assets/js/highslide-with-gallery.js on lines 693..703

      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 85.

      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

      Further Reading

      Identical blocks of code found in 3 locations. Consider refactoring.
      Open

              removeEventListener: function (el, event, func) {
                  try {
                      el.removeEventListener(event, func, false);
                  } catch (e) {
                      try {
      Severity: Major
      Found in assets/js/highslide-full.js and 2 other locations - About 2 hrs to fix
      assets/js/highslide-with-gallery.js on lines 693..703
      assets/js/highslide.js on lines 529..539

      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 85.

      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

      Further Reading

      Function step has 61 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                      step: function (val, args) {
                          var pos = args.pos,
                              invPos = 1 - pos;
                          var prop,
                              size = {},
      Severity: Major
      Found in assets/js/highslide-full.js - About 2 hrs to fix

        Function step has 61 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                        step: function (val, args) {
                            var pos = args.pos,
                                invPos = 1 - pos;
                            var prop,
                                size = {},
        Severity: Major
        Found in assets/js/highslide-with-gallery.js - About 2 hrs to fix

          Function afterExpand has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

                  afterExpand: function () {
                      this.isExpanded = true;
                      this.focus();
          
                      if (this.isHtml && this.objectLoadTime == 'after') this.writeExtendedContent();
          Severity: Minor
          Found in assets/js/highslide-full.js - About 2 hrs to fix

          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 step has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

                  step: function (gotoEnd) {
                      var t = (new Date()).getTime();
                      if (gotoEnd || t >= this.options.duration + this.startTime) {
                          this.now = this.end;
                          this.pos = this.state = 1;
          Severity: Minor
          Found in assets/js/highslide-full.js - About 2 hrs to fix

          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

          Severity
          Category
          Status
          Source
          Language