mambax7/pedigree

View on GitHub

Showing 702 of 1,100 total issues

Function rrmdir has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function rrmdir(string $src): bool
    {
        // 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 1 hr 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 FixedAspectRatio has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function FixedAspectRatio()
    {
        // optional fixed-dimension images (regardless of aspect ratio)

        if (!$this->far) {
Severity: Minor
Found in 0old/phpthumb/phpthumb.class.php - About 1 hr 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 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct($target)
    {
        //  global $helper;
        $this->helper       = $target->helper;
        $this->targetObject = $target;
Severity: Minor
Found in class/Form/TreeForm.php - About 1 hr 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 RenderToFile has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function RenderToFile($filename)
    {
        if (preg_match('#^[a-z0-9]+://#i', $filename)) {
            $this->DebugMessage('RenderToFile() failed because $filename (' . $filename . ') is a URL', __FILE__, __LINE__);

Severity: Minor
Found in 0old/phpthumb/phpthumb.class.php - About 1 hr 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 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct($target)
    {
        //  global $helper;
        $this->helper       = $target->helper;
        $this->targetObject = $target;
Severity: Minor
Found in class/Form/RegistryForm.php - About 1 hr 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 ImageResizeFunction has 10 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function ImageResizeFunction(&$dst_im, &$src_im, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH)
Severity: Major
Found in 0old/phpthumb/phpthumb.class.php - About 1 hr to fix

    Function load has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        public function load($data, &$datLen)
        {
            $datLen = 0;
    
            while (true) {
    Severity: Minor
    Found in phpthumb/phpthumb.gif.php - About 1 hr 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 listuserfields has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    function listuserfields()
    {
        $sql     = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_fields') . " WHERE isActive = '1' ORDER BY `order`";
        $result  = $GLOBALS['xoopsDB']->query($sql);
        $numrows = $GLOBALS['xoopsDB']->getRowsNum($result);
    Severity: Minor
    Found in tools.php - About 1 hr 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 ImageResizeFunction has 10 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function ImageResizeFunction(&$dst_im, &$src_im, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH)
    Severity: Major
    Found in phpthumb/phpthumb.class.php - About 1 hr to fix

      Function RenderToFile has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public function RenderToFile($filename)
          {
              if (preg_match('#^[a-z0-9]+://#i', $filename)) {
                  $this->DebugMessage('RenderToFile() failed because $filename (' . $filename . ') is a URL', __FILE__, __LINE__);
                  return false;
      Severity: Minor
      Found in phpthumb/phpthumb.class.php - About 1 hr 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 FixedAspectRatio has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public function FixedAspectRatio()
          {
              // optional fixed-dimension images (regardless of aspect ratio)
      
              if (!$this->far) {
      Severity: Minor
      Found in phpthumb/phpthumb.class.php - About 1 hr 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 Brightness has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public function Brightness(&$gdimg, $amount = 0)
          {
              if ($amount == 0) {
                  return true;
              }
      Severity: Minor
      Found in phpthumb/phpthumb.filters.php - About 1 hr 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 ImageCopyResampleBicubic has 10 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public static function ImageCopyResampleBicubic($dst_img, $src_img, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h)
      Severity: Major
      Found in phpthumb/phpthumb.functions.php - About 1 hr to fix

        Function SafeExec has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function SafeExec($command)
            {
                static $AllowedExecFunctions = [];
                if (empty($AllowedExecFunctions)) {
                    $AllowedExecFunctions = ['shell_exec' => true, 'passthru' => true, 'system' => true, 'exec' => true];
        Severity: Minor
        Found in phpthumb/phpthumb.functions.php - About 1 hr 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 dist_m has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function dist_m($m)
        {
            global $IDs, $fathers, $mothers, $mater, $nb_gen, $detail, $nl;
            // Anim #M is the dam
            $listall   = [$m];
        Severity: Minor
        Found in coi.php - About 1 hr to fix

          Method database_oa has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function database_oa()
          {
              global $xoopsTpl;
              $form   = _AM_PEDIGREE_DATABASE_CHECK_ANCESTORS;
              $sql    = 'SELECT d.id AS d_id, d.pname AS d_pname
          Severity: Minor
          Found in admin/tools.php - About 1 hr to fix

            Method dist_p has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function dist_p($p)
            {
                global $IDs, $fathers, $mothers, $pater, $nb_gen, $detail, $nl;
                // Anim #P is the sire
                $listall   = [$p];
            Severity: Minor
            Found in coi.php - About 1 hr to fix

              Function magnificPopup has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              $.fn.magnificPopup = function(options) {
                  _checkInstance();
              
                  var jqEl = $(this);
              
              
              Severity: Minor
              Found in assets/js/jquery.magnific-popup.js - About 1 hr to fix

                Method CONSANG has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function CONSANG($a)
                {
                    global $fathers, $mothers, $ICknown, $COIs, $nl;
                    if (!$a || $ICknown[$a]) {
                        return 0;
                Severity: Minor
                Found in coi.php - About 1 hr to fix

                  Method ImageCropAuto has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function ImageCropAuto()
                      {
                          // ImageCropAuto
                          if (!is_null($this->ica)) {
                              $this->DebugMessage('ImageCropAuto(' . $this->ica . ') starting', __FILE__, __LINE__);
                  Severity: Minor
                  Found in phpthumb/phpthumb.class.php - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language