mambax7/publisher

View on GitHub
class/Common/Confirm.php

Summary

Maintainability
A
1 hr
Test Coverage

Method getFormConfirm has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getFormConfirm(): \XoopsThemeForm
    {
        $moduleDirName      = \basename(__DIR__);
        $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
        //in order to be accessable from user and admin area this should be place in language common.php
Severity: Minor
Found in class/Common/Confirm.php - About 1 hr to fix

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

        public function __construct(array $hiddens, string $action, string $object, string $title = '', string $label = '')
    Severity: Minor
    Found in class/Common/Confirm.php - About 35 mins to fix

      Missing class import via use statement (line '102', column '27').
      Open

              $buttonTray = new \XoopsFormElementTray('');
      Severity: Minor
      Found in class/Common/Confirm.php by phpmd

      MissingImport

      Since: 2.7.0

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

      Example

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

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

      Missing class import via use statement (line '96', column '31').
      Open

              $form->addElement(new \XoopsFormLabel($this->label, $this->object));
      Severity: Minor
      Found in class/Common/Confirm.php by phpmd

      MissingImport

      Since: 2.7.0

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

      Example

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

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

      Missing class import via use statement (line '103', column '37').
      Open

              $buttonTray->addElement(new \XoopsFormButton('', 'confirm_submit', \_YES, 'submit'));
      Severity: Minor
      Found in class/Common/Confirm.php by phpmd

      MissingImport

      Since: 2.7.0

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

      Example

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

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

      Missing class import via use statement (line '104', column '27').
      Open

              $buttonBack = new \XoopsFormButton('', 'confirm_back', \_NO, 'button');
      Severity: Minor
      Found in class/Common/Confirm.php by phpmd

      MissingImport

      Since: 2.7.0

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

      Example

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

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

      Missing class import via use statement (line '99', column '35').
      Open

                  $form->addElement(new \XoopsFormHidden($key, $value));
      Severity: Minor
      Found in class/Common/Confirm.php by phpmd

      MissingImport

      Since: 2.7.0

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

      Example

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

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

      Missing class import via use statement (line '94', column '21').
      Open

              $form = new \XoopsThemeForm($this->title, 'formConfirm', $this->action, 'post', true);
      Severity: Minor
      Found in class/Common/Confirm.php by phpmd

      MissingImport

      Since: 2.7.0

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

      Example

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

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

      Missing class import via use statement (line '101', column '31').
      Open

              $form->addElement(new \XoopsFormHidden('ok', 1));
      Severity: Minor
      Found in class/Common/Confirm.php by phpmd

      MissingImport

      Since: 2.7.0

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

      Example

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

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

      Avoid using static access to class '\Xmf\Request' in method 'getFormConfirm'.
      Open

                  $this->action = \Xmf\Request::getString('REQUEST_URI', '', 'SERVER');
      Severity: Minor
      Found in class/Common/Confirm.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

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

      <?php
      Severity: Minor
      Found in class/Common/Confirm.php by phpcodesniffer

      There are no issues that match your filters.

      Category
      Status