gboudreau/Greyhole

View on GitHub

Showing 334 of 371 total issues

Avoid too many return statements within this method.
Open

                return TRUE;
Severity: Major
Found in includes/Tasks/BalanceTask.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                    return TRUE;
    Severity: Major
    Found in includes/Tasks/BalanceTask.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                          return $new_metafiles;
      Severity: Major
      Found in includes/Tasks/WriteTask.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                return FALSE;
        Severity: Major
        Found in includes/Trash.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return FALSE;
          Severity: Major
          Found in includes/DBSpool.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                    return $result;
            Severity: Major
            Found in includes/DBSpool.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                                  return 1;
              Severity: Major
              Found in includes/SambaSpool.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                            return TRUE;
                Severity: Major
                Found in includes/Tasks/BalanceTask.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                      return 0;
                  Severity: Major
                  Found in includes/SambaSpool.php - About 30 mins to fix

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

                    function getTreemapColor(value, min, max) {
                        value = parseInt(value);
                        min = parseInt(min);
                        max = parseInt(max);
                    
                    
                    Severity: Minor
                    Found in web-app/scripts.js - 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() {
                            echo "\nIs the specified drive still available? ";
                            if (is_dir("$this->drive/.gh_metastore/")) {
                                echo "(It looks like it is.)\n";
                            } else {
                    Severity: Minor
                    Found in includes/CLI/RemoveCliRunner.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 filter_lines_for_section has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private static function filter_lines_for_section($lines, $section) {
                            // Filter to keep only the correct [section]
                            $found_section = FALSE;
                            foreach ($lines as $i => $line) {
                                if (preg_match('/\[(.+)]/', $line, $re)) {
                    Severity: Minor
                    Found in includes/CLI/ConfigCliRunner.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 getFsckParams has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function getFsckParams() {
                        let params = {};
                        let s = $('#id_l2_actions_fsck').find('input, select').serialize();
                        let parsedParams = parseParams(s);
                        for (let name in parsedParams) {
                    Severity: Minor
                    Found in web-app/scripts.js - 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 getFilesystemDetails has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private function getFilesystemDetails($debug_tasks) {
                            $this->log();
                            $this->log("From filesystem");
                            $this->log("===============");
                    
                    
                    Severity: Minor
                    Found in includes/CLI/DebugCliRunner.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 gh_error_handler has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function gh_error_handler($errno, $errstr, $errfile, $errline, $errcontext = NULL) {
                        if(!($errno & error_reporting())) {
                            // Ignored (@) warning
                            return TRUE;
                        }
                    Severity: Minor
                    Found in includes/common.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 __construct has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        function __construct($options, $cli_command) {
                            parent::__construct($options, $cli_command);
                    
                            if (isset($this->options['dir'])) {
                                $this->dir = $this->options['dir'];
                    Severity: Minor
                    Found in includes/CLI/FsckCliRunner.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 changedTab has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function changedTab(el, first, replace) {
                        if (skip_changed_tab_event) {
                            skip_changed_tab_event = false;
                            return;
                        }
                    Severity: Minor
                    Found in web-app/scripts.js - 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 fetch_next_tasks has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function fetch_next_tasks($incl_md5, $update_idle, $include_written = TRUE) {
                            $where_clause = "";
                            if (!empty($this->locked_shares)) {
                                $where_clause .= " AND share NOT IN ('" . implode("','", array_keys($this->locked_shares)) . "')";
                            }
                    Severity: Minor
                    Found in includes/DBSpool.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 getActionCommand has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private function getActionCommand($command_line_options) {
                            foreach ($this->cliCommandsDefinitions as $def) {
                                $param = $def->paramSpecified($command_line_options);
                                if ($param !== FALSE) {
                                    if ($param !== TRUE) {
                    Severity: Minor
                    Found in includes/CLI/CommandLineHelper.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 is_share_sticky has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private static function is_share_sticky($share_name) {
                            $sticky_files = Config::get(CONFIG_STICKY_FILES);
                            if (!empty($sticky_files)) {
                                foreach ($sticky_files as $share_dir => $stick_into) {
                                    if (string_starts_with($share_dir, $share_name)) {
                    Severity: Minor
                    Found in includes/Tasks/BalanceTask.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