XoopsModules25x/smallworld

View on GitHub
class/Form.php

Summary

Maintainability
C
1 day
Test Coverage

Method job has 10 arguments (exceeds 4 allowed). Consider refactoring.
Open

        $class,
        $name,
        $name2,
        $rel,
        $textmore,
Severity: Major
Found in class/Form.php - About 1 hr to fix

    Method school_add has 10 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            $class,
            $name,
            $name2,
            $rel,
            array $options,
    Severity: Major
    Found in class/Form.php - About 1 hr to fix

      Method usersettings has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function usersettings($userid)
          {
              $form = "<div style='display:none'><div class='smallworld_usersetings'>";
              $form .= '<fieldset><legend>' . _SMALLWORLD_SHOWIFPUBLICORPRIVATE . '</legend>';
              $form .= "<form id='perset'>";
      Severity: Minor
      Found in class/Form.php - About 1 hr to fix

        Method dropdown_add has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function dropdown_add($class, $name, $name2, $rel, array $options, $textmore, $selected = null, $preset = null)
        Severity: Major
        Found in class/Form.php - About 1 hr to fix

          Method input_add has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function input_add($class, $name, $name2, $rel, $size, $textmore, $preset = null, $id = null)
          Severity: Major
          Found in class/Form.php - About 1 hr to fix

            Method textarea has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public function textarea($name, $id, $title, $rows, $cols, $class, $preset = null)
            Severity: Major
            Found in class/Form.php - About 50 mins to fix

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

                  public function usersettings($userid)
                  {
                      $form = "<div style='display:none'><div class='smallworld_usersetings'>";
                      $form .= '<fieldset><legend>' . _SMALLWORLD_SHOWIFPUBLICORPRIVATE . '</legend>';
                      $form .= "<form id='perset'>";
              Severity: Minor
              Found in class/Form.php - About 45 mins to fix

              Cognitive Complexity

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

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

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

              Further reading

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

                  public function input($name, $id, $class, $size = null, $preset = null)
              Severity: Minor
              Found in class/Form.php - About 35 mins to fix

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

                    public function retrieveRadio($name, $options, $valuearray, $selected = null, $sep = '<br>')
                Severity: Minor
                Found in class/Form.php - About 35 mins to fix

                  There are no issues that match your filters.

                  Category
                  Status