mambax7/cardealer

View on GitHub

Showing 664 of 664 total issues

A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 39 and the first side effect is on line 27.
Open

<?php namespace XoopsModules\Cardealer;
Severity: Minor
Found in class/Constants.php by phpcodesniffer

A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 39 and the first side effect is on line 28.
Open

<?php namespace XoopsModules\Cardealer\Form;
Severity: Minor
Found in class/Form/WorkorderForm.php by phpcodesniffer

A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 39 and the first side effect is on line 28.
Open

<?php namespace XoopsModules\Cardealer\Form;
Severity: Minor
Found in class/Form/ServpartForm.php by phpcodesniffer

A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 37 and the first side effect is on line 32.
Open

<?php namespace XoopsModules\Cardealer\Common;
Severity: Minor
Found in class/Common/Breadcrumb.php by phpcodesniffer

Function recurseCopy has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public static function recurseCopy($src, $dst)
    {
        $dir = opendir($src);
        while (false !== ($file = readdir($dir))) {
            if (('.' !== $file) && ('..' !== $file)) {
Severity: Minor
Found in class/Common/FilesManagement.php - About 45 mins 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

Avoid deeply nested control flow statements.
Open

                            if (file_exists($templateFolder . $v)) {
                                unlink($templateFolder . $v);
                            }
Severity: Major
Found in include/onupdate.php - About 45 mins to fix

    Method truncateHtml has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
    Severity: Minor
    Found in class/Utility.php - About 35 mins to fix

      Method cardealer_search has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function cardealer_search($queryarray, $andor, $limit, $offset, $userid)
      Severity: Minor
      Found in include/search.inc.php - About 35 mins to fix

        Expected 1 blank line at end of file; 2 found
        Open

        }
        Severity: Minor
        Found in class/Servpart.php by phpcodesniffer

        Blank line found at start of control structure
        Open

                    foreach (array_keys($serviceTempArray) as $i) {
        Severity: Minor
        Found in admin/service.php by phpcodesniffer

        Blank line found at start of control structure
        Open

                if ($servpartCount > $servpartPaginationLimit) {
        Severity: Minor
        Found in servpart.php by phpcodesniffer

        Expected 1 blank line at end of file; 2 found
        Open

        define('MI_CARDEALER_SHOW_SAMPLE_BUTTON_DESC', 'If yes, the "Add Sample Data" button will be visible to the Admin. It is Yes as a default for first installation.');
        Severity: Minor
        Found in language/english/modinfo.php by phpcodesniffer

        Blank line found at start of control structure
        Open

                if ($serviceCount > $servicePaginationLimit) {
        Severity: Minor
        Found in service.php by phpcodesniffer

        Expected 1 blank line at end of file; 2 found
        Open

        }
        Severity: Minor
        Found in class/Vehicle.php by phpcodesniffer

        Expected 1 blank line at end of file; 2 found
        Open

        }
        Severity: Minor
        Found in class/Workorder.php by phpcodesniffer

        Blank line found at start of control structure
        Open

                if ($workorderCount > $workorderPaginationLimit) {
        Severity: Minor
        Found in workorder.php by phpcodesniffer

        The CASE body must start on the line following the statement
        Open

            case 'clone':
        Severity: Minor
        Found in admin/service.php by phpcodesniffer

        Blank line found at start of control structure
        Open

                    foreach (array_keys($vehicleTempArray) as $i) {
        Severity: Minor
        Found in admin/vehicle.php by phpcodesniffer

        Blank line found at start of control structure
        Open

                    foreach (array_keys($workservTempArray) as $i) {
        Severity: Minor
        Found in admin/workserv.php by phpcodesniffer

        Blank line found at start of control structure
        Open

            if ($previousVersion < 240) {
        Severity: Minor
        Found in include/onupdate.php by phpcodesniffer
        Severity
        Category
        Status
        Source
        Language