mambax7/groupmanager

View on GitHub

Showing 31 of 33 total issues

Function rcopy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function rcopy($src, $dest)
    {
        // Only continue if user is a 'global' Admin
        if (!($GLOBALS['xoopsUser'] instanceof XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
            return false;
Severity: Minor
Found in class/Common/FilesManagement.php - About 55 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 recurseCopy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function recurseCopy($src, $dst)
    {
        $dir = \opendir($src);
        //        @mkdir($dst);
        if (!@\mkdir($dst) && !\is_dir($dst)) {
Severity: Minor
Found in class/Common/FilesManagement.php - About 55 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 getFileStatus has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getFileStatus($file_path, $original_file_path, $redirectFile)
    {
        global $pathIcon16;

        if (empty($file_path)) {
Severity: Minor
Found in class/Common/FileChecker.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 truncateHtml has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
Severity: Minor
Found in class/Common/SysUtility.php - About 35 mins to fix

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

        public static function getEditor($helper = null, $options = null)
        {
            /** @var Helper $helper */
            if (null === $options) {
                $options           = [];
    Severity: Minor
    Found in class/Common/SysUtility.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 getDirectoryStatus has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function getDirectoryStatus($path, $mode = 0777, $redirectFile = null)
        {
            global $pathIcon16;
    
            if (empty($path)) {
    Severity: Minor
    Found in class/Common/DirectoryChecker.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

    Avoid too many return statements within this method.
    Open

            return true;
    Severity: Major
    Found in class/Common/Resizer.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                  return false;
      Severity: Major
      Found in class/Common/Resizer.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                            return false;
        Severity: Major
        Found in class/Common/Resizer.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return true;
          Severity: Major
          Found in class/Common/Resizer.php - About 30 mins to fix

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

                private function convertIPAddresses($tableName, $columnName)
                {
                    if ($this->tableHandler->useTable($tableName)) {
                        $attributes = $this->tableHandler->getColumnAttributes($tableName, $columnName);
                        if (false !== mb_strpos($attributes, ' int(')) {
            Severity: Minor
            Found in class/Common/Migrate.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