Kanti/htmly-installer

View on GitHub

Showing 9 of 765 total issues

Method printHeader has 170 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function printHeader($version = null)
    {
        if (true) : ?>
            <!DOCTYPE html>
            <html>
Severity: Major
Found in src/HeaderTemplate.php - About 6 hrs to fix

    Method printForm has 69 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function printForm()
        {
            if (true) : ?>
                <form method="POST">
                    <label for="user_name">Username:<span class="required">*</span></label>
    Severity: Major
    Found in src/FormTemplate.php - About 2 hrs to fix

      Method htaccess has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function htaccess()
          {
              return <<<EOT
      # Don't show directory listings for URLs which map to a directory.
      Options -Indexes
      Severity: Minor
      Found in src/GetHtaccess.php - About 1 hr to fix

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

            protected function saveConfigs()
            {
                $this->extractUser();
                //save config.ini
                $config = array(
        Severity: Minor
        Found in src/Settings.php - About 1 hr to fix

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

              protected function convertRequestToConfig()
              {
                  $array = array();
                  foreach ($_REQUEST as $name => $value) {
                      if (!is_string($value) || empty($value)) {
          Severity: Minor
          Found in src/Settings.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

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

              public function addDirToPhar($dirName)
              {
                  $dirName = rtrim($dirName, "/") . "/";
                  foreach (scandir($dirName) as $key => $value) {
                      if (!in_array($value, array(".", ".."))) {
          Severity: Minor
          Found in backer.php - About 35 mins to fix

          Cognitive Complexity

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

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

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

          Further reading

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

              public static function isWritable($path)
              {
                  //will work in despite of Windows ACLs bug
                  //NOTE: use a trailing slash for folders!!!
                  //see http://bugs.php.net/bug.php?id=27609
          Severity: Minor
          Found in src/StaticFunctions.php - About 25 mins to fix

          Cognitive Complexity

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

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

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

          Further reading

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

              public function run()
              {
                  $string = "";
                  if (!empty($this->errors)) {
                      foreach ($this->errors as $error) {
          Severity: Minor
          Found in src/Messages.php - About 25 mins to fix

          Cognitive Complexity

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

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

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

          Further reading

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

              protected function testTheEnvironment()
              {
                  $messages = new Messages;
          
                  if (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 50300) {
          Severity: Minor
          Found in src/Settings.php - About 25 mins to fix

          Cognitive Complexity

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

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

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

          Further reading

          Severity
          Category
          Status
          Source
          Language