YetiForceCompany/YetiForceCRM

View on GitHub
app/CustomView.php

Summary

Maintainability
F
4 days
Test Coverage
D
65%

getCurrentView accesses the super-global variable $_SESSION.
Open

    public static function getCurrentView($moduleName)
    {
        return $_SESSION['lvs'][$moduleName]['viewname'] ?? null;
    }
Severity: Minor
Found in app/CustomView.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

hasViewChanged accesses the super-global variable $_SESSION.
Open

    public static function hasViewChanged(string $moduleName, $viewId = false): bool
    {
        return empty($_SESSION['lvs'][$moduleName]['viewname'])
        || ($viewId && ($viewId !== $_SESSION['lvs'][$moduleName]['viewname']))
        || !isset($_SESSION['lvs'][$moduleName]['sortby']);
Severity: Minor
Found in app/CustomView.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

getCurrentPage accesses the super-global variable $_SESSION.
Open

    public static function getCurrentPage($moduleName, $viewId)
    {
        if (!empty($_SESSION['lvs'][$moduleName][$viewId]['start'])) {
            return $_SESSION['lvs'][$moduleName][$viewId]['start'];
        }
Severity: Minor
Found in app/CustomView.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

setSortBy accesses the super-global variable $_SESSION.
Open

    public static function setSortBy(string $moduleName, $sortBy)
    {
        if (empty($sortBy)) {
            unset($_SESSION['lvs'][$moduleName]['sortby']);
        } else {
Severity: Minor
Found in app/CustomView.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

hasViewChanged accesses the super-global variable $_SESSION.
Open

    public static function hasViewChanged(string $moduleName, $viewId = false): bool
    {
        return empty($_SESSION['lvs'][$moduleName]['viewname'])
        || ($viewId && ($viewId !== $_SESSION['lvs'][$moduleName]['viewname']))
        || !isset($_SESSION['lvs'][$moduleName]['sortby']);
Severity: Minor
Found in app/CustomView.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

setCurrentView accesses the super-global variable $_SESSION.
Open

    public static function setCurrentView($moduleName, $viewId)
    {
        $_SESSION['lvs'][$moduleName]['viewname'] = $viewId;
    }
Severity: Minor
Found in app/CustomView.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

getCurrentPage accesses the super-global variable $_SESSION.
Open

    public static function getCurrentPage($moduleName, $viewId)
    {
        if (!empty($_SESSION['lvs'][$moduleName][$viewId]['start'])) {
            return $_SESSION['lvs'][$moduleName][$viewId]['start'];
        }
Severity: Minor
Found in app/CustomView.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

hasViewChanged accesses the super-global variable $_SESSION.
Open

    public static function hasViewChanged(string $moduleName, $viewId = false): bool
    {
        return empty($_SESSION['lvs'][$moduleName]['viewname'])
        || ($viewId && ($viewId !== $_SESSION['lvs'][$moduleName]['viewname']))
        || !isset($_SESSION['lvs'][$moduleName]['sortby']);
Severity: Minor
Found in app/CustomView.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

setCurrentPage accesses the super-global variable $_SESSION.
Open

    public static function setCurrentPage($moduleName, $viewId, $start)
    {
        if (empty($start)) {
            unset($_SESSION['lvs'][$moduleName][$viewId]['start']);
        } else {
Severity: Minor
Found in app/CustomView.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

setSortBy accesses the super-global variable $_SESSION.
Open

    public static function setSortBy(string $moduleName, $sortBy)
    {
        if (empty($sortBy)) {
            unset($_SESSION['lvs'][$moduleName]['sortby']);
        } else {
Severity: Minor
Found in app/CustomView.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

getSortBy accesses the super-global variable $_SESSION.
Open

    public static function getSortBy($moduleName)
    {
        return empty($_SESSION['lvs'][$moduleName]['sortby']) ? [] : $_SESSION['lvs'][$moduleName]['sortby'];
    }
Severity: Minor
Found in app/CustomView.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

setCurrentPage accesses the super-global variable $_SESSION.
Open

    public static function setCurrentPage($moduleName, $viewId, $start)
    {
        if (empty($start)) {
            unset($_SESSION['lvs'][$moduleName][$viewId]['start']);
        } else {
Severity: Minor
Found in app/CustomView.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

getSortBy accesses the super-global variable $_SESSION.
Open

    public static function getSortBy($moduleName)
    {
        return empty($_SESSION['lvs'][$moduleName]['sortby']) ? [] : $_SESSION['lvs'][$moduleName]['sortby'];
    }
Severity: Minor
Found in app/CustomView.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

File CustomView.php has 492 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Custom view file.
 *
 * @package App
Severity: Minor
Found in app/CustomView.php - About 7 hrs to fix

    Function getViewId has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getViewId($noCache = false)
        {
            \App\Log::trace(__METHOD__);
            if (isset($this->defaultViewId)) {
                return $this->defaultViewId;
    Severity: Minor
    Found in app/CustomView.php - About 4 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

    CustomView has 32 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class CustomView
    {
        const CV_STATUS_DEFAULT = 0;
        const CV_STATUS_PRIVATE = 1;
        const CV_STATUS_PENDING = 2;
    Severity: Minor
    Found in app/CustomView.php - About 4 hrs to fix

      The class CustomView has an overall complexity of 125 which is very high. The configured complexity threshold is 50.
      Open

      class CustomView
      {
          const CV_STATUS_DEFAULT = 0;
          const CV_STATUS_PRIVATE = 1;
          const CV_STATUS_PENDING = 2;
      Severity: Minor
      Found in app/CustomView.php by phpmd

      Method getConditions has 81 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function getConditions($id): array
          {
              if (Cache::has('CustomView_GetConditions', $id)) {
                  return Cache::get('CustomView_GetConditions', $id);
              }
      Severity: Major
      Found in app/CustomView.php - About 3 hrs to fix

        Function getConditions has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function getConditions($id): array
            {
                if (Cache::has('CustomView_GetConditions', $id)) {
                    return Cache::get('CustomView_GetConditions', $id);
                }
        Severity: Minor
        Found in app/CustomView.php - 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 getDefaultCvId has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getDefaultCvId()
            {
                $cacheName = $this->moduleName . $this->user->getId();
                if (Cache::has('GetDefaultCvId', $cacheName)) {
                    return Cache::get('GetDefaultCvId', $cacheName);
        Severity: Minor
        Found in app/CustomView.php - About 1 hr 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

        Method getViewId has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getViewId($noCache = false)
            {
                \App\Log::trace(__METHOD__);
                if (isset($this->defaultViewId)) {
                    return $this->defaultViewId;
        Severity: Minor
        Found in app/CustomView.php - About 1 hr to fix

          Function getColumnsByCvidFromDb has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              private function getColumnsByCvidFromDb($cvId)
              {
                  \App\Log::trace(__METHOD__ . ' - ' . $cvId);
                  $columnList = [];
                  if (is_numeric($cvId)) {
          Severity: Minor
          Found in app/CustomView.php - About 1 hr 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

          Method getDefaultCvId has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getDefaultCvId()
              {
                  $cacheName = $this->moduleName . $this->user->getId();
                  if (Cache::has('GetDefaultCvId', $cacheName)) {
                      return Cache::get('GetDefaultCvId', $cacheName);
          Severity: Minor
          Found in app/CustomView.php - About 1 hr to fix

            Function resetCurrentView has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function resetCurrentView($moduleName = false)
                {
                    if (\App\Session::has('lvs')) {
                        if ($moduleName) {
                            $lvs = \App\Session::get('lvs');
            Severity: Minor
            Found in app/CustomView.php - About 35 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

            Function sortConditions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                private static function sortConditions(?array $arrayToSort): ?array
                {
                    if (isset($arrayToSort['rules'])) {
                        ksort($arrayToSort['rules']);
                        foreach ($arrayToSort['rules'] as $rule) {
            Severity: Minor
            Found in app/CustomView.php - About 25 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

            Function getMandatoryFilter has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getMandatoryFilter($returnData = false)
                {
                    Log::trace(__METHOD__);
                    $info = $this->getFilters();
                    $returnValue = '';
            Severity: Minor
            Found in app/CustomView.php - About 25 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

            The method getViewId() has a Cyclomatic Complexity of 16. The configured cyclomatic complexity threshold is 10.
            Open

                public function getViewId($noCache = false)
                {
                    \App\Log::trace(__METHOD__);
                    if (isset($this->defaultViewId)) {
                        return $this->defaultViewId;
            Severity: Minor
            Found in app/CustomView.php by phpmd

            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

            The method getDefaultCvId() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
            Open

                public function getDefaultCvId()
                {
                    $cacheName = $this->moduleName . $this->user->getId();
                    if (Cache::has('GetDefaultCvId', $cacheName)) {
                        return Cache::get('GetDefaultCvId', $cacheName);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            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

            Class "CustomView" has 32 methods, which is greater than 20 authorized. Split it into smaller classes.
            Open

            class CustomView
            Severity: Major
            Found in app/CustomView.php by sonar-php

            A class that grows too much tends to aggregate too many responsibilities and inevitably becomes harder to understand and therefore to maintain. Above a specific threshold, it is strongly advised to refactor the class into smaller ones which focus on well defined topics.

            Refactor this function to reduce its Cognitive Complexity from 19 to the 15 allowed.
            Open

                public static function getConditions($id): array
            Severity: Critical
            Found in app/CustomView.php by sonar-php

            Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

            See

            Refactor this function to reduce its Cognitive Complexity from 30 to the 15 allowed.
            Open

                public function getViewId($noCache = false)
            Severity: Critical
            Found in app/CustomView.php by sonar-php

            Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

            See

            Avoid using undefined variables such as '$filterList' which will lead to PHP notices.
            Open

                    if (isset($filterList[$menuId])) {
            Severity: Minor
            Found in app/CustomView.php by phpmd

            UndefinedVariable

            Since: 2.8.0

            Detects when a variable is used that has not been defined before.

            Example

            class Foo
            {
                private function bar()
                {
                    // $message is undefined
                    echo $message;
                }
            }

            Source https://phpmd.org/rules/cleancode.html#undefinedvariable

            Avoid using undefined variables such as '$menus' which will lead to PHP notices.
            Open

                    if (0 === \count($menus) && file_exists($roleMenu)) {
            Severity: Minor
            Found in app/CustomView.php by phpmd

            UndefinedVariable

            Since: 2.8.0

            Detects when a variable is used that has not been defined before.

            Example

            class Foo
            {
                private function bar()
                {
                    // $message is undefined
                    echo $message;
                }
            }

            Source https://phpmd.org/rules/cleancode.html#undefinedvariable

            Avoid using undefined variables such as '$filterList' which will lead to PHP notices.
            Open

                        $filtersMenu = explode(',', $filterList[$menuId]['filters']);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            UndefinedVariable

            Since: 2.8.0

            Detects when a variable is used that has not been defined before.

            Example

            class Foo
            {
                private function bar()
                {
                    // $message is undefined
                    echo $message;
                }
            }

            Source https://phpmd.org/rules/cleancode.html#undefinedvariable

            The class CustomView has a coupling between objects value of 16. Consider to reduce the number of dependencies under 13.
            Open

            class CustomView
            {
                const CV_STATUS_DEFAULT = 0;
                const CV_STATUS_PRIVATE = 1;
                const CV_STATUS_PENDING = 2;
            Severity: Minor
            Found in app/CustomView.php by phpmd

            CouplingBetweenObjects

            Since: 1.1.0

            A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

            Example

            class Foo {
                /**
                 * @var \foo\bar\X
                 */
                private $x = null;
            
                /**
                 * @var \foo\bar\Y
                 */
                private $y = null;
            
                /**
                 * @var \foo\bar\Z
                 */
                private $z = null;
            
                public function setFoo(\Foo $foo) {}
                public function setBar(\Bar $bar) {}
                public function setBaz(\Baz $baz) {}
            
                /**
                 * @return \SplObjectStorage
                 * @throws \OutOfRangeException
                 * @throws \InvalidArgumentException
                 * @throws \ErrorException
                 */
                public function process(\Iterator $it) {}
            
                // ...
            }

            Source https://phpmd.org/rules/design.html#couplingbetweenobjects

            The method hasViewChanged has a boolean flag argument $viewId, which is a certain sign of a Single Responsibility Principle violation.
            Open

                public static function hasViewChanged(string $moduleName, $viewId = false): bool
            Severity: Minor
            Found in app/CustomView.php by phpmd

            BooleanArgumentFlag

            Since: 1.4.0

            A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

            Example

            class Foo {
                public function bar($flag = true) {
                }
            }

            Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

            The method getInstance has a boolean flag argument $userModelOrId, which is a certain sign of a Single Responsibility Principle violation.
            Open

                public static function getInstance($moduleName, $userModelOrId = false)
            Severity: Minor
            Found in app/CustomView.php by phpmd

            BooleanArgumentFlag

            Since: 1.4.0

            A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

            Example

            class Foo {
                public function bar($flag = true) {
                }
            }

            Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

            Missing class import via use statement (line '323', column '22').
            Open

                    $dataReader = (new \App\Db\Query())->select([
            Severity: Minor
            Found in app/CustomView.php by phpmd

            MissingImport

            Since: 2.7.0

            Importing all external classes in a file through use statements makes them clearly visible.

            Example

            function make() {
                return new \stdClass();
            }

            Source http://phpmd.org/rules/cleancode.html#MissingImport

            The method getViewId has a boolean flag argument $noCache, which is a certain sign of a Single Responsibility Principle violation.
            Open

                public function getViewId($noCache = false)
            Severity: Minor
            Found in app/CustomView.php by phpmd

            BooleanArgumentFlag

            Since: 1.4.0

            A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

            Example

            class Foo {
                public function bar($flag = true) {
                }
            }

            Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

            The method getMandatoryFilter has a boolean flag argument $returnData, which is a certain sign of a Single Responsibility Principle violation.
            Open

                public function getMandatoryFilter($returnData = false)
            Severity: Minor
            Found in app/CustomView.php by phpmd

            BooleanArgumentFlag

            Since: 1.4.0

            A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

            Example

            class Foo {
                public function bar($flag = true) {
                }
            }

            Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

            The method resetCurrentView has a boolean flag argument $moduleName, which is a certain sign of a Single Responsibility Principle violation.
            Open

                public static function resetCurrentView($moduleName = false)
            Severity: Minor
            Found in app/CustomView.php by phpmd

            BooleanArgumentFlag

            Since: 1.4.0

            A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

            Example

            class Foo {
                public function bar($flag = true) {
                }
            }

            Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

            Missing class import via use statement (line '439', column '16').
            Open

                    $data = (new \App\Db\Query())->select(['vtiger_field.fieldname', 'u_#__cv_duplicates.ignore'])
            Severity: Minor
            Found in app/CustomView.php by phpmd

            MissingImport

            Since: 2.7.0

            Importing all external classes in a file through use statements makes them clearly visible.

            Example

            function make() {
                return new \stdClass();
            }

            Source http://phpmd.org/rules/cleancode.html#MissingImport

            Avoid using static access to class 'App\Log' in method 'getMandatoryFilter'.
            Open

                    Log::trace(__METHOD__);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class '\App\User' in method 'isPermitted'.
            Open

                    $userModel = $userId ? \App\User::getUserModel($userId) : \App\User::getCurrentUserModel();
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class 'App\Cache' in method 'getFiltersByModule'.
            Open

                        Cache::save('CustomViewInfo', $item['cvid'], $item);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class '\App\Session' in method 'resetCurrentView'.
            Open

                                \App\Session::set('lvs', $lvs);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class 'App\Cache' in method 'getCustomViewById'.
            Open

                    Cache::save('CustomViewById', $cvId, $data);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class 'App\Cache' in method 'getCustomView'.
            Open

                    Cache::staticSave('getCustomView', $cvIds, $filters);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            The method getConditions uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
            Open

                        } else {
                            if ($isEmptyCondition) {
                                $conditions = [
                                    'condition' => $condition['condition'],
                                    'rules' => [],
            Severity: Minor
            Found in app/CustomView.php by phpmd

            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 using static access to class 'App\User' in method 'getModuleFiltersByMenuId'.
            Open

                    $userModel = User::getCurrentUserModel();
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class 'App\Cache' in method 'getCustomViewById'.
            Open

                    if (Cache::has('CustomViewById', $cvId)) {
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class 'App\Cache' in method 'getColumnsListByCvid'.
            Open

                    Cache::save('getColumnsListByCvid', $cvIds, $columnLists);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class 'App\Cache' in method 'getConditions'.
            Open

                        return Cache::get('CustomView_GetConditions', $id);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            The method getConditions uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
            Open

                            } else {
                                $conditions = [
                                    'condition' => $condition['condition'],
                                    'rules' => [
                                        $condition['condition_index'] => [
            Severity: Minor
            Found in app/CustomView.php by phpmd

            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 using static access to class '\App\User' in method 'isPermitted'.
            Open

                    $userModel = $userId ? \App\User::getUserModel($userId) : \App\User::getCurrentUserModel();
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class '\App\Session' in method 'resetCurrentView'.
            Open

                            $lvs = \App\Session::get('lvs');
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class 'App\Cache' in method 'getColumnsListByCvid'.
            Open

                        return Cache::get('getColumnsListByCvid', $cvIds);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class 'App\Cache' in method 'getConditions'.
            Open

                    if (Cache::has('CustomView_GetConditions', $id)) {
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class 'App\Cache' in method 'getDuplicateFields'.
            Open

                    if (Cache::has('CustomView_GetDuplicateFields', $viewId)) {
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            The method getViewId uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
            Open

                    } else {
                        $viewId = Request::_get('viewname');
                        if (!is_numeric($viewId)) {
                            if ('All' === $viewId) {
                                $viewId = $this->getMandatoryFilter();
            Severity: Minor
            Found in app/CustomView.php by phpmd

            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 using static access to class '\App\Cache' in method 'getInstance'.
            Open

                        return \App\Cache::staticGet('AppCustomView', $cacheName);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class '\App\Cache' in method 'getInstance'.
            Open

                    \App\Cache::staticSave('AppCustomView', $cacheName, $instance);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            The method getColumnsByCvidFromDb uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
            Open

                    } else {
                        $view = $this->getCustomViewFromFile($cvId);
                        $columnList = $view->getColumnList();
                        Cache::save('getColumnsListByCvid', $cvId, $columnList);
                    }
            Severity: Minor
            Found in app/CustomView.php by phpmd

            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 using static access to class 'App\Cache' in method 'getConditions'.
            Open

                    Cache::save('CustomView_GetConditions', $id, $conditions, Cache::LONG);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class 'App\Cache' in method 'getCVDetails'.
            Open

                    if (Cache::has('CustomViewInfo', $cvId)) {
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class 'App\Cache' in method 'clearCacheById'.
            Open

                    Cache::delete('CustomViewById', $cvId);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class '\App\Log' in method 'getCustomViewFromFile'.
            Open

                    \App\Log::trace(__METHOD__ . ' - ' . $cvId);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class '\App\Log' in method 'getColumnsByCvidFromDb'.
            Open

                    \App\Log::trace(__METHOD__ . ' - ' . $cvId);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class 'App\Cache' in method 'getCustomViewById'.
            Open

                        return Cache::get('CustomViewById', $cvId);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            The method setCurrentPage uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
            Open

                    } else {
                        $_SESSION['lvs'][$moduleName][$viewId]['start'] = $start;
                    }
            Severity: Minor
            Found in app/CustomView.php by phpmd

            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 using static access to class 'App\Cache' in method 'clearCacheById'.
            Open

                        Cache::delete('CustomViewInfo', $moduleName);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class 'App\User' in method 'getInstance'.
            Open

                        $userModelOrId = User::getCurrentUserId();
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class 'App\Cache' in method 'getColumnsByCvidFromDb'.
            Open

                        Cache::save('getColumnsListByCvid', $cvId, $columnList);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class 'App\Cache' in method 'getColumnsListByCvid'.
            Open

                    if (Cache::has('getColumnsListByCvid', $cvIds)) {
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class 'App\Cache' in method 'getFiltersByModule'.
            Open

                    if (Cache::has('CustomViewInfo', $moduleName)) {
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class 'App\Cache' in method 'getFiltersByModule'.
            Open

                    Cache::save('CustomViewInfo', $moduleName, $info);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class '\App\Session' in method 'resetCurrentView'.
            Open

                    if (\App\Session::has('lvs')) {
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            The method resetCurrentView uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
            Open

                        } else {
                            \App\Session::set('lvs', []);
                        }
            Severity: Minor
            Found in app/CustomView.php by phpmd

            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 using static access to class 'App\Cache' in method 'clearCacheById'.
            Open

                    Cache::delete('getAllFilterColors', false);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class '\App\Module' in method 'clearCacheById'.
            Open

                        foreach (\App\Module::getAllModuleNames() as $moduleName) {
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class 'App\User' in method 'getInstance'.
            Open

                        $userModel = User::getUserModel($userModelOrId);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class 'App\Cache' in method 'getCustomView'.
            Open

                    if (Cache::staticHas('getCustomView', $cvIds)) {
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class 'App\Module' in method 'getDefaultCvId'.
            Open

                    $query = (new Db\Query())->select(['userid', 'default_cvid'])->from('vtiger_user_module_preferences')->where(['tabid' => Module::getModuleId($this->moduleName)]);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class '\App\Cache' in method 'getModuleFiltersByMenuId'.
            Open

                    \App\Cache::staticSave($cacheKey, $menuId, $filters);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class 'App\Cache' in method 'clearCacheById'.
            Open

                            Cache::delete('CustomViewInfo', $moduleName);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class '\App\Cache' in method 'getInstance'.
            Open

                    if (\App\Cache::staticHas('AppCustomView', $cacheName)) {
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class 'App\Cache' in method 'getDefaultCvId'.
            Open

                    if (Cache::has('GetDefaultCvId', $cacheName)) {
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class '\App\Session' in method 'resetCurrentView'.
            Open

                            \App\Session::set('lvs', []);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class '\App\Cache' in method 'getModuleFiltersByMenuId'.
            Open

                        return \App\Cache::staticGet($cacheKey, $menuId);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class '\DateTimeRange' in method 'getDateFilterTypes'.
            Open

                        $dateValues = \DateTimeRange::getDateRangeByType($filterType);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class 'App\Cache' in method 'getCustomView'.
            Open

                        return Cache::staticGet('getCustomView', $cvIds);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class 'App\Cache' in method 'getColumnsByCvidFromDb'.
            Open

                            Cache::save('getColumnsListByCvid', $cvId, $columnList);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            The method getConditions uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
            Open

                        } else {
                            $condition['group_id'] = $condition['id'];
                            $isEmptyCondition = true;
                        }
            Severity: Minor
            Found in app/CustomView.php by phpmd

            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 using static access to class 'App\Request' in method 'getViewId'.
            Open

                        if (Request::_has('mid')) {
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            The method getInstance uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
            Open

                    } else {
                        $userModel = $userModelOrId;
                    }
            Severity: Minor
            Found in app/CustomView.php by phpmd

            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 using static access to class '\Vtiger_Loader' in method 'getCustomViewFromFile'.
            Open

                    $handlerClass = \Vtiger_Loader::getComponentClassName('Filter', $cvId, $this->moduleName);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class '\App\Log' in method 'getCustomView'.
            Open

                    \App\Log::trace(__METHOD__ . ' - ' . $cvIds);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class '\App\Log' in method 'getColumnsListByCvid'.
            Open

                    \App\Log::trace(__METHOD__ . ' - ' . $cvIds);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            The method getConditions uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
            Open

                            } else {
                                $referenceGroup[$condition['parent_id']][$condition['group_index']] = [
                                    'condition' => $condition['condition'],
                                    'rules' => [
                                        $condition['condition_index'] => [
            Severity: Minor
            Found in app/CustomView.php by phpmd

            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 using static access to class 'App\Cache' in method 'getDuplicateFields'.
            Open

                        return Cache::get('CustomView_GetDuplicateFields', $viewId);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            The method getViewId uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
            Open

                            } else {
                                $viewId = $this->getViewIdByName($viewId);
                            }
            Severity: Minor
            Found in app/CustomView.php by phpmd

            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 using static access to class 'App\Cache' in method 'getDefaultCvId'.
            Open

                        return Cache::get('GetDefaultCvId', $cacheName);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class 'App\Cache' in method 'getFiltersByModule'.
            Open

                        return Cache::get('CustomViewInfo', $moduleName);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class '\App\Json' in method 'getCustomViewById'.
            Open

                        $data['advanced_conditions'] = \App\Json::decode($data['advanced_conditions']);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class 'App\Cache' in method 'getCVDetails'.
            Open

                        return Cache::get('CustomViewInfo', $cvId);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class 'App\Cache' in method 'clearCacheById'.
            Open

                    Cache::delete('CustomViewInfo', $cvId);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class '\Vtiger_Module_Model' in method 'getModule'.
            Open

                        $this->module = \Vtiger_Module_Model::getInstance($this->moduleName);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            The method getViewId uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
            Open

                        } else {
                            $viewId = (int) $viewId;
                            if (!$this->isPermittedCustomView($viewId)) {
                                throw new Exceptions\NoPermitted('ERR_NO_PERMITTED_TO_VIEW');
                            }
            Severity: Minor
            Found in app/CustomView.php by phpmd

            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 using static access to class 'App\Cache' in method 'clearCacheById'.
            Open

                    Cache::delete('getAllFilterColors', true);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class 'App\Cache' in method 'getDuplicateFields'.
            Open

                    Cache::save('CustomView_GetDuplicateFields', $viewId, $data);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class 'App\Request' in method 'getViewId'.
            Open

                    if ($noCache || Request::_isEmpty('viewname')) {
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class '\CustomView_Record_Model' in method 'getModuleFiltersByMenuId'.
            Open

                        $filtersCustomView = array_keys(\CustomView_Record_Model::getAll($moduleName));
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            The method clearCacheById uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
            Open

                    } else {
                        Cache::delete('CustomViewInfo', $moduleName);
                    }
            Severity: Minor
            Found in app/CustomView.php by phpmd

            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 using static access to class 'App\Cache' in method 'getCustomViewFromFile'.
            Open

                    Cache::staticSave('getCustomView', $cvId, $filter);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class '\App\Log' in method 'getViewId'.
            Open

                    \App\Log::trace(__METHOD__);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            The method setSortBy uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
            Open

                    } else {
                        $_SESSION['lvs'][$moduleName]['sortby'] = $sortBy;
                    }
            Severity: Minor
            Found in app/CustomView.php by phpmd

            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 using static access to class 'App\Request' in method 'getViewId'.
            Open

                            $viewId = current(self::getModuleFiltersByMenuId(Request::_getInteger('mid'), $this->moduleName));
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class 'App\Request' in method 'getViewId'.
            Open

                        $viewId = Request::_get('viewname');
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class 'App\Cache' in method 'getDefaultCvId'.
            Open

                    Cache::save('GetDefaultCvId', $cacheName, $defaultCvId);
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Avoid using static access to class '\App\Cache' in method 'getModuleFiltersByMenuId'.
            Open

                    if (\App\Cache::staticHas($cacheKey, $menuId)) {
            Severity: Minor
            Found in app/CustomView.php by phpmd

            StaticAccess

            Since: 1.4.0

            Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

            Example

            class Foo
            {
                public function bar()
                {
                    Bar::baz();
                }
            }

            Source https://phpmd.org/rules/cleancode.html#staticaccess

            Define a constant instead of duplicating this literal "condition" 9 times.
            Open

                                    'condition' => $condition['condition'],
            Severity: Critical
            Found in app/CustomView.php by sonar-php

            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

            Noncompliant Code Example

            With the default threshold of 3:

            function run() {
              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
              execute('action1');
              release('action1');
            }
            

            Compliant Solution

            ACTION_1 = 'action1';
            
            function run() {
              prepare(ACTION_1);
              execute(ACTION_1);
              release(ACTION_1);
            }
            

            Exceptions

            To prevent generating some false-positives, literals having less than 5 characters are excluded.

            Define a constant instead of duplicating this literal "userid" 4 times.
            Open

                    $query = (new Db\Query())->select(['userid', 'default_cvid'])->from('vtiger_user_module_preferences')->where(['tabid' => Module::getModuleId($this->moduleName)]);
            Severity: Critical
            Found in app/CustomView.php by sonar-php

            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

            Noncompliant Code Example

            With the default threshold of 3:

            function run() {
              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
              execute('action1');
              release('action1');
            }
            

            Compliant Solution

            ACTION_1 = 'action1';
            
            function run() {
              prepare(ACTION_1);
              execute(ACTION_1);
              release(ACTION_1);
            }
            

            Exceptions

            To prevent generating some false-positives, literals having less than 5 characters are excluded.

            Define a constant instead of duplicating this literal "operator" 6 times.
            Open

                                'operator' => $condition['operator'],
            Severity: Critical
            Found in app/CustomView.php by sonar-php

            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

            Noncompliant Code Example

            With the default threshold of 3:

            function run() {
              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
              execute('action1');
              release('action1');
            }
            

            Compliant Solution

            ACTION_1 = 'action1';
            
            function run() {
              prepare(ACTION_1);
              execute(ACTION_1);
              release(ACTION_1);
            }
            

            Exceptions

            To prevent generating some false-positives, literals having less than 5 characters are excluded.

            Define a constant instead of duplicating this literal "setdefault" 3 times.
            Open

                            if (1 === $values['setdefault'] && $this->isPermittedCustomView($cvId)) {
            Severity: Critical
            Found in app/CustomView.php by sonar-php

            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

            Noncompliant Code Example

            With the default threshold of 3:

            function run() {
              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
              execute('action1');
              release('action1');
            }
            

            Compliant Solution

            ACTION_1 = 'action1';
            
            function run() {
              prepare(ACTION_1);
              execute(ACTION_1);
              release(ACTION_1);
            }
            

            Exceptions

            To prevent generating some false-positives, literals having less than 5 characters are excluded.

            Define a constant instead of duplicating this literal "sequence" 3 times.
            Open

                    $info = (new Db\Query())->from('vtiger_customview')->where(['entitytype' => $moduleName])->indexBy('cvid')->orderBy(['sequence' => SORT_ASC])->all();
            Severity: Critical
            Found in app/CustomView.php by sonar-php

            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

            Noncompliant Code Example

            With the default threshold of 3:

            function run() {
              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
              execute('action1');
              release('action1');
            }
            

            Compliant Solution

            ACTION_1 = 'action1';
            
            function run() {
              prepare(ACTION_1);
              execute(ACTION_1);
              release(ACTION_1);
            }
            

            Exceptions

            To prevent generating some false-positives, literals having less than 5 characters are excluded.

            Define a constant instead of duplicating this literal "source_field_name" 5 times.
            Open

                        $dataReader = (new Db\Query())->select(['field_name', 'module_name', 'source_field_name', 'label'])
            Severity: Critical
            Found in app/CustomView.php by sonar-php

            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

            Noncompliant Code Example

            With the default threshold of 3:

            function run() {
              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
              execute('action1');
              release('action1');
            }
            

            Compliant Solution

            ACTION_1 = 'action1';
            
            function run() {
              prepare(ACTION_1);
              execute(ACTION_1);
              release(ACTION_1);
            }
            

            Exceptions

            To prevent generating some false-positives, literals having less than 5 characters are excluded.

            Define a constant instead of duplicating this literal "status" 4 times.
            Open

                    || \in_array($data['status'], [self::CV_STATUS_DEFAULT, self::CV_STATUS_PUBLIC])
            Severity: Critical
            Found in app/CustomView.php by sonar-php

            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

            Noncompliant Code Example

            With the default threshold of 3:

            function run() {
              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
              execute('action1');
              release('action1');
            }
            

            Compliant Solution

            ACTION_1 = 'action1';
            
            function run() {
              prepare(ACTION_1);
              execute(ACTION_1);
              release(ACTION_1);
            }
            

            Exceptions

            To prevent generating some false-positives, literals having less than 5 characters are excluded.

            Define a constant instead of duplicating this literal "fieldname" 3 times.
            Open

                                'fieldname' => $fieldName,
            Severity: Critical
            Found in app/CustomView.php by sonar-php

            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

            Noncompliant Code Example

            With the default threshold of 3:

            function run() {
              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
              execute('action1');
              release('action1');
            }
            

            Compliant Solution

            ACTION_1 = 'action1';
            
            function run() {
              prepare(ACTION_1);
              execute(ACTION_1);
              release(ACTION_1);
            }
            

            Exceptions

            To prevent generating some false-positives, literals having less than 5 characters are excluded.

            Define a constant instead of duplicating this literal "vtiger_customview" 3 times.
            Open

                        ->innerJoin('vtiger_customview', 'u_#__cv_privileges.cvid=vtiger_customview.cvid')
            Severity: Critical
            Found in app/CustomView.php by sonar-php

            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

            Noncompliant Code Example

            With the default threshold of 3:

            function run() {
              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
              execute('action1');
              release('action1');
            }
            

            Compliant Solution

            ACTION_1 = 'action1';
            
            function run() {
              prepare(ACTION_1);
              execute(ACTION_1);
              release(ACTION_1);
            }
            

            Exceptions

            To prevent generating some false-positives, literals having less than 5 characters are excluded.

            Define a constant instead of duplicating this literal "AppCustomView" 3 times.
            Open

                    if (\App\Cache::staticHas('AppCustomView', $cacheName)) {
            Severity: Critical
            Found in app/CustomView.php by sonar-php

            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

            Noncompliant Code Example

            With the default threshold of 3:

            function run() {
              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
              execute('action1');
              release('action1');
            }
            

            Compliant Solution

            ACTION_1 = 'action1';
            
            function run() {
              prepare(ACTION_1);
              execute(ACTION_1);
              release(ACTION_1);
            }
            

            Exceptions

            To prevent generating some false-positives, literals having less than 5 characters are excluded.

            Define a constant instead of duplicating this literal "parent_id" 9 times.
            Open

                        if (isset($referenceParent[$condition['parent_id']], $referenceGroup[$condition['group_id']])) {
            Severity: Critical
            Found in app/CustomView.php by sonar-php

            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

            Noncompliant Code Example

            With the default threshold of 3:

            function run() {
              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
              execute('action1');
              release('action1');
            }
            

            Compliant Solution

            ACTION_1 = 'action1';
            
            function run() {
              prepare(ACTION_1);
              execute(ACTION_1);
              release(ACTION_1);
            }
            

            Exceptions

            To prevent generating some false-positives, literals having less than 5 characters are excluded.

            Define a constant instead of duplicating this literal "CustomViewInfo" 9 times.
            Open

                    if (Cache::has('CustomViewInfo', $moduleName)) {
            Severity: Critical
            Found in app/CustomView.php by sonar-php

            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

            Noncompliant Code Example

            With the default threshold of 3:

            function run() {
              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
              execute('action1');
              release('action1');
            }
            

            Compliant Solution

            ACTION_1 = 'action1';
            
            function run() {
              prepare(ACTION_1);
              execute(ACTION_1);
              release(ACTION_1);
            }
            

            Exceptions

            To prevent generating some false-positives, literals having less than 5 characters are excluded.

            Define a constant instead of duplicating this literal "value" 4 times.
            Open

                        $value = $condition['value'];
            Severity: Critical
            Found in app/CustomView.php by sonar-php

            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

            Noncompliant Code Example

            With the default threshold of 3:

            function run() {
              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
              execute('action1');
              release('action1');
            }
            

            Compliant Solution

            ACTION_1 = 'action1';
            
            function run() {
              prepare(ACTION_1);
              execute(ACTION_1);
              release(ACTION_1);
            }
            

            Exceptions

            To prevent generating some false-positives, literals having less than 5 characters are excluded.

            Define a constant instead of duplicating this literal "sortby" 5 times.
            Open

                    return empty($_SESSION['lvs'][$moduleName]['sortby']) ? [] : $_SESSION['lvs'][$moduleName]['sortby'];
            Severity: Critical
            Found in app/CustomView.php by sonar-php

            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

            Noncompliant Code Example

            With the default threshold of 3:

            function run() {
              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
              execute('action1');
              release('action1');
            }
            

            Compliant Solution

            ACTION_1 = 'action1';
            
            function run() {
              prepare(ACTION_1);
              execute(ACTION_1);
              release(ACTION_1);
            }
            

            Exceptions

            To prevent generating some false-positives, literals having less than 5 characters are excluded.

            Define a constant instead of duplicating this literal "presence" 5 times.
            Open

                        if (0 === $values['presence']) {
            Severity: Critical
            Found in app/CustomView.php by sonar-php

            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

            Noncompliant Code Example

            With the default threshold of 3:

            function run() {
              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
              execute('action1');
              release('action1');
            }
            

            Compliant Solution

            ACTION_1 = 'action1';
            
            function run() {
              prepare(ACTION_1);
              execute(ACTION_1);
              release(ACTION_1);
            }
            

            Exceptions

            To prevent generating some false-positives, literals having less than 5 characters are excluded.

            Define a constant instead of duplicating this literal "condition_index" 4 times.
            Open

                        'condition_index' => 'u_#__cv_condition.index',
            Severity: Critical
            Found in app/CustomView.php by sonar-php

            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

            Noncompliant Code Example

            With the default threshold of 3:

            function run() {
              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
              execute('action1');
              release('action1');
            }
            

            Compliant Solution

            ACTION_1 = 'action1';
            
            function run() {
              prepare(ACTION_1);
              execute(ACTION_1);
              release(ACTION_1);
            }
            

            Exceptions

            To prevent generating some false-positives, literals having less than 5 characters are excluded.

            Define a constant instead of duplicating this literal "CustomViewById" 4 times.
            Open

                    if (Cache::has('CustomViewById', $cvId)) {
            Severity: Critical
            Found in app/CustomView.php by sonar-php

            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

            Noncompliant Code Example

            With the default threshold of 3:

            function run() {
              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
              execute('action1');
              release('action1');
            }
            

            Compliant Solution

            ACTION_1 = 'action1';
            
            function run() {
              prepare(ACTION_1);
              execute(ACTION_1);
              release(ACTION_1);
            }
            

            Exceptions

            To prevent generating some false-positives, literals having less than 5 characters are excluded.

            Define a constant instead of duplicating this literal "group_id" 5 times.
            Open

                        if ($condition['group_id']) {
            Severity: Critical
            Found in app/CustomView.php by sonar-php

            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

            Noncompliant Code Example

            With the default threshold of 3:

            function run() {
              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
              execute('action1');
              release('action1');
            }
            

            Compliant Solution

            ACTION_1 = 'action1';
            
            function run() {
              prepare(ACTION_1);
              execute(ACTION_1);
              release(ACTION_1);
            }
            

            Exceptions

            To prevent generating some false-positives, literals having less than 5 characters are excluded.

            Define a constant instead of duplicating this literal "rules" 11 times.
            Open

                                    'rules' => [],
            Severity: Critical
            Found in app/CustomView.php by sonar-php

            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

            Noncompliant Code Example

            With the default threshold of 3:

            function run() {
              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
              execute('action1');
              release('action1');
            }
            

            Compliant Solution

            ACTION_1 = 'action1';
            
            function run() {
              prepare(ACTION_1);
              execute(ACTION_1);
              release(ACTION_1);
            }
            

            Exceptions

            To prevent generating some false-positives, literals having less than 5 characters are excluded.

            Define a constant instead of duplicating this literal "viewname" 7 times.
            Open

                    $_SESSION['lvs'][$moduleName]['viewname'] = $viewId;
            Severity: Critical
            Found in app/CustomView.php by sonar-php

            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

            Noncompliant Code Example

            With the default threshold of 3:

            function run() {
              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
              execute('action1');
              release('action1');
            }
            

            Compliant Solution

            ACTION_1 = 'action1';
            
            function run() {
              prepare(ACTION_1);
              execute(ACTION_1);
              release(ACTION_1);
            }
            

            Exceptions

            To prevent generating some false-positives, literals having less than 5 characters are excluded.

            Define a constant instead of duplicating this literal "advanced_conditions" 3 times.
            Open

                    if (!empty($data['advanced_conditions'])) {
            Severity: Critical
            Found in app/CustomView.php by sonar-php

            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

            Noncompliant Code Example

            With the default threshold of 3:

            function run() {
              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
              execute('action1');
              release('action1');
            }
            

            Compliant Solution

            ACTION_1 = 'action1';
            
            function run() {
              prepare(ACTION_1);
              execute(ACTION_1);
              release(ACTION_1);
            }
            

            Exceptions

            To prevent generating some false-positives, literals having less than 5 characters are excluded.

            Define a constant instead of duplicating this literal "CustomView_GetConditions" 3 times.
            Open

                    if (Cache::has('CustomView_GetConditions', $id)) {
            Severity: Critical
            Found in app/CustomView.php by sonar-php

            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

            Noncompliant Code Example

            With the default threshold of 3:

            function run() {
              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
              execute('action1');
              release('action1');
            }
            

            Compliant Solution

            ACTION_1 = 'action1';
            
            function run() {
              prepare(ACTION_1);
              execute(ACTION_1);
              release(ACTION_1);
            }
            

            Exceptions

            To prevent generating some false-positives, literals having less than 5 characters are excluded.

            Define a constant instead of duplicating this literal "getCustomView" 4 times.
            Open

                    Cache::staticSave('getCustomView', $cvId, $filter);
            Severity: Critical
            Found in app/CustomView.php by sonar-php

            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

            Noncompliant Code Example

            With the default threshold of 3:

            function run() {
              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
              execute('action1');
              release('action1');
            }
            

            Compliant Solution

            ACTION_1 = 'action1';
            
            function run() {
              prepare(ACTION_1);
              execute(ACTION_1);
              release(ACTION_1);
            }
            

            Exceptions

            To prevent generating some false-positives, literals having less than 5 characters are excluded.

            Define a constant instead of duplicating this literal "group_index" 5 times.
            Open

                        'group_index' => 'u_#__cv_condition_group.index',
            Severity: Critical
            Found in app/CustomView.php by sonar-php

            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

            Noncompliant Code Example

            With the default threshold of 3:

            function run() {
              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
              execute('action1');
              release('action1');
            }
            

            Compliant Solution

            ACTION_1 = 'action1';
            
            function run() {
              prepare(ACTION_1);
              execute(ACTION_1);
              release(ACTION_1);
            }
            

            Exceptions

            To prevent generating some false-positives, literals having less than 5 characters are excluded.

            Define a constant instead of duplicating this literal "CustomView_GetDuplicateFields" 3 times.
            Open

                    if (Cache::has('CustomView_GetDuplicateFields', $viewId)) {
            Severity: Critical
            Found in app/CustomView.php by sonar-php

            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

            Noncompliant Code Example

            With the default threshold of 3:

            function run() {
              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
              execute('action1');
              release('action1');
            }
            

            Compliant Solution

            ACTION_1 = 'action1';
            
            function run() {
              prepare(ACTION_1);
              execute(ACTION_1);
              release(ACTION_1);
            }
            

            Exceptions

            To prevent generating some false-positives, literals having less than 5 characters are excluded.

            Define a constant instead of duplicating this literal "getColumnsListByCvid" 5 times.
            Open

                            Cache::save('getColumnsListByCvid', $cvId, $columnList);
            Severity: Critical
            Found in app/CustomView.php by sonar-php

            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

            Noncompliant Code Example

            With the default threshold of 3:

            function run() {
              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
              execute('action1');
              release('action1');
            }
            

            Compliant Solution

            ACTION_1 = 'action1';
            
            function run() {
              prepare(ACTION_1);
              execute(ACTION_1);
              release(ACTION_1);
            }
            

            Exceptions

            To prevent generating some false-positives, literals having less than 5 characters are excluded.

            Define a constant instead of duplicating this literal "GetDefaultCvId" 3 times.
            Open

                    if (Cache::has('GetDefaultCvId', $cacheName)) {
            Severity: Critical
            Found in app/CustomView.php by sonar-php

            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

            Noncompliant Code Example

            With the default threshold of 3:

            function run() {
              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
              execute('action1');
              release('action1');
            }
            

            Compliant Solution

            ACTION_1 = 'action1';
            
            function run() {
              prepare(ACTION_1);
              execute(ACTION_1);
              release(ACTION_1);
            }
            

            Exceptions

            To prevent generating some false-positives, literals having less than 5 characters are excluded.

            Define a constant instead of duplicating this literal "start" 4 times.
            Open

                    if (!empty($_SESSION['lvs'][$moduleName][$viewId]['start'])) {
            Severity: Critical
            Found in app/CustomView.php by sonar-php

            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

            Noncompliant Code Example

            With the default threshold of 3:

            function run() {
              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
              execute('action1');
              release('action1');
            }
            

            Compliant Solution

            ACTION_1 = 'action1';
            
            function run() {
              prepare(ACTION_1);
              execute(ACTION_1);
              release(ACTION_1);
            }
            

            Exceptions

            To prevent generating some false-positives, literals having less than 5 characters are excluded.

            Define a constant instead of duplicating this literal "entitytype" 3 times.
            Open

                        ->where(['entitytype' => $moduleName])->createCommand()->queryAllByGroup(2);
            Severity: Critical
            Found in app/CustomView.php by sonar-php

            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

            Noncompliant Code Example

            With the default threshold of 3:

            function run() {
              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
              execute('action1');
              release('action1');
            }
            

            Compliant Solution

            ACTION_1 = 'action1';
            
            function run() {
              prepare(ACTION_1);
              execute(ACTION_1);
              release(ACTION_1);
            }
            

            Exceptions

            To prevent generating some false-positives, literals having less than 5 characters are excluded.

            Avoid unused local variables such as '$menus'.
            Open

                    if (0 === \count($menus) && file_exists($roleMenu)) {
            Severity: Minor
            Found in app/CustomView.php by phpmd

            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

            Call to method trace from undeclared class \App\Log
            Open

                    \App\Log::trace(__METHOD__ . ' - ' . $cvIds);
            Severity: Critical
            Found in app/CustomView.php by phan

            Call to method getUserModel from undeclared class \App\User (Did you mean class \Tests\App\User)
            Open

                        $userModel = User::getUserModel($userModelOrId);
            Severity: Critical
            Found in app/CustomView.php by phan

            Returning type array{} but getSortBy() is declared to return string
            Open

                    return empty($_SESSION['lvs'][$moduleName]['sortby']) ? [] : $_SESSION['lvs'][$moduleName]['sortby'];
            Severity: Minor
            Found in app/CustomView.php by phan

            Call to method trace from undeclared class \App\Log
            Open

                    \App\Log::trace(__METHOD__ . ' - ' . $cvId);
            Severity: Critical
            Found in app/CustomView.php by phan

            Default value for int|string $viewId can't be false
            Open

                public static function hasViewChanged(string $moduleName, $viewId = false): bool
            Severity: Minor
            Found in app/CustomView.php by phan

            Saw an @param annotation for array, but it was not found in the param list of function sortConditions(?array $arrayToSort) : ?array|array|null
            Open

                 * @param array|null $array
            Severity: Info
            Found in app/CustomView.php by phan

            Call to undeclared method \App\Db\Query::select
            Open

                    $dataReader = (new \App\Db\Query())->select([
            Severity: Critical
            Found in app/CustomView.php by phan

            Variable $menus is undeclared
            Open

                    if (0 === \count($menus) && file_exists($roleMenu)) {
            Severity: Minor
            Found in app/CustomView.php by phan

            Argument 2 (key) is int but \App\Cache::has() takes string defined at /code/app/Cache.php:74
            Open

                    if (Cache::has('CustomViewById', $cvId)) {
            Severity: Minor
            Found in app/CustomView.php by phan

            Call to method trace from undeclared class \App\Log
            Open

                    Log::trace(__METHOD__);
            Severity: Critical
            Found in app/CustomView.php by phan

            Argument 2 (key) is true but \App\Cache::delete() takes string defined at /code/app/Cache.php:105
            Open

                    Cache::delete('getAllFilterColors', true);
            Severity: Minor
            Found in app/CustomView.php by phan

            Parameter $returnData has undeclared type \App\bolean
            Open

                public function getMandatoryFilter($returnData = false)
            Severity: Minor
            Found in app/CustomView.php by phan

            Call to undeclared method \App\Db\Query::select
            Open

                        $dataReader = (new Db\Query())->select(['field_name', 'module_name', 'source_field_name', 'label'])
            Severity: Critical
            Found in app/CustomView.php by phan

            Call to undeclared method \App\Db\Query::select
            Open

                    $query = (new Db\Query())->select(['userid', 'default_cvid'])->from('vtiger_user_module_preferences')->where(['tabid' => Module::getModuleId($this->moduleName)]);
            Severity: Critical
            Found in app/CustomView.php by phan

            Argument 2 (key) is false but \App\Cache::delete() takes string defined at /code/app/Cache.php:105
            Open

                    Cache::delete('getAllFilterColors', false);
            Severity: Minor
            Found in app/CustomView.php by phan

            Call to method getCurrentUserId from undeclared class \App\User (Did you mean class \Tests\App\User)
            Open

                        $userModelOrId = User::getCurrentUserId();
            Severity: Critical
            Found in app/CustomView.php by phan

            Call to method trace from undeclared class \App\Log
            Open

                    \App\Log::trace(__METHOD__ . ' - ' . $cvId);
            Severity: Critical
            Found in app/CustomView.php by phan

            Call to undeclared method \App\Db\Query::from
            Open

                    $data = (new Db\Query())->from('vtiger_customview')->where(['cvid' => $cvId])->one() ?: [];
            Severity: Critical
            Found in app/CustomView.php by phan

            Argument 2 (key) is int but \App\Cache::delete() takes string defined at /code/app/Cache.php:105
            Open

                    Cache::delete('CustomViewInfo', $cvId);
            Severity: Minor
            Found in app/CustomView.php by phan

            Call to undeclared method \App\Db\Query::select
            Open

                    $data = (new \App\Db\Query())->select(['vtiger_field.fieldname', 'u_#__cv_duplicates.ignore'])
            Severity: Critical
            Found in app/CustomView.php by phan

            Call to method trace from undeclared class \App\Log
            Open

                    \App\Log::trace(__METHOD__);
            Severity: Critical
            Found in app/CustomView.php by phan

            Argument 2 (key) is int but \App\Cache::staticSave() takes string defined at /code/app/Cache.php:156
            Open

                    \App\Cache::staticSave($cacheKey, $menuId, $filters);
            Severity: Minor
            Found in app/CustomView.php by phan

            Argument 2 (key) is int but \App\Cache::get() takes string defined at /code/app/Cache.php:61
            Open

                        return Cache::get('CustomViewById', $cvId);
            Severity: Minor
            Found in app/CustomView.php by phan

            Return type of getInstance() is undeclared type \self
            Open

                public static function getInstance($moduleName, $userModelOrId = false)
            Severity: Minor
            Found in app/CustomView.php by phan

            Call to method trace from undeclared class \App\Log
            Open

                    \App\Log::trace(__METHOD__ . ' - ' . $cvIds);
            Severity: Critical
            Found in app/CustomView.php by phan

            Saw an @param annotation for moduleName, but the param list of function getFilters() : array is empty
            Open

                 * @param string $moduleName
            Severity: Info
            Found in app/CustomView.php by phan

            Doc-block of $moduleName in isPermitted is phpdoc param type string which is not a permitted replacement of the nullable param type ?string declared in the signature ('?T' should be documented as 'T|null' or '?T')
            Open

                 * @param string $moduleName
            Severity: Minor
            Found in app/CustomView.php by phan

            Call to method getUserModel from undeclared class \App\User (Did you mean class \Tests\App\User)
            Open

                    $userModel = $userId ? \App\User::getUserModel($userId) : \App\User::getCurrentUserModel();
            Severity: Critical
            Found in app/CustomView.php by phan

            Call to method getCurrentUserModel from undeclared class \App\User (Did you mean class \Tests\App\User)
            Open

                    $userModel = User::getCurrentUserModel();
            Severity: Critical
            Found in app/CustomView.php by phan

            Default value for \App\bolean $returnData can't be false
            Open

                public function getMandatoryFilter($returnData = false)
            Severity: Minor
            Found in app/CustomView.php by phan

            Argument 2 (key) is int but \App\Cache::save() takes string defined at /code/app/Cache.php:89
            Open

                        Cache::save('CustomViewInfo', $item['cvid'], $item);
            Severity: Minor
            Found in app/CustomView.php by phan

            Argument 2 (key) is int but \App\Cache::delete() takes string defined at /code/app/Cache.php:105
            Open

                    Cache::delete('CustomViewById', $cvId);
            Severity: Minor
            Found in app/CustomView.php by phan

            Call to method getCurrentUserModel from undeclared class \App\User (Did you mean class \Tests\App\User)
            Open

                    $userModel = $userId ? \App\User::getUserModel($userId) : \App\User::getCurrentUserModel();
            Severity: Critical
            Found in app/CustomView.php by phan

            Call to undeclared method \App\Db\Query::from
            Open

                    $info = (new Db\Query())->from('vtiger_customview')->where(['entitytype' => $moduleName])->indexBy('cvid')->orderBy(['sequence' => SORT_ASC])->all();
            Severity: Critical
            Found in app/CustomView.php by phan

            Argument 2 (key) is int but \App\Cache::staticHas() takes string defined at /code/app/Cache.php:141
            Open

                    if (\App\Cache::staticHas($cacheKey, $menuId)) {
            Severity: Minor
            Found in app/CustomView.php by phan

            Returning type '' but getMandatoryFilter() is declared to return array|int
            Open

                    return $returnData ? $info[$returnValue] : $returnValue;
            Severity: Minor
            Found in app/CustomView.php by phan

            Doc-block of $userId in isPermitted is phpdoc param type int which is not a permitted replacement of the nullable param type ?int declared in the signature ('?T' should be documented as 'T|null' or '?T')
            Open

                 * @param int    $userId
            Severity: Minor
            Found in app/CustomView.php by phan

            Argument 2 (key) is int but \App\Cache::has() takes string defined at /code/app/Cache.php:74
            Open

                    if (Cache::has('CustomViewInfo', $cvId)) {
            Severity: Minor
            Found in app/CustomView.php by phan

            Argument 2 (key) is int but \App\Cache::staticGet() takes string defined at /code/app/Cache.php:128
            Open

                        return \App\Cache::staticGet($cacheKey, $menuId);
            Severity: Minor
            Found in app/CustomView.php by phan

            Argument 2 (key) is int but \App\Cache::save() takes string defined at /code/app/Cache.php:89
            Open

                    Cache::save('CustomViewById', $cvId, $data);
            Severity: Minor
            Found in app/CustomView.php by phan

            Argument 2 (key) is int but \App\Cache::get() takes string defined at /code/app/Cache.php:61
            Open

                        return Cache::get('CustomViewInfo', $cvId);
            Severity: Minor
            Found in app/CustomView.php by phan

            Call to undeclared method \App\Db\Query::select
            Open

                    $members = (new Db\Query())->select(['u_#__cv_privileges.cvid', 'member'])->from('u_#__cv_privileges')
            Severity: Critical
            Found in app/CustomView.php by phan

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

                public function getColumnsListByCvid($cvIds)
                {
                    \App\Log::trace(__METHOD__ . ' - ' . $cvIds);
                    if (Cache::has('getColumnsListByCvid', $cvIds)) {
                        return Cache::get('getColumnsListByCvid', $cvIds);
            Severity: Major
            Found in app/CustomView.php and 1 other location - About 2 hrs to fix
            app/CustomView.php on lines 223..238

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

            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 2 locations. Consider refactoring.
            Open

                public function getCustomView($cvIds)
                {
                    \App\Log::trace(__METHOD__ . ' - ' . $cvIds);
                    if (Cache::staticHas('getCustomView', $cvIds)) {
                        return Cache::staticGet('getCustomView', $cvIds);
            Severity: Major
            Found in app/CustomView.php and 1 other location - About 2 hrs to fix
            app/CustomView.php on lines 286..301

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

            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

            Avoid variables with short names like $id. Configured minimum length is 3.
            Open

                public static function getConditions($id): array
            Severity: Minor
            Found in app/CustomView.php by phpmd

            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

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @return bool
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @return array
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Get current page.
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Function to get all the date filter type informations.
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param int|string $viewId
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public static function setCurrentPage($moduleName, $viewId, $start)
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param string $moduleName - module name
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @return int|string
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                const CV_STATUS_PENDING = 2;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $dateFilters = Condition::DATE_OPERATORS;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param int|string $viewId
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param int        $start
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @return string
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public static function getCurrentPage($moduleName, $viewId)
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    if (!empty($_SESSION['lvs'][$moduleName][$viewId]['start'])) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param string     $moduleName - module name
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public static function isMultiViewId($cvId)
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public static function getDateFilterTypes()
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    return $dateFilters;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        return $_SESSION['lvs'][$moduleName][$viewId]['start'];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $dateFilters[$filterType]['enddate'] = $dateValues[1];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Set current page.
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        unset($_SESSION['lvs'][$moduleName][$viewId]['start']);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Do we have multiple ids.
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $dateValues = \DateTimeRange::getDateRangeByType($filterType);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $_SESSION['lvs'][$moduleName]['viewname'] = $viewId;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    return $_SESSION['lvs'][$moduleName]['viewname'] ?? null;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param string $moduleName
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Function that sets the module filter in session.
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Function that reads current module filter.
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param string $cvId (comma separated id list or one id)
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    return false !== strpos($cvId, ',');
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @return int
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param int|string $viewId     - filter id
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public static function getCurrentView($moduleName)
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public static function getSortBy($moduleName)
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                const CV_STATUS_PUBLIC = 3;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $dateFilters[$filterType]['startdate'] = $dateValues[0];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    return 1;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                const CV_STATUS_DEFAULT = 0;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    foreach (array_keys($dateFilters) as $filterType) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    if (empty($start)) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    } else {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Get sorted by.
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                const CV_STATUS_SYSTEM = 4;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public static function setCurrentView($moduleName, $viewId)
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                const CV_STATUS_PRIVATE = 1;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param string     $moduleName
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $_SESSION['lvs'][$moduleName][$viewId]['start'] = $start;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    return empty($_SESSION['lvs'][$moduleName]['sortby']) ? [] : $_SESSION['lvs'][$moduleName]['sortby'];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param string     $moduleName
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        return \App\Cache::staticGet('AppCustomView', $cacheName);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                private $module;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @throws Exceptions\AppException
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @return array
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    if (is_numeric($cvId)) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        return Cache::staticGet('getCustomView', $cvIds);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    if (empty($cvIds) || !static::isMultiViewId($cvIds)) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    return $filters;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $columnList = [];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Set sorted by.
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public static function setSortBy(string $moduleName, $sortBy)
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        unset($_SESSION['lvs'][$moduleName]['sortby']);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    if (is_numeric($userModelOrId)) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                private $defaultViewId;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Get custom view from file.
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        while ($row = $dataReader->read()) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            Cache::save('getColumnsListByCvid', $cvId, $columnList);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param string     $moduleName
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    } else {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    return $filter;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public function getCustomView($cvIds)
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @throws Exceptions\AppException
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Line exceeds 120 characters; contains 144 characters
            Open

                            ->innerJoin('vtiger_field', 'vtiger_tab.tabid = vtiger_field.tabid AND vtiger_field.fieldname = vtiger_cvcolumnlist.field_name')
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Static Function to get the Instance of CustomView.
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $userModel = User::getUserModel($userModelOrId);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    \App\Log::trace(__METHOD__ . ' - ' . $cvId);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param string $cvIds (comma separated multi cdIds)
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    if (empty($sortBy)) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    return empty($_SESSION['lvs'][$moduleName]['viewname'])
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    || !isset($_SESSION['lvs'][$moduleName]['sortby']);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /** @var \Vtiger_Module_Model */
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                private $user;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @throws Exceptions\AppException
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Get custom view from file.
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    \App\Log::trace(__METHOD__ . ' - ' . $cvIds);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    if (Cache::staticHas('getCustomView', $cvIds)) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param mixed  $sortBy
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    \App\Cache::staticSave('AppCustomView', $cacheName, $instance);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                private function getCustomViewFromFile($cvId)
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $filter = new $handlerClass();
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            if (!empty($row['source_field_name']) && !$this->getModule()->getFieldByName($row['source_field_name'])->isActiveField()) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        Cache::save('getColumnsListByCvid', $cvId, $columnList);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param mixed  $userModelOrId
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            ->innerJoin('vtiger_field', 'vtiger_tab.tabid = vtiger_field.tabid AND vtiger_field.fieldname = vtiger_cvcolumnlist.field_name')
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                continue;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param string $moduleName
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    } else {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public static function hasViewChanged(string $moduleName, $viewId = false): bool
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $this->module = \Vtiger_Module_Model::getInstance($this->moduleName);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    || ($viewId && ($viewId !== $_SESSION['lvs'][$moduleName]['viewname']))
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public static function getInstance($moduleName, $userModelOrId = false)
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    if (!$userModelOrId) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $userModelOrId = User::getCurrentUserId();
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $cacheName = $moduleName . '.' . $userModel->getId();
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $instance->user = $userModel;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                private function getColumnsByCvidFromDb($cvId)
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $dataReader->close();
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @return bool
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $userModel = $userModelOrId;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    return $instance;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @return false|\Vtiger_Module_Model
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Columns list by cvid.
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    \App\Log::trace(__METHOD__ . ' - ' . $cvId);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $columnList[] = $row;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    } else {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @return \self
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    if (\App\Cache::staticHas('AppCustomView', $cacheName)) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $instance = new self();
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                private $moduleName;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public function getModule()
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    if (!$this->module) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    Cache::staticSave('getCustomView', $cvId, $filter);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        return $this->getCustomViewFromFile($cvIds);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Line exceeds 120 characters; contains 128 characters
            Open

                            ->where(['cvid' => $cvId, 'vtiger_field.presence' => [0, 2]])->orderBy('columnindex')->createCommand()->query();
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $view = $this->getCustomViewFromFile($cvId);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $columnList = $view->getColumnList();
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    return $columnList;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $_SESSION['lvs'][$moduleName]['sortby'] = $sortBy;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $handlerClass = \Vtiger_Loader::getComponentClassName('Filter', $cvId, $this->moduleName);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $filters[] = $this->getCustomViewFromFile($cvId);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param mixed $cvId
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            ->where(['cvid' => $cvId, 'vtiger_field.presence' => [0, 2]])->orderBy('columnindex')->createCommand()->query();
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    return $this->module;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param string $cvId
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            ->innerJoin('vtiger_tab', 'vtiger_tab.name=vtiger_cvcolumnlist.module_name')
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Has view changed.
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param int|string $viewId
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param string $moduleName
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $instance->moduleName = $moduleName;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Gets module object.
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $filters = [];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    foreach (explode(',', $cvIds) as $cvId) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    Cache::staticSave('getCustomView', $cvIds, $filters);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $dataReader = (new Db\Query())->select(['field_name', 'module_name', 'source_field_name', 'label'])
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            ->from('vtiger_cvcolumnlist')
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Line exceeds 120 characters; contains 139 characters
            Open

                            if (!empty($row['source_field_name']) && !$this->getModule()->getFieldByName($row['source_field_name'])->isActiveField()) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        if ($columnList) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $columnLists = [];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $columnLists[] = $this->getColumnsByCvidFromDb($cvId);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        'u_#__cv_condition_group.id',
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        ->where(['u_#__cv_condition_group.cvid' => $id])
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                    'condition' => $condition['condition'],
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    Cache::save('CustomView_GetConditions', $id, $conditions, Cache::LONG);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param mixed $cvIds (comma separated)
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @return array
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *               'value' => values
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *               ]
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        'u_#__cv_condition.operator',
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                        ],
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                    ],
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                    'rules' => [],
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        return $this->getColumnsByCvidFromDb($cvIds);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    Cache::save('getColumnsListByCvid', $cvIds, $columnLists);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *               'condition' => "AND" or "OR"
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $dataReader = (new \App\Db\Query())->select([
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                ];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    if (Cache::has('getColumnsListByCvid', $cvIds)) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        'u_#__cv_condition.field_name',
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $referenceParent[$condition['parent_id']][$condition['condition_index']] = [
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            } else {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                            'value' => $value,
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                ];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            } else {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *               'rules' => [[
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                'value' => $value,
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                $referenceGroup[$condition['parent_id']][$condition['group_index']] = [
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                    'rules' => [],
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                            'fieldname' => $fieldName,
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                            'fieldname' => $fieldName,
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        return Cache::get('CustomView_GetConditions', $id);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        'u_#__cv_condition.module_name',
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                ];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $referenceGroup[$condition['group_id']] = &$conditions['rules'];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $conditions = static::sortConditions($conditions);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @throws Exceptions\AppException
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Returns conditions for filter.
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        'u_#__cv_condition.group_id',
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        'u_#__cv_condition_group.condition',
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        ->orderBy(['u_#__cv_condition_group.parent_id' => SORT_ASC])
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        ->createCommand()->query();
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $isEmptyCondition = false;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        } else {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            ];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                    'condition' => $condition['condition'],
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    return $conditions;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @return array|null
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        ->leftJoin('u_#__cv_condition', 'u_#__cv_condition.group_id = u_#__cv_condition_group.id')
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Line exceeds 120 characters; contains 163 characters
            Open

                        $fieldName = "{$condition['field_name']}:{$condition['module_name']}" . ($condition['source_field_name'] ? ':' . $condition['source_field_name'] : '');
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        } elseif (isset($referenceGroup[$condition['parent_id']])) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                        ],
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    foreach (explode(',', $cvIds) as $cvId) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param int|string $id
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *               'fieldname' => name of fields
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        'condition_index' => 'u_#__cv_condition.index',
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    while ($condition = $dataReader->read()) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $value = $condition['value'];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        if (isset($referenceParent[$condition['parent_id']], $referenceGroup[$condition['group_id']])) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            if ($isEmptyCondition) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            if ($isEmptyCondition) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                ];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                    ],
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param int|string $viewId
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @return array
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    \App\Log::trace(__METHOD__ . ' - ' . $cvIds);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *               ]]
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        'group_index' => 'u_#__cv_condition_group.index',
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                'operator' => $condition['operator'],
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                    'condition' => $condition['condition'],
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $referenceParent[$condition['parent_id']] = &$referenceGroup[$condition['parent_id']][$condition['group_index']]['rules'];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Columns list by cvid.
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        return Cache::get('getColumnsListByCvid', $cvIds);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    return $columnLists;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *               [
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    if (Cache::has('CustomView_GetConditions', $id)) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        'u_#__cv_condition_group.parent_id',
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $referenceGroup = $referenceParent = $conditions = [];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $isEmptyCondition = true;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            if (isset($rule['condition'])) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        'u_#__cv_condition.value',
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $condition['group_id'] = $condition['id'];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $fieldName = "{$condition['field_name']}:{$condition['module_name']}" . ($condition['source_field_name'] ? ':' . $condition['source_field_name'] : '');
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                'fieldname' => $fieldName,
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                            'operator' => $condition['operator'],
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                $conditions = [
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $referenceParent[$condition['parent_id']] = &$conditions['rules'];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    if (empty($cvIds) || !static::isMultiViewId($cvIds)) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        'u_#__cv_condition.source_field_name',
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        if ($condition['group_id']) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public static function getConditions($id): array
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                        $condition['condition_index'] => [
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Line exceeds 120 characters; contains 138 characters
            Open

                            $referenceParent[$condition['parent_id']] = &$referenceGroup[$condition['parent_id']][$condition['group_index']]['rules'];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Sorting conditions.
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param array|null $array
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $referenceGroup[$condition['group_id']] = &$referenceGroup[$condition['parent_id']][$condition['group_index']]['rules'];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                    'rules' => [
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                static::sortConditions($rule);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                        $condition['condition_index'] => [
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param ?array     $arrayToSort
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        ksort($arrayToSort['rules']);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        foreach ($arrayToSort['rules'] as $rule) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public function getColumnsListByCvid($cvIds)
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Line exceeds 120 characters; contains 136 characters
            Open

                            $referenceGroup[$condition['group_id']] = &$referenceGroup[$condition['parent_id']][$condition['group_index']]['rules'];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        } else {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                            'value' => $value,
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                private static function sortConditions(?array $arrayToSort): ?array
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    if (isset($arrayToSort['rules'])) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Get fields to detect duplicates.
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *               'operator' => operator, for instance: 'e'
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    ])->from('u_#__cv_condition_group')
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                    'condition' => $condition['condition'],
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                $referenceGroup[$condition['parent_id']][$condition['group_index']] = [
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                    'rules' => [
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                $conditions = [
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                            'operator' => $condition['operator'],
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    return $arrayToSort;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public function getViewId($noCache = false)
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                $viewId = null;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @return int|string
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $defaultCvId = $this->getMandatoryFilter();
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Get mandatory filter by module.
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $returnValue = $index;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    Cache::save('CustomView_GetDuplicateFields', $viewId, $data);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $viewId = self::getCurrentView($this->moduleName);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        if (!is_numeric($viewId)) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $query = (new Db\Query())->select(['userid', 'default_cvid'])->from('vtiger_user_module_preferences')->where(['tabid' => Module::getModuleId($this->moduleName)]);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            if (1 === $values['setdefault'] && $this->isPermittedCustomView($cvId)) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                $defaultCvId = $cvId;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    Log::trace(__METHOD__);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param mixed $noCache
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $viewId = current(self::getModuleFiltersByMenuId(Request::_getInteger('mid'), $this->moduleName));
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        } else {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $this->defaultViewId = $viewId;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Line exceeds 120 characters; contains 170 characters
            Open

                    $query = (new Db\Query())->select(['userid', 'default_cvid'])->from('vtiger_user_module_preferences')->where(['tabid' => Module::getModuleId($this->moduleName)]);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $returnValue = '';
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    return $returnData ? $info[$returnValue] : $returnValue;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @return int|null
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $viewId = null;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @return int|string
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        if (empty($viewId)) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $viewId = $this->getDefaultCvId();
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            } else {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    if (!$defaultCvId) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Function to check if the current user is able to see the customView.
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @return bool
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $returnValue = $index;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    if (!is_numeric($viewId)) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $info = $this->getFilters();
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        if (0 === $values['presence']) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        ->innerJoin('vtiger_field', 'vtiger_field.fieldid = u_#__cv_duplicates.fieldid')
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    return $data;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    \App\Log::trace(__METHOD__);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $viewId = Request::_get('viewname');
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        if (isset($data[$member]) && $this->isPermittedCustomView($data[$member])) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        foreach ($this->getFilters() as $cvId => $values) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public function isPermittedCustomView($viewId)
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        if (2 === $values['presence']) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        return $this->defaultViewId;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        if (Request::_has('mid')) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    } else {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            break;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @return array|int
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        return [];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * To get the customViewId of the specified module.
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Get default cvId.
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $cacheName = $this->moduleName . $this->user->getId();
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    foreach ($this->user->getMemberStructure() as $member) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $defaultCvId = $data[$member];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    return $defaultCvId;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @return array
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        if (empty($viewId) || !$this->isPermittedCustomView($viewId)) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $data = $query->createCommand()->queryAllByGroup();
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    Cache::save('GetDefaultCvId', $cacheName, $defaultCvId);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param bolean $returnData
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    foreach ($info as $index => &$values) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        if ($values['viewname'] === $viewName) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        ->from('u_#__cv_duplicates')
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                $viewId = $this->getMandatoryFilter();
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                break;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param int|string $viewId
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        return Cache::get('CustomView_GetDuplicateFields', $viewId);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $data = (new \App\Db\Query())->select(['vtiger_field.fieldname', 'u_#__cv_duplicates.ignore'])
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $viewId = null;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            if (!$viewId) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                $viewId = $this->getDefaultCvId();
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        if (!$defaultCvId) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    foreach ($this->getFilters() as $cvId => &$values) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        ->where(['u_#__cv_duplicates.cvid' => $viewId])->all();
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    if ($noCache || Request::_isEmpty('viewname')) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $viewId = $this->getMandatoryFilter();
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param string $viewName
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public static function getDuplicateFields($viewId): array
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            if (empty($this->getFilterInfo($viewId))) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public function getDefaultCvId()
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        return Cache::get('GetDefaultCvId', $cacheName);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                $viewId = $this->getViewIdByName($viewId);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            if (!$this->isPermittedCustomView($viewId)) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    return self::isPermitted($viewId, $this->moduleName, $this->user->getId());
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    if (Cache::has('CustomView_GetDuplicateFields', $viewId)) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        if (empty($viewId) && !$noCache && self::getCurrentView($this->moduleName)) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            if ('All' === $viewId) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $viewId = (int) $viewId;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                throw new Exceptions\NoPermitted('ERR_NO_PERMITTED_TO_VIEW');
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    return $viewId;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $defaultCvId = null;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public function getMandatoryFilter($returnData = false)
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public function getViewIdByName(string $viewName): ?int
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    if (isset($this->defaultViewId)) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    if (Cache::has('GetDefaultCvId', $cacheName)) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            break;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Get viewId by name.
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param int $cvId
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @return array
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public static function getFiltersByModule(string $moduleName): array
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        ->innerJoin('vtiger_customview', 'u_#__cv_privileges.cvid=vtiger_customview.cvid')
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $info = (new Db\Query())->from('vtiger_customview')->where(['entitytype' => $moduleName])->indexBy('cvid')->orderBy(['sequence' => SORT_ASC])->all();
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    foreach ($info as &$item) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        if ($moduleName) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Line exceeds 120 characters; contains 127 characters
            Open

                    $roleMenu = 'user_privileges/menu_' . filter_var($userModel->getDetail('roleid'), FILTER_SANITIZE_NUMBER_INT) . '.php';
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    Cache::save('CustomViewById', $cvId, $data);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    if (!empty($data['advanced_conditions'])) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public function getFilterInfo(int $cvId): array
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $viewId = $cvId;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    return self::getFiltersByModule($this->moduleName);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    || $data['userid'] === $userModel->getId()
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public function getFilters(): array
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param int    $userId
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    return ($data = self::getCVDetails($cvId, $moduleName))
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $item['userid'] = (int) $item['userid'];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Get module filters by menu id.
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $filters = [];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param string $moduleName
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    file_exists($roleMenu) ? require $roleMenu : require 'user_privileges/menu_0.php';
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $filters = array_intersect($filtersMenu, $filtersCustomView);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        require 'user_privileges/menu_0.php';
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    if (isset($filterList[$menuId])) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    return $data;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    return $this->getFilters()[$cvId] ?? [];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Function to get basic information about all filters.
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Check permissions.
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param int    $cvId
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    && ($userModel->isAdmin()
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $item['cvid'] = (int) $item['cvid'];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            if (isset($lvs[$moduleName])) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    || 0 === $data['presence']
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        return Cache::get('CustomViewInfo', $moduleName);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Line exceeds 120 characters; contains 157 characters
            Open

                    $info = (new Db\Query())->from('vtiger_customview')->where(['entitytype' => $moduleName])->indexBy('cvid')->orderBy(['sequence' => SORT_ASC])->all();
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param string|bool $moduleName
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param int    $menuId
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    if (\App\Cache::staticHas($cacheKey, $menuId)) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public static function getCustomViewById(int $cvId): array
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            \App\Session::set('lvs', []);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Function to get basic information about all filters for module.
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $item['featured'] = (int) $item['featured'];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    return $info;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    if (\App\Session::has('lvs')) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    if (Cache::has('CustomViewById', $cvId)) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    return $viewId;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Function to get basic information about filter.
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    || (self::CV_STATUS_PRIVATE === $data['status'] && array_intersect($userModel->getMemberStructure(), $data['members'])));
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    if (Cache::has('CustomViewInfo', $moduleName)) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $item['privileges'] = (int) $item['privileges'];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        } else {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $filtersMenu = explode(',', $filterList[$menuId]['filters']);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param int $cvId
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @return array
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $userModel = $userId ? \App\User::getUserModel($userId) : \App\User::getCurrentUserModel();
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $item['status'] = (int) $item['status'];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public static function resetCurrentView($moduleName = false)
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $roleMenu = 'user_privileges/menu_' . filter_var($userModel->getDetail('roleid'), FILTER_SANITIZE_NUMBER_INT) . '.php';
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    return $filters;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @return array
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @return array
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $item['presence'] = (int) $item['presence'];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Reset current views configuration in session.
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @return array
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public static function getModuleFiltersByMenuId(int $menuId, string $moduleName = ''): array
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $data = (new Db\Query())->from('vtiger_customview')->where(['cvid' => $cvId])->one() ?: [];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $members = (new Db\Query())->select(['u_#__cv_privileges.cvid', 'member'])->from('u_#__cv_privileges')
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $item['setmetrics'] = (int) $item['setmetrics'];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $lvs = \App\Session::get('lvs');
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @return bool
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param string $moduleName
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        ->where(['entitytype' => $moduleName])->createCommand()->queryAllByGroup(2);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    Cache::save('CustomViewInfo', $moduleName, $info);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Get custom view by ID.
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public static function isPermitted(int $cvId, string $moduleName = null, int $userId = null): bool
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    || \in_array($data['status'], [self::CV_STATUS_DEFAULT, self::CV_STATUS_PUBLIC])
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Line exceeds 120 characters; contains 129 characters
            Open

                    || (self::CV_STATUS_PRIVATE === $data['status'] && array_intersect($userModel->getMemberStructure(), $data['members'])));
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        Cache::save('CustomViewInfo', $item['cvid'], $item);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                \App\Session::set('lvs', $lvs);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        return \App\Cache::staticGet($cacheKey, $menuId);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    \App\Cache::staticSave($cacheKey, $menuId, $filters);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $data['advanced_conditions'] = \App\Json::decode($data['advanced_conditions']);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @return void
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    Cache::delete('getAllFilterColors', false);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Function clear cache by custom view ID.
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        foreach (\App\Module::getAllModuleNames() as $moduleName) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    return $moduleName ? (self::getFiltersByModule($moduleName)[$cvId] ?? []) : [];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param string $moduleName
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $item['members'] = $members[$item['cvid']] ?? [];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $cacheKey = 'getModuleFiltersByMenuId' . $moduleName;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $filtersCustomView = array_keys(\CustomView_Record_Model::getAll($moduleName));
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        return Cache::get('CustomViewById', $cvId);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @return array
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        return Cache::get('CustomViewInfo', $cvId);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    } else {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        Cache::delete('CustomViewInfo', $moduleName);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param string|null $moduleName
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public static function clearCacheById(int $cvId, string $moduleName = null): void
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param int         $cvId
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param int         $cvId
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    if (null === $moduleName) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            break;
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param string $moduleName
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $item['setdefault'] = (int) $item['setdefault'];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $item['sequence'] = (int) $item['sequence'];
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                unset($lvs[$moduleName]);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $userModel = User::getCurrentUserModel();
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    if (0 === \count($menus) && file_exists($roleMenu)) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    if (Cache::has('CustomViewInfo', $cvId)) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            Cache::delete('CustomViewInfo', $moduleName);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    Cache::delete('CustomViewById', $cvId);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public static function getCVDetails(int $cvId, string $moduleName = null): array
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Gets custom view details by ID.
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param string|null $moduleName
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    if (!$moduleName) {
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $moduleName = self::getCustomViewById($cvId)['entitytype'] ?? '';
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    Cache::delete('CustomViewInfo', $cvId);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        }
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    Cache::delete('getAllFilterColors', true);
            Severity: Minor
            Found in app/CustomView.php by phpcodesniffer

            There are no issues that match your filters.

            Category
            Status