YetiForceCompany/YetiForceCRM

View on GitHub
include/runtime/Viewer.php

Summary

Maintainability
C
1 day
Test Coverage
F
57%

__construct accesses the super-global variable $_POST.
Open

    public function __construct($media = '')
    {
        parent::__construct();
        $this->debugging = App\Config::debug('DISPLAY_DEBUG_VIEWER');

Severity: Minor
Found in include/runtime/Viewer.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

__construct accesses the super-global variable $_POST.
Open

    public function __construct($media = '')
    {
        parent::__construct();
        $this->debugging = App\Config::debug('DISPLAY_DEBUG_VIEWER');

Severity: Minor
Found in include/runtime/Viewer.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

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

    public function getTemplatePath($templateName, $moduleName = ''): string
    {
        $moduleName = str_replace(':', '/', $moduleName);
        $cacheKey = $templateName . $moduleName;
        if (\App\Cache::has('ViewerTemplatePath', $cacheKey)) {
Severity: Minor
Found in include/runtime/Viewer.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 view has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function view($templateName, $moduleName = '', $fetch = false)
    {
        $templatePath = $this->getTemplatePath($templateName, $moduleName);
        if (\App\Cache::has('ViewerTemplateExists', $templatePath)) {
            $templateFound = \App\Cache::get('ViewerTemplateExists', $templatePath);
Severity: Minor
Found in include/runtime/Viewer.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

Method getTemplatePath has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getTemplatePath($templateName, $moduleName = ''): string
    {
        $moduleName = str_replace(':', '/', $moduleName);
        $cacheKey = $templateName . $moduleName;
        if (\App\Cache::has('ViewerTemplatePath', $cacheKey)) {
Severity: Minor
Found in include/runtime/Viewer.php - About 1 hr to fix

    Method __construct has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function __construct($media = '')
        {
            parent::__construct();
            $this->debugging = App\Config::debug('DISPLAY_DEBUG_VIEWER');
    
    
    Severity: Minor
    Found in include/runtime/Viewer.php - About 1 hr to fix

      Method view has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function view($templateName, $moduleName = '', $fetch = false)
          {
              $templatePath = $this->getTemplatePath($templateName, $moduleName);
              if (\App\Cache::has('ViewerTemplateExists', $templatePath)) {
                  $templateFound = \App\Cache::get('ViewerTemplateExists', $templatePath);
      Severity: Minor
      Found in include/runtime/Viewer.php - About 1 hr to fix

        Function __construct has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            public function __construct($media = '')
            {
                parent::__construct();
                $this->debugging = App\Config::debug('DISPLAY_DEBUG_VIEWER');
        
        
        Severity: Minor
        Found in include/runtime/Viewer.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

        The method view() has an NPath complexity of 250. The configured NPath complexity threshold is 200.
        Open

            public function view($templateName, $moduleName = '', $fetch = false)
            {
                $templatePath = $this->getTemplatePath($templateName, $moduleName);
                if (\App\Cache::has('ViewerTemplateExists', $templatePath)) {
                    $templateFound = \App\Cache::get('ViewerTemplateExists', $templatePath);
        Severity: Minor
        Found in include/runtime/Viewer.php by phpmd

        NPathComplexity

        Since: 0.1

        The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

        Example

        class Foo {
            function bar() {
                // lots of complicated code
            }
        }

        Source https://phpmd.org/rules/codesize.html#npathcomplexity

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

            public function getTemplatePath($templateName, $moduleName = ''): string
            {
                $moduleName = str_replace(':', '/', $moduleName);
                $cacheKey = $templateName . $moduleName;
                if (\App\Cache::has('ViewerTemplatePath', $cacheKey)) {
        Severity: Minor
        Found in include/runtime/Viewer.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 view() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10.
        Open

            public function view($templateName, $moduleName = '', $fetch = false)
            {
                $templatePath = $this->getTemplatePath($templateName, $moduleName);
                if (\App\Cache::has('ViewerTemplateExists', $templatePath)) {
                    $templateFound = \App\Cache::get('ViewerTemplateExists', $templatePath);
        Severity: Minor
        Found in include/runtime/Viewer.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

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

            public function view($templateName, $moduleName = '', $fetch = false)
        Severity: Critical
        Found in include/runtime/Viewer.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 17 to the 15 allowed.
        Open

            public function getTemplatePath($templateName, $moduleName = ''): string
        Severity: Critical
        Found in include/runtime/Viewer.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

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

            public function view($templateName, $moduleName = '', $fetch = false)
        Severity: Minor
        Found in include/runtime/Viewer.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

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

                    \App\Cache::save('ViewerTemplateExists', $templatePath, $templateFound, \App\Cache::LONG);
        Severity: Minor
        Found in include/runtime/Viewer.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 'getTemplatePath'.
        Open

                                \App\Cache::save('ViewerTemplatePath', $cacheKey, $intermediateFallBackFileName, \App\Cache::LONG);
        Severity: Minor
        Found in include/runtime/Viewer.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 'view'.
        Open

                    $templateFound = \App\Cache::get('ViewerTemplateExists', $templatePath);
        Severity: Minor
        Found in include/runtime/Viewer.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 __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
        Open

                } else {
                    self::$currentLayout = \App\Layout::getActiveLayout();
                }
        Severity: Minor
        Found in include/runtime/Viewer.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\Layout' in method '__construct'.
        Open

                    self::$currentLayout = \App\Layout::getActiveLayout();
        Severity: Minor
        Found in include/runtime/Viewer.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 '__construct'.
        Open

                    $this->log("URI: $debugViewerURI, TYPE: " . \App\Request::_getServer('REQUEST_METHOD'));
        Severity: Minor
        Found in include/runtime/Viewer.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 __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
        Open

                    } else {
                        $debugViewerURI = \App\Request::_getServer('REQUEST_URI');
                    }
        Severity: Minor
        Found in include/runtime/Viewer.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 'getTemplatePath'.
        Open

                    return \App\Cache::get('ViewerTemplatePath', $cacheKey);
        Severity: Minor
        Found in include/runtime/Viewer.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 view uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
        Open

                } else {
                    $templateFound = $this->templateExists($templatePath);
                    \App\Cache::save('ViewerTemplateExists', $templatePath, $templateFound, \App\Cache::LONG);
                }
        Severity: Minor
        Found in include/runtime/Viewer.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\Config' in method '__construct'.
        Open

                if (App\Config::performance('LOAD_CUSTOM_FILES')) {
        Severity: Minor
        Found in include/runtime/Viewer.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 '__construct'.
        Open

                    $debugViewerURI = parse_url(\App\Request::_getServer('REQUEST_URI'), PHP_URL_PATH);
        Severity: Minor
        Found in include/runtime/Viewer.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 'getTemplatePath'.
        Open

                    self::$completeTemplatePath = \App\Cache::get('ViewerCompleteTemplatePath', $cacheKey);
        Severity: Minor
        Found in include/runtime/Viewer.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\Config' in method '__construct'.
        Open

                self::$debugViewer = App\Config::debug('DEBUG_VIEWER');
        Severity: Minor
        Found in include/runtime/Viewer.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\Config' in method 'view'.
        Open

                        $this->error_reporting = App\Config::debug('SMARTY_ERROR_REPORTING');
        Severity: Minor
        Found in include/runtime/Viewer.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 'getTemplatePath'.
        Open

                \App\Cache::save('ViewerTemplatePath', $cacheKey, $filePath, \App\Cache::LONG);
        Severity: Minor
        Found in include/runtime/Viewer.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 'getTemplatePath'.
        Open

                                \App\Cache::save('ViewerCompleteTemplatePath', $cacheKey, self::$completeTemplatePath, \App\Cache::LONG);
        Severity: Minor
        Found in include/runtime/Viewer.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 'getTemplatePath'.
        Open

                \App\Cache::save('ViewerCompleteTemplatePath', $cacheKey, self::$completeTemplatePath, \App\Cache::LONG);
        Severity: Minor
        Found in include/runtime/Viewer.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\Config' in method 'view'.
        Open

                    if (!empty(App\Config::debug('SMARTY_ERROR_REPORTING'))) {
        Severity: Minor
        Found in include/runtime/Viewer.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\Config' in method '__construct'.
        Open

                $this->debugging = App\Config::debug('DISPLAY_DEBUG_VIEWER');
        Severity: Minor
        Found in include/runtime/Viewer.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 '__construct'.
        Open

                        $debugViewerURI = \App\Request::_getServer('REQUEST_URI');
        Severity: Minor
        Found in include/runtime/Viewer.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 'getTemplatePath'.
        Open

                if (\App\Cache::has('ViewerTemplatePath', $cacheKey)) {
        Severity: Minor
        Found in include/runtime/Viewer.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\Config' in method '__construct'.
        Open

                if (App\Config::performance('LOAD_CUSTOM_FILES')) {
        Severity: Minor
        Found in include/runtime/Viewer.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 'view'.
        Open

                if (\App\Cache::has('ViewerTemplateExists', $templatePath)) {
        Severity: Minor
        Found in include/runtime/Viewer.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 "ViewerCompleteTemplatePath" 3 times.
        Open

                    self::$completeTemplatePath = \App\Cache::get('ViewerCompleteTemplatePath', $cacheKey);
        Severity: Critical
        Found in include/runtime/Viewer.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 "ViewerTemplateExists" 3 times.
        Open

                if (\App\Cache::has('ViewerTemplateExists', $templatePath)) {
        Severity: Critical
        Found in include/runtime/Viewer.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 "ViewerTemplatePath" 4 times.
        Open

                if (\App\Cache::has('ViewerTemplatePath', $cacheKey)) {
        Severity: Critical
        Found in include/runtime/Viewer.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.

        Default value for \type $delimiter can't be string
        Open

            protected function log($message, $delimiter = '\n')
        Severity: Minor
        Found in include/runtime/Viewer.php by phan

        Call to undeclared method \Vtiger_Viewer::getTemplateDir
        Open

                foreach ($this->getTemplateDir() as $templateDir) {
        Severity: Critical
        Found in include/runtime/Viewer.php by phan

        Call to undeclared method \Vtiger_Viewer::fetch
        Open

                        return $this->fetch($templatePath);
        Severity: Critical
        Found in include/runtime/Viewer.php by phan

        Argument 1 (message) is string but \Vtiger_Viewer::log() takes \type defined at /code/include/runtime/Viewer.php:31
        Open

                    $this->log("VIEW: $templatePathToLog, FOUND: " . ($templateFound ? '1' : '0'));
        Severity: Minor
        Found in include/runtime/Viewer.php by phan

        Argument 1 (message) is string but \Vtiger_Viewer::log() takes \type defined at /code/include/runtime/Viewer.php:31
        Open

                        $this->log(sprintf('DATA: %s, TYPE: %s', $key, $valueType));
        Severity: Minor
        Found in include/runtime/Viewer.php by phan

        Parameter $delimiter has undeclared type \type
        Open

            protected function log($message, $delimiter = '\n')
        Severity: Minor
        Found in include/runtime/Viewer.php by phan

        Suspicious type \type of a variable or expression used to build a string. (Expected type to be able to cast to a string)
        Open

                    file_put_contents($file, $message . $delimiter, FILE_APPEND);
        Severity: Minor
        Found in include/runtime/Viewer.php by phan

        Call to undeclared method \Vtiger_Viewer::templateExists
        Open

                    $templateFound = $this->templateExists($templatePath);
        Severity: Critical
        Found in include/runtime/Viewer.php by phan

        Class extends undeclared class \Smarty
        Open

        class Vtiger_Viewer extends \Smarty
        Severity: Critical
        Found in include/runtime/Viewer.php by phan

        Parameter $message has undeclared type \type
        Open

            protected function log($message, $delimiter = '\n')
        Severity: Minor
        Found in include/runtime/Viewer.php by phan

        Saw possibly unextractable annotation for a fragment of comment '* @param string - $media Layout/Media name': after string, did not see an element name (will guess based on comment order)
        Open

             * @param string - $media Layout/Media name
        Severity: Info
        Found in include/runtime/Viewer.php by phan

        Reference to undeclared property \Vtiger_Viewer->tpl_vars
        Open

                    foreach ($this->tpl_vars as $key => $smarty_variable) {
        Severity: Minor
        Found in include/runtime/Viewer.php by phan

        Call to undeclared method \Vtiger_Viewer::display
        Open

                    $this->display($templatePath);
        Severity: Critical
        Found in include/runtime/Viewer.php by phan

        Returning type false but getInstance() is declared to return \Vtiger_Viewer
        Open

                    return self::$instance;
        Severity: Minor
        Found in include/runtime/Viewer.php by phan

        Call to undeclared method \Vtiger_Viewer::setTemplateDir
        Open

                $this->setTemplateDir(array_unique($templateDir));
        Severity: Critical
        Found in include/runtime/Viewer.php by phan

        Returning type false but view() is declared to return string
        Open

                return false;
        Severity: Minor
        Found in include/runtime/Viewer.php by phan

        Assigning \Vtiger_Viewer to property but \Vtiger_Viewer::$instance is false
        Open

                self::$instance = $instance;
        Severity: Minor
        Found in include/runtime/Viewer.php by phan

        Call to undeclared method \Vtiger_Viewer::setCompileDir
        Open

                $this->setCompileDir($compileDir);
        Severity: Critical
        Found in include/runtime/Viewer.php by phan

        Reference to undeclared class \Smarty
        Open

                parent::__construct();
        Severity: Critical
        Found in include/runtime/Viewer.php by phan

        Argument 1 (message) is string but \Vtiger_Viewer::log() takes \type defined at /code/include/runtime/Viewer.php:31
        Open

                    $this->log("URI: $debugViewerURI, TYPE: " . \App\Request::_getServer('REQUEST_METHOD'));
        Severity: Minor
        Found in include/runtime/Viewer.php by phan

        Reference to undeclared property \Vtiger_Viewer->error_reporting
        Open

                        $this->error_reporting = App\Config::debug('SMARTY_ERROR_REPORTING');
        Severity: Minor
        Found in include/runtime/Viewer.php by phan

        Reference to undeclared property \Vtiger_Viewer->debugging
        Open

                $this->debugging = App\Config::debug('DISPLAY_DEBUG_VIEWER');
        Severity: Minor
        Found in include/runtime/Viewer.php by phan

        Returning type true but view() is declared to return string
        Open

                    return true;
        Severity: Minor
        Found in include/runtime/Viewer.php by phan

        Avoid excessively long variable names like $intermediateFallBackFileName. Keep variable name length under 20.
        Open

                            $intermediateFallBackFileName = 'modules/' . $fallBackModuleName . '/' . $templateName;
        Severity: Minor
        Found in include/runtime/Viewer.php by phpmd

        LongVariable

        Since: 0.2

        Detects when a field, formal or local variable is declared with a long name.

        Example

        class Something {
            protected $reallyLongIntName = -3; // VIOLATION - Field
            public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                $otherReallyLongName = -5; // VIOLATION - Local
                for ($interestingIntIndex = 0; // VIOLATION - For
                     $interestingIntIndex < 10;
                     $interestingIntIndex++ ) {
                }
            }
        }

        Source https://phpmd.org/rules/naming.html#longvariable

        Each class must be in a namespace of at least one level (a top-level vendor name)
        Open

        class Vtiger_Viewer extends \Smarty
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

        The class Vtiger_Viewer is not named in CamelCase.
        Open

        class Vtiger_Viewer extends \Smarty
        {
            const DEFAULTLAYOUT = 'basic';
            const DEFAULTTHEME = 'twilight';
        
        
        Severity: Minor
        Found in include/runtime/Viewer.php by phpmd

        CamelCaseClassName

        Since: 0.2

        It is considered best practice to use the CamelCase notation to name classes.

        Example

        class class_name {
        }

        Source

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

            public static $completeTemplatePath;
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

            }
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             * Constructor - Sets the templateDir and compileDir for the Smarty files.
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    $file = __DIR__ . '/../../cache/logs/viewer-debug.log';
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    file_put_contents($file, $message . $delimiter, FILE_APPEND);
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

            protected static $debugViewer = false;
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             * log message into the file if in debug mode.
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             * @param type $delimiter
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

            /** @var string Complete template path */
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

            {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                static $file = null;
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

            /**
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             * @param type $message
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                if (null === $file) {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                if (self::$debugViewer) {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

            /**
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             * @param string - $media Layout/Media name
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             */
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                $THISDIR = __DIR__;
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             * @return string - Default Layout Name
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

        Line exceeds 120 characters; contains 123 characters
        Open

                                \App\Cache::save('ViewerTemplatePath', $cacheKey, $intermediateFallBackFileName, \App\Cache::LONG);
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             * @param string $moduleName
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                $templatePath = $this->getTemplatePath($templateName, $moduleName);
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

            public static $currentLayout;
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

            protected static $instance = false;
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                parent::__construct();
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                if (App\Config::performance('LOAD_CUSTOM_FILES')) {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    if (!empty($_POST)) {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

            public static function getLayoutName()
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             */
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

            }
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                if (\App\Cache::has('ViewerTemplatePath', $cacheKey)) {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    if ('AppComponents' === $moduleName && file_exists($templateDir . "components/$templateName")) {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    // Fall back lookup on actual module, in case where parent module doesn't contain actual module within in (directory structure)
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             * @return string html data
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

            {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                        // Determine type of value being pased.
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                        break;
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                            "$baseModuleName/Vtiger",
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                        foreach ($fallBackOrder as $fallBackModuleName) {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                \App\Cache::save('ViewerTemplatePath', $cacheKey, $filePath, \App\Cache::LONG);
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

            }
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             * @param bool   $fetch
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    }
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

            /**
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             * @param string $templateName
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

        Line exceeds 120 characters; contains 129 characters
        Open

                                \App\Cache::save('ViewerCompleteTemplatePath', $cacheKey, self::$completeTemplatePath, \App\Cache::LONG);
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                                \App\Cache::save('ViewerTemplatePath', $cacheKey, $intermediateFallBackFileName, \App\Cache::LONG);
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

            const DEFAULTLAYOUT = 'basic';
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             */
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                $templateDir[] = $THISDIR . '/../../layouts/' . self::$currentLayout;
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    mkdir($compileDir, 0755, true);
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             * Function to get the current layout name.
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                if (!empty(self::$currentLayout)) {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                return self::DEFAULTLAYOUT;
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             * @return string - Module specific template path if exists, otherwise default template path for the given template name
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    self::$completeTemplatePath = \App\Cache::get('ViewerCompleteTemplatePath', $cacheKey);
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    }
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                        $filePath = "modules/$moduleName/$templateName";
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                        break;
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                } else {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                // We need to use {$variable nofilter} to overcome double escaping
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                if (self::$debugViewer && false === $debugViewerURI) {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    $this->log("URI: $debugViewerURI, TYPE: " . \App\Request::_getServer('REQUEST_METHOD'));
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                $moduleName = str_replace(':', '/', $moduleName);
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                        $filePath = "components/$templateName";
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    if (!empty($moduleName) && file_exists(self::$completeTemplatePath)) {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                        $moduleHierarchyParts = explode('/', $moduleName);
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

            /**
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    $templateFound = \App\Cache::get('ViewerTemplateExists', $templatePath);
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

            public function __construct($media = '')
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    $templateDir[] = $THISDIR . '/../../custom/layouts/' . self::$currentLayout;
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                if (App\Config::performance('LOAD_CUSTOM_FILES')) {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                // Escape all {$variable} to overcome XSS
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    } else {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             * @return string - Current layout name if not empty, otherwise Default layout name
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

            {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

        Line exceeds 120 characters; contains 124 characters
        Open

             * @return string - Module specific template path if exists, otherwise default template path for the given template name
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                            "$actualModuleName",
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                            if (file_exists(self::$completeTemplatePath)) {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             * Function to display/fetch the smarty file contents.
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                } else {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

            const DEFAULTTHEME = 'twilight';
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

            protected function log($message, $delimiter = '\n')
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    self::$currentLayout = \App\Layout::getActiveLayout();
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    $templateDir[] = $THISDIR . '/../../custom/layouts/' . self::getDefaultLayoutName();
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                        $debugViewerURI .= '?' . http_build_query($_POST);
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

            }
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    return self::$currentLayout;
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

            public static function getDefaultLayoutName()
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             * Function to get the module specific template path for a given template.
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    self::$completeTemplatePath = $templateDir . "modules/$moduleName/$templateName";
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                            $intermediateFallBackFileName = 'modules/' . $fallBackModuleName . '/' . $templateName;
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                        }
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    $filePath = "modules/Vtiger/$templateName";
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                return $filePath;
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    \App\Cache::save('ViewerTemplateExists', $templatePath, $templateFound, \App\Cache::LONG);
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    $templatePathToLog = $templatePath;
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    if (!empty($moduleName) && 0 !== strpos($templatePath, "modules/$qualifiedModuleName/")) {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                        $valueType = 'literal';
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

            {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    return \App\Cache::get('ViewerTemplatePath', $cacheKey);
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             */
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    if (!empty(App\Config::debug('SMARTY_ERROR_REPORTING'))) {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

            {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                $this->debugging = App\Config::debug('DISPLAY_DEBUG_VIEWER');
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                $compileDir = '';
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    }
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                        ];
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                                \App\Cache::save('ViewerCompleteTemplatePath', $cacheKey, self::$completeTemplatePath, \App\Cache::LONG);
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                        $templatePathToLog = "modules/$qualifiedModuleName/$templateName > $templatePath";
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    foreach ($this->tpl_vars as $key => $smarty_variable) {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                        if (\is_object($smarty_variable->value)) {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    return self::$instance;
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

            // Turn-it on to analyze the data pushed to templates for the request.
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             */
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

            }
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                                return $intermediateFallBackFileName;
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                            }
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

            public function view($templateName, $moduleName = '', $fetch = false)
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    $this->log("VIEW: $templatePathToLog, FOUND: " . ($templateFound ? '1' : '0'));
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                // END
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                if (self::$instance) {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

            }
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                if (!empty($media)) {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                $this->setTemplateDir(array_unique($templateDir));
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

        Line exceeds 120 characters; contains 139 characters
        Open

                    // Fall back lookup on actual module, in case where parent module doesn't contain actual module within in (directory structure)
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                if (self::$debugViewer) {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                        }
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                        $this->log(sprintf('DATA: %s, TYPE: %s', $key, $valueType));
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                return $instance;
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                if (!file_exists($compileDir)) {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    $debugViewerURI = parse_url(\App\Request::_getServer('REQUEST_URI'), PHP_URL_PATH);
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             * Function to return for default layout name.
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

            {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

            public function getTemplatePath($templateName, $moduleName = ''): string
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                $cacheKey = $templateName . $moduleName;
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    if (strpos($moduleName, '/')) {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                            self::$completeTemplatePath = $templateDir . DIRECTORY_SEPARATOR . $intermediateFallBackFileName;
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                \App\Cache::save('ViewerCompleteTemplatePath', $cacheKey, self::$completeTemplatePath, \App\Cache::LONG);
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    }
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                        return $this->fetch($templatePath);
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

            {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                $this->setCompileDir($compileDir);
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                static $debugViewerURI = false;
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             * @param string $moduleName
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                foreach ($this->getTemplateDir() as $templateDir) {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                        $baseModuleName = $moduleHierarchyParts[0];
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                // FOR SECURITY
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                        $fallBackOrder = [
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                        $debugViewerURI = \App\Request::_getServer('REQUEST_URI');
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    }
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    }
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             * @param string $templateName
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                if (\App\Cache::has('ViewerTemplateExists', $templatePath)) {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                return self::getDefaultLayoutName();
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

            /**
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                // Logging
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             */
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    $qualifiedModuleName = str_replace(':', '/', $moduleName);
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                        $actualModuleName = $moduleHierarchyParts[\count($moduleHierarchyParts) - 1];
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    // In case we found a fallback template, log both lookup and target template resolved to.
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                        $this->error_reporting = App\Config::debug('SMARTY_ERROR_REPORTING');
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                $templateDir = [];
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    self::$currentLayout = $media;
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                $compileDir = $THISDIR . '/../../cache/templates_c/' . self::$currentLayout;
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                $templateDir[] = $THISDIR . '/../../layouts/' . self::getDefaultLayoutName();
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                self::$debugViewer = App\Config::debug('DEBUG_VIEWER');
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

            /**
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    $templateFound = $this->templateExists($templatePath);
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                            $valueType = \get_class($smarty_variable->value);
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    }
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                            $valueType = 'array';
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    if ($fetch) {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                if ($templateFound) {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

            }
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

            /**
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    return true;
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             * @param string $media Layout/Media
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             * @return Vtiger_Viewer instance
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    }
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                    $this->display($templatePath);
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                return false;
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                        } elseif (\is_array($smarty_variable->value)) {
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             * Static function to get the Instance of the Class Object.
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

             */
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                self::$instance = $instance;
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

            public static function getInstance($media = '')
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

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

                $instance = new self($media);
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

        Class name "Vtiger_Viewer" is not in camel caps format
        Open

        class Vtiger_Viewer extends \Smarty
        Severity: Minor
        Found in include/runtime/Viewer.php by phpcodesniffer

        The variable $THISDIR is not named in camelCase.
        Open

            public function __construct($media = '')
            {
                parent::__construct();
                $this->debugging = App\Config::debug('DISPLAY_DEBUG_VIEWER');
        
        
        Severity: Minor
        Found in include/runtime/Viewer.php by phpmd

        CamelCaseVariableName

        Since: 0.2

        It is considered best practice to use the camelCase notation to name variables.

        Example

        class ClassName {
            public function doSomething() {
                $data_module = new DataModule();
            }
        }

        Source

        The variable $THISDIR is not named in camelCase.
        Open

            public function __construct($media = '')
            {
                parent::__construct();
                $this->debugging = App\Config::debug('DISPLAY_DEBUG_VIEWER');
        
        
        Severity: Minor
        Found in include/runtime/Viewer.php by phpmd

        CamelCaseVariableName

        Since: 0.2

        It is considered best practice to use the camelCase notation to name variables.

        Example

        class ClassName {
            public function doSomething() {
                $data_module = new DataModule();
            }
        }

        Source

        The variable $smarty_variable is not named in camelCase.
        Open

            public function view($templateName, $moduleName = '', $fetch = false)
            {
                $templatePath = $this->getTemplatePath($templateName, $moduleName);
                if (\App\Cache::has('ViewerTemplateExists', $templatePath)) {
                    $templateFound = \App\Cache::get('ViewerTemplateExists', $templatePath);
        Severity: Minor
        Found in include/runtime/Viewer.php by phpmd

        CamelCaseVariableName

        Since: 0.2

        It is considered best practice to use the camelCase notation to name variables.

        Example

        class ClassName {
            public function doSomething() {
                $data_module = new DataModule();
            }
        }

        Source

        The variable $THISDIR is not named in camelCase.
        Open

            public function __construct($media = '')
            {
                parent::__construct();
                $this->debugging = App\Config::debug('DISPLAY_DEBUG_VIEWER');
        
        
        Severity: Minor
        Found in include/runtime/Viewer.php by phpmd

        CamelCaseVariableName

        Since: 0.2

        It is considered best practice to use the camelCase notation to name variables.

        Example

        class ClassName {
            public function doSomething() {
                $data_module = new DataModule();
            }
        }

        Source

        The variable $THISDIR is not named in camelCase.
        Open

            public function __construct($media = '')
            {
                parent::__construct();
                $this->debugging = App\Config::debug('DISPLAY_DEBUG_VIEWER');
        
        
        Severity: Minor
        Found in include/runtime/Viewer.php by phpmd

        CamelCaseVariableName

        Since: 0.2

        It is considered best practice to use the camelCase notation to name variables.

        Example

        class ClassName {
            public function doSomething() {
                $data_module = new DataModule();
            }
        }

        Source

        The variable $smarty_variable is not named in camelCase.
        Open

            public function view($templateName, $moduleName = '', $fetch = false)
            {
                $templatePath = $this->getTemplatePath($templateName, $moduleName);
                if (\App\Cache::has('ViewerTemplateExists', $templatePath)) {
                    $templateFound = \App\Cache::get('ViewerTemplateExists', $templatePath);
        Severity: Minor
        Found in include/runtime/Viewer.php by phpmd

        CamelCaseVariableName

        Since: 0.2

        It is considered best practice to use the camelCase notation to name variables.

        Example

        class ClassName {
            public function doSomething() {
                $data_module = new DataModule();
            }
        }

        Source

        The variable $THISDIR is not named in camelCase.
        Open

            public function __construct($media = '')
            {
                parent::__construct();
                $this->debugging = App\Config::debug('DISPLAY_DEBUG_VIEWER');
        
        
        Severity: Minor
        Found in include/runtime/Viewer.php by phpmd

        CamelCaseVariableName

        Since: 0.2

        It is considered best practice to use the camelCase notation to name variables.

        Example

        class ClassName {
            public function doSomething() {
                $data_module = new DataModule();
            }
        }

        Source

        The variable $smarty_variable is not named in camelCase.
        Open

            public function view($templateName, $moduleName = '', $fetch = false)
            {
                $templatePath = $this->getTemplatePath($templateName, $moduleName);
                if (\App\Cache::has('ViewerTemplateExists', $templatePath)) {
                    $templateFound = \App\Cache::get('ViewerTemplateExists', $templatePath);
        Severity: Minor
        Found in include/runtime/Viewer.php by phpmd

        CamelCaseVariableName

        Since: 0.2

        It is considered best practice to use the camelCase notation to name variables.

        Example

        class ClassName {
            public function doSomething() {
                $data_module = new DataModule();
            }
        }

        Source

        The variable $smarty_variable is not named in camelCase.
        Open

            public function view($templateName, $moduleName = '', $fetch = false)
            {
                $templatePath = $this->getTemplatePath($templateName, $moduleName);
                if (\App\Cache::has('ViewerTemplateExists', $templatePath)) {
                    $templateFound = \App\Cache::get('ViewerTemplateExists', $templatePath);
        Severity: Minor
        Found in include/runtime/Viewer.php by phpmd

        CamelCaseVariableName

        Since: 0.2

        It is considered best practice to use the camelCase notation to name variables.

        Example

        class ClassName {
            public function doSomething() {
                $data_module = new DataModule();
            }
        }

        Source

        The variable $THISDIR is not named in camelCase.
        Open

            public function __construct($media = '')
            {
                parent::__construct();
                $this->debugging = App\Config::debug('DISPLAY_DEBUG_VIEWER');
        
        
        Severity: Minor
        Found in include/runtime/Viewer.php by phpmd

        CamelCaseVariableName

        Since: 0.2

        It is considered best practice to use the camelCase notation to name variables.

        Example

        class ClassName {
            public function doSomething() {
                $data_module = new DataModule();
            }
        }

        Source

        There are no issues that match your filters.

        Category
        Status