YetiForceCompany/YetiForceCRM

View on GitHub
vtlib/Vtiger/LayoutImport.php

Summary

Maintainability
B
6 hrs
Test Coverage
F
0%

Function importLayout has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

    public function importLayout($zipfile)
    {
        $name = $this->_modulexml->name;
        $label = $this->_modulexml->label;
        \App\Log::trace("Importing $name ... STARTED", __METHOD__);
Severity: Minor
Found in vtlib/Vtiger/LayoutImport.php - About 4 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method importLayout has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function importLayout($zipfile)
    {
        $name = $this->_modulexml->name;
        $label = $this->_modulexml->label;
        \App\Log::trace("Importing $name ... STARTED", __METHOD__);
Severity: Minor
Found in vtlib/Vtiger/LayoutImport.php - About 2 hrs to fix

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

        public function importLayout($zipfile)
        {
            $name = $this->_modulexml->name;
            $label = $this->_modulexml->label;
            \App\Log::trace("Importing $name ... STARTED", __METHOD__);
    Severity: Minor
    Found in vtlib/Vtiger/LayoutImport.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 31 to the 15 allowed.
    Open

        public function importLayout($zipfile)
    Severity: Critical
    Found in vtlib/Vtiger/LayoutImport.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 initImport has a boolean flag argument $overwrite, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function initImport($zipfile, $overwrite = true)
    Severity: Minor
    Found in vtlib/Vtiger/LayoutImport.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

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

    Example

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

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

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

        public function import($zipfile, $overwrite = false)
    Severity: Minor
    Found in vtlib/Vtiger/LayoutImport.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

    Remove error control operator '@' on line 108.
    Open

        public function importLayout($zipfile)
        {
            $name = $this->_modulexml->name;
            $label = $this->_modulexml->label;
            \App\Log::trace("Importing $name ... STARTED", __METHOD__);
    Severity: Minor
    Found in vtlib/Vtiger/LayoutImport.php by phpmd

    ErrorControlOperator

    Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

    Example

    function foo($filePath) {
        $file = @fopen($filPath); // hides exceptions
        $key = @$array[$notExistingKey]; // assigns null to $key
    }

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

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

        public function update($instance, $zipfile, $overwrite = true)
    Severity: Minor
    Found in vtlib/Vtiger/LayoutImport.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\Config' in method 'importLayout'.
    Open

            $zip = \App\Zip::openFile($zipfile, ['illegalExtensions' => array_diff(\App\Config::main('upload_badext'), ['js'])]);
    Severity: Minor
    Found in vtlib/Vtiger/LayoutImport.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

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

            \App\Log::trace("Importing $name ... STARTED", __METHOD__);
    Severity: Minor
    Found in vtlib/Vtiger/LayoutImport.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 importLayout uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

                    } else {
                        \App\Log::trace("Copying file $fileName ... SKIPPED", __METHOD__);
                    }
    Severity: Minor
    Found in vtlib/Vtiger/LayoutImport.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\Log' in method 'importLayout'.
    Open

                            \App\Log::trace("Incorrect file $fileName ... SKIPPED", __METHOD__);
    Severity: Minor
    Found in vtlib/Vtiger/LayoutImport.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

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

                                \App\Log::trace("Copying file $fileName ... FAILED", __METHOD__);
    Severity: Minor
    Found in vtlib/Vtiger/LayoutImport.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\Zip' in method 'importLayout'.
    Open

            $zip = \App\Zip::openFile($zipfile, ['illegalExtensions' => array_diff(\App\Config::main('upload_badext'), ['js'])]);
    Severity: Minor
    Found in vtlib/Vtiger/LayoutImport.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 importLayout uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

                        } else {
                            \App\Log::trace("Incorrect file $fileName ... SKIPPED", __METHOD__);
                        }
    Severity: Minor
    Found in vtlib/Vtiger/LayoutImport.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\Log' in method 'importLayout'.
    Open

            \App\Log::trace("Importing $name($label) ... DONE", __METHOD__);
    Severity: Minor
    Found in vtlib/Vtiger/LayoutImport.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 importLayout uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

                            } else {
                                \App\Log::trace("Copying file $fileName ... FAILED", __METHOD__);
                            }
    Severity: Minor
    Found in vtlib/Vtiger/LayoutImport.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\Log' in method 'importLayout'.
    Open

                                \App\Log::trace("Copying file $fileName ... DONE", __METHOD__);
    Severity: Minor
    Found in vtlib/Vtiger/LayoutImport.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

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

                        \App\Log::trace("Copying file $fileName ... SKIPPED", __METHOD__);
    Severity: Minor
    Found in vtlib/Vtiger/LayoutImport.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 unused parameters such as '$overwrite'.
    Open

        public function initImport($zipfile, $overwrite = true)
    Severity: Minor
    Found in vtlib/Vtiger/LayoutImport.php by phpmd

    UnusedFormalParameter

    Since: 0.2

    Avoid passing parameters to methods or constructors and then not using those parameters.

    Example

    class Foo
    {
        private function bar($howdy)
        {
            // $howdy is not used
        }
    }

    Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

    Avoid unused parameters such as '$instance'.
    Open

        public function update($instance, $zipfile, $overwrite = true)
    Severity: Minor
    Found in vtlib/Vtiger/LayoutImport.php by phpmd

    UnusedFormalParameter

    Since: 0.2

    Avoid passing parameters to methods or constructors and then not using those parameters.

    Example

    class Foo
    {
        private function bar($howdy)
        {
            // $howdy is not used
        }
    }

    Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

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

                        \App\Log::trace("Copying file $fileName ... SKIPPED", __METHOD__);
    Severity: Critical
    Found in vtlib/Vtiger/LayoutImport.php by phan

    Unused property
    Open

            $this->_export_tmpdir;
    Severity: Info
    Found in vtlib/Vtiger/LayoutImport.php by phan

    Saw possibly unextractable annotation for a fragment of comment '* @param string Zip file name': after string, did not see an element name (will guess based on comment order)
    Open

         * @param string Zip file name
    Severity: Info
    Found in vtlib/Vtiger/LayoutImport.php by phan

    Saw possibly unextractable annotation for a fragment of comment '* @param bool True for overwriting existing module': after bool, did not see an element name (will guess based on comment order)
    Open

         * @param bool True for overwriting existing module
    Severity: Info
    Found in vtlib/Vtiger/LayoutImport.php by phan

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

            \App\Log::trace("Importing $name ... STARTED", __METHOD__);
    Severity: Critical
    Found in vtlib/Vtiger/LayoutImport.php by phan

    Saw possibly unextractable annotation for a fragment of comment '* @param bool True for overwriting existing module': after bool, did not see an element name (will guess based on comment order)
    Open

         * @param bool True for overwriting existing module
    Severity: Info
    Found in vtlib/Vtiger/LayoutImport.php by phan

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

                                \App\Log::trace("Copying file $fileName ... FAILED", __METHOD__);
    Severity: Critical
    Found in vtlib/Vtiger/LayoutImport.php by phan

    Saw possibly unextractable annotation for a fragment of comment '* @param string Zip file name': after string, did not see an element name (will guess based on comment order)
    Open

         * @param string Zip file name
    Severity: Info
    Found in vtlib/Vtiger/LayoutImport.php by phan

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

            \App\Log::trace("Importing $name($label) ... DONE", __METHOD__);
    Severity: Critical
    Found in vtlib/Vtiger/LayoutImport.php by phan

    Saw possibly unextractable annotation for a fragment of comment '* @param object Instance of Layout': after object, did not see an element name (will guess based on comment order)
    Open

         * @param object Instance of Layout
    Severity: Info
    Found in vtlib/Vtiger/LayoutImport.php by phan

    Call to undeclared method \App\Zip::checkFile
    Open

                        if (!$zip->checkFile($fileName)) {
    Severity: Critical
    Found in vtlib/Vtiger/LayoutImport.php by phan

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

                                \App\Log::trace("Copying file $fileName ... DONE", __METHOD__);
    Severity: Critical
    Found in vtlib/Vtiger/LayoutImport.php by phan

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

                            \App\Log::trace("Incorrect file $fileName ... SKIPPED", __METHOD__);
    Severity: Critical
    Found in vtlib/Vtiger/LayoutImport.php by phan

    This branch's code block is the same as the block for the branch on line 96.
    Open

                    elseif (0 === stripos($targetdir, "layouts/$name/libraries")) {
                        $vtiger6format = true;
                        $dounzip = true;
                    }
    Severity: Major
    Found in vtlib/Vtiger/LayoutImport.php by sonar-php

    Having two cases in a switch statement or two branches in an if chain with the same implementation is at best duplicate code, and at worst a coding error. If the same logic is truly needed for both instances, then in an if chain they should be combined, or for a switch, one should fall through to the other.

    Noncompliant Code Example

    switch ($i) {
      case 1:
        doSomething();
        break;
      case 2:
        doSomethingDifferent();
        break;
      case 3:  // Noncompliant; duplicates case 1's implementation
        doSomething();
        break;
      default:
        doTheRest();
    }
    
    if ($a >= 0 && $a < 10) {
      doTheThing();
    else if ($a >= 10 && $a < 20) {
      doTheOtherThing();
    }
    else if ($a >= 20 && $a < 50) {
      doTheThing();  // Noncompliant; duplicates first condition
    }
    else {
      doTheRest();
    }
    
    if ($b == 0) {
      doOneMoreThing();
    }
    else {
      doOneMoreThing(); // Noncompliant; duplicates then-branch
    }
    
    var b = a ? 12 > 4 : 4;  // Noncompliant; always results in the same value
    

    Compliant Solution

    switch ($i) {
      case 1:
      case 3:
        doSomething();
        break;
      case 2:
        doSomethingDifferent();
        break;
      default:
        doTheRest();
    }
    
    if (($a >= 0 && $a < 10) || ($a >= 20 && $a < 50)) {
      doTheThing();
    else if ($a >= 10 && $a < 20) {
      doTheOtherThing();
    }
    else {
      doTheRest();
    }
    
    doOneMoreThing();
    
    b = 4;
    

    or

    switch ($i) {
      case 1:
        doSomething();
        break;
      case 2:
        doSomethingDifferent();
        break;
      case 3:
        doThirdThing();
        break;
      default:
        doTheRest();
    }
    
    if ($a >= 0 && $a < 10) {
      doTheThing();
    else if ($a >= 10 && $a < 20) {
      doTheOtherThing();
    }
    else if ($a >= 20 && $a < 50) {
      doTheThirdThing();
    }
    else {
      doTheRest();
    }
    
    if ($b == 0) {
      doOneMoreThing();
    }
    else {
      doTheRest();
    }
    
    int b = a ? 12 > 4 : 8;
    

    Exceptions

    Blocks in an if chain that contain a single line of code are ignored, as are blocks in a switch statement that contain a single line of code with or without a following break.

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

         * @param bool True for overwriting existing module

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

         */

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

            $this->importLayout($zipfile);

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

         * @param bool True for overwriting existing module

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

         * @param mixed $zipfile

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

                    $targetfile = basename($fileName);

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

        public function __construct()

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

         * Import Layout.

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

                    $targetdir = substr($fileName, 0, strripos($fileName, '/'));

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

            $this->_export_tmpdir;

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

         * @param mixed $zipfile

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

            // Call module import function

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

         * Update Layout from zip file.

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

                    }

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

        /**

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

         */

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

                    } // vtiger6 format

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

                        $dounzip = true;

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

        /**

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

        {

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

         * @param string Zip file name

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

            $this->initImport($zipfile, $overwrite);

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

        {

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

         */

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

                        $vtiger6format = true;

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

         */

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

            parent::__construct();

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

         * @param mixed $overwrite

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

            return $this->getModuleNameFromZip($zipfile);

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

        }

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

         *

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

        }

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

                $fileName = $zip->getNameIndex($i);

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

                    elseif (0 === stripos($targetdir, "layouts/$name/libraries")) {

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

                        $vtiger6format = true;

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

                            @mkdir($targetdir, 0755, true);

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

                $zip->close();

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

        /**

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

         */

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

         *

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

                            if (false !== $zip->unzipFile($fileName, "$targetdir/$targetfile")) {

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

         * @param mixed $instance

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

        public function update($instance, $zipfile, $overwrite = true)

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

         *

    Line exceeds 120 characters; contains 125 characters
    Open

            $zip = \App\Zip::openFile($zipfile, ['illegalExtensions' => array_diff(\App\Config::main('upload_badext'), ['js'])]);

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

                if (!$zip->isdir($fileName)) {

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

            self::register($name, $label);

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

         * Initialize Import.

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

        public function initImport($zipfile, $overwrite = true)

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

         * Import Module from zip file.

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

         * @param string Zip file name

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

            $this->import($zipfile, $overwrite);

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

            $vtiger6format = false;

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

            for ($i = 0; $i < $zip->numFiles; ++$i) {

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

                    if (false === strpos($fileName, '/')) {

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

                    if ($dounzip) {

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

                            } else {

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

                            }

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

         * @param mixed $zipfile

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

        public function importLayout($zipfile)

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

            $name = $this->_modulexml->name;

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

            \App\Log::trace("Importing $name ... STARTED", __METHOD__);

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

        }

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

        public function import($zipfile, $overwrite = false)

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

            $label = $this->_modulexml->label;

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

            $zip = \App\Zip::openFile($zipfile, ['illegalExtensions' => array_diff(\App\Config::main('upload_badext'), ['js'])]);

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

                        $dounzip = true;

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

                    } //case handling for the  special library files

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

                    }

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

                            $targetdir = "layouts/$name/" . str_replace("layouts/$name", '', $targetdir);

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

                        if (!$zip->checkFile($fileName)) {

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

                }

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

            }

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

        {

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

        {

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

                    $dounzip = false;

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

                        $vtiger6format = true;

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

                    }

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

                                \App\Log::trace("Copying file $fileName ... DONE", __METHOD__);

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

         *

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

        }

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

         * Constructor.

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

         * @param mixed $overwrite

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

         * @param object Instance of Layout

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

                    // Case handling for jscalendar

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

         * @param mixed $overwrite

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

                        }

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

                                \App\Log::trace("Copying file $fileName ... FAILED", __METHOD__);

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

        /**

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

                        continue;

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

                        $dounzip = true;

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

                    elseif (0 === stripos($targetdir, "layouts/$name/modules")) {

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

                        if ($vtiger6format) {

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

            }

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

                    } else {

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

            if ($zip) {

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

                        } else {

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

                            \App\Log::trace("Incorrect file $fileName ... SKIPPED", __METHOD__);

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

                        }

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

        }

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

        /**

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

         * @param mixed $zipfile

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

        {

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

                    if (0 === stripos($targetdir, "layouts/$name/skins")) {

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

                        // vtiger6 format

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

            \App\Log::trace("Importing $name($label) ... DONE", __METHOD__);

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

                        \App\Log::trace("Copying file $fileName ... SKIPPED", __METHOD__);

    There are no issues that match your filters.

    Category
    Status