mambax7/pedigree

View on GitHub

Showing 1,100 of 1,100 total issues

Avoid too many return statements within this method.
Open

                return (int)($version1 == $version2);
Severity: Major
Found in phpthumb/phpthumb.functions.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

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

      Avoid too many return statements within this method.
      Open

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

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

                        if (is_array($getimagesize)) {
                            $this->DebugMessage('getimagesize(' . $this->sourceFilename . ') SUCCEEDED: ' . print_r($getimagesize, true), __FILE__, __LINE__);
                        } else {
                            $this->DebugMessage('getimagesize(' . $this->sourceFilename . ') FAILED with error "' . $GetImageSizeError . '"', __FILE__, __LINE__);
                        }
        Severity: Minor
        Found in 0old/phpthumb/phpthumb.class.php and 1 other location - About 30 mins to fix
        phpthumb/phpthumb.class.php on lines 1702..1706

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 90.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

                        if (is_array($getimagesize)) {
                            $this->DebugMessage('getimagesize(' . $this->sourceFilename . ') SUCCEEDED: ' . print_r($getimagesize, true), __FILE__, __LINE__);
                        } else {
                            $this->DebugMessage('getimagesize(' . $this->sourceFilename . ') FAILED with error "' . $GetImageSizeError . '"', __FILE__, __LINE__);
                        }
        Severity: Minor
        Found in phpthumb/phpthumb.class.php and 1 other location - About 30 mins to fix
        0old/phpthumb/phpthumb.class.php on lines 1819..1823

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 90.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Avoid too many return statements within this method.
        Open

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

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

          function lettersChoice()
          {
              $helper = Helper::getInstance();
              $helper->loadLanguage('main');
              xoops_load('XoopsLocal');
          Severity: Minor
          Found in include/functions.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 loadSampleData has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          function loadSampleData()
          {
              global $xoopsConfig;
              $moduleDirName      = \basename(\dirname(__DIR__));
              $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
          Severity: Minor
          Found in testdata/index.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 pedigree_search has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          function pedigree_search($queryarray, $andor, $limit, $offset, $userid)
          {
              global $xoopsDB;
          
              // Start creating a sql string that will be used to retrieve the fields in the table
          Severity: Minor
          Found in include/search.inc.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 pedigree_fields_post has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          function pedigree_fields_post()
          {
              $config_fields = pedigree_get_config_fields();
              foreach ($config_fields as $field => $prompt) {
                  $param = 'param_' . $field;
          Severity: Minor
          Found in admin/fields.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 breederof has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          function breederof($oid, $breeder)
          {
              $content = '';
          
              if (0 == $breeder) {
          Severity: Minor
          Found in include/functions.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 count_all has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          function count_all($ind, $gen)
          {
              global $inds, $nb_gen, $nb_all, $fathers, $mothers;
              if ($ind) {
                  ++$nb_all;
          Severity: Minor
          Found in coi.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 TCGenerateWind has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          function TCGenerateWind() {
              var s = '';
              for (j = 0; j < 12; j++) {
                  s += "<tr>";
                  for (k = 0; k < 3; k++)
          Severity: Minor
          Found in assets/js/picker.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 uploadPicture has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          function uploadPicture($num)
          {
              $max_imgsize       = $GLOBALS['xoopsModuleConfig']['maxfilesize']; //1024000;
              $max_imgwidth      = $GLOBALS['xoopsModuleConfig']['maximgwidth']; //1500;
              $max_imgheight     = $GLOBALS['xoopsModuleConfig']['maximgheight']; //1000;
          Severity: Minor
          Found in include/functions.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 xoops_module_pre_install_pedigree has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          function xoops_module_pre_install_pedigree(\XoopsModule $module)
          {
              //check for minimum XOOPS version
              $xoopsSuccess = Utility::checkVerXoops($module);
          
          
          Severity: Minor
          Found in include/oninstall.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 TCGenerateSafe has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          function TCGenerateSafe() {
              var s = '';
              for (j = 0; j < 12; j++) {
                  s += "<tr>";
                  for (k = 0; k < 3; k++)
          Severity: Minor
          Found in assets/js/picker.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 SKETCH_PEDIGREE has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          function SKETCH_PEDIGREE()
          {
              global $nl, $detail, $depth, $IDs;
              // print_r ($IDs) ;
              echo $nl
          Severity: Minor
          Found in coi.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 prepareSearch has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public function prepareSearch()
              {
                  if (0 == !$this->getValue('field')) {
                      // field already exists (editing mode)
          
          
          Severity: Minor
          Found in class/CheckoutWizard.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 convertIPAddresses has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              private function convertIPAddresses(string $tableName, string $columnName): void
              {
                  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

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

              public function phpThumbDebugVarDump($var)
              {
                  if (null === $var) {
                      return 'NULL';
                  } elseif (is_bool($var)) {
          Severity: Minor
          Found in 0old/phpthumb/phpthumb.class.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