mambax7/pedigree

View on GitHub

Showing 702 of 1,100 total issues

Method uploadPicture has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function uploadPicture($num)
    {
        require_once $GLOBALS['xoops']->path('class/uploader.php');

        $num = (int)$num;
Severity: Minor
Found in class/Utility.php - About 1 hr to fix

    Method PlotPixelsGD has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function PlotPixelsGD(&$BMPdata, $truecolor = true)
        {
            $imagewidth  = $BMPdata['header']['raw']['width'];
            $imageheight = $BMPdata['header']['raw']['height'];
    
    
    Severity: Minor
    Found in phpthumb/phpthumb.bmp.php - About 1 hr to fix

      Method Colorize has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function Colorize(&$gdimg, $amount, $targetColor)
          {
              $amount      = (is_numeric($amount) ? $amount : 25);
              $amountPct   = $amount / 100;
              $targetColor = (phpthumb_functions::IsHexColor($targetColor) ? $targetColor : 'gray');
      Severity: Minor
      Found in phpthumb/phpthumb.filters.php - About 1 hr to fix

        Method Sepia has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function Sepia(&$gdimg, $amount, $targetColor)
            {
                $amount      = (is_numeric($amount) ? max(0, min(100, $amount)) : 50);
                $amountPct   = $amount / 100;
                $targetColor = (phpthumb_functions::IsHexColor($targetColor) ? $targetColor : 'A28065');
        Severity: Minor
        Found in phpthumb/phpthumb.filters.php - About 1 hr to fix

          Method cloneBlock has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function cloneBlock($bid)
              {
                  require_once __DIR__ . '/admin_header.php';
                  //require_once __DIR__ . '/admin_header.php';
                  xoops_cp_header();
          Severity: Minor
          Found in admin/blocksadmin.php - About 1 hr to fix

            Method EnsureDirectoryExists has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function EnsureDirectoryExists($dirname, $mask = 0755)
                {
                    // https://www.php.net/manual/en/ini.core.php#ini.open-basedir says:
                    // "Under Windows, separate the directories with a semicolon. On all other systems, separate the directories with a colon."
                    $config_open_basedir = ini_get('open_basedir');
            Severity: Minor
            Found in phpthumb/phpthumb.functions.php - About 1 hr to fix

              Method ApplyMask has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function ApplyMask(&$gdimg_mask, &$gdimg_image)
                  {
                      if (phpthumb_functions::gd_version() < 2) {
                          $this->DebugMessage('Skipping ApplyMask() because gd_version is "' . phpthumb_functions::gd_version() . '"', __FILE__, __LINE__);
                          return false;
              Severity: Minor
              Found in phpthumb/phpthumb.filters.php - About 1 hr to fix

                Method editBlock has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function editBlock($bid)
                    {
                        require_once __DIR__ . '/admin_header.php';
                        //require_once __DIR__ . '/admin_header.php';
                        xoops_cp_header();
                Severity: Minor
                Found in admin/blocksadmin.php - About 1 hr to fix

                  Function _close has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      _close: function() {
                          _mfpTrigger(CLOSE_EVENT);
                  
                          var classesToRemove = REMOVING_CLASS + ' ' + READY_CLASS + ' ';
                  
                  
                  Severity: Minor
                  Found in assets/js/jquery.magnific-popup.js - About 1 hr to fix

                    Method applyPathSegment has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function applyPathSegment(&$segments, $segment)
                        {
                            if ('.' === $segment) {
                                return; // always remove
                            }
                    Severity: Minor
                    Found in 0old/phpthumb/phpthumb.class.php - About 1 hr to fix

                      Method __construct has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function __construct($target)
                          {
                              //  global $helper;
                              $this->helper       = $target->helper;
                              $this->targetObject = $target;
                      Severity: Minor
                      Found in class/Form/FieldsForm.php - About 1 hr to fix

                        Method prepareSettings has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function prepareSettings()
                            {
                                if (0 == !$this->getValue('field')) {
                                    // field already exists (editing mode)
                        
                        
                        Severity: Minor
                        Found in class/CheckoutWizard.php - About 1 hr to fix

                          Method GetCode has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function GetCode(&$data, $bInit)
                              {
                                  if ($bInit) {
                                      $this->CurBit   = 0;
                                      $this->LastBit  = 0;
                          Severity: Minor
                          Found in phpthumb/phpthumb.gif.php - About 1 hr to fix

                            Method applyPathSegment has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function applyPathSegment(&$segments, $segment)
                                {
                                    if ($segment == '.') {
                                        return; // always remove
                                    }
                            Severity: Minor
                            Found in phpthumb/phpthumb.class.php - About 1 hr to fix

                              Function xoops_module_install_pedigree has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function xoops_module_install_pedigree(\XoopsModule $module)
                              {
                                  $helper        = Helper::getInstance();
                                  $moduleDirName = $helper->getDirname();
                                  $configurator  = new Configurator();
                              Severity: Minor
                              Found in include/oninstall.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 mater_side has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function mater_side($p, $m, $a, $ndist)
                              {
                                  global $fathers, $mothers, $marked, $COIs, $deltaf, $ICknown, $verbose, $nl, $chrono, $paternal_rank, $max_dist;
                                  if (!$m || $ndist > $max_dist) {
                                      return 0;
                              Severity: Minor
                              Found in coi.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 ImageMagickVersion has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function ImageMagickVersion($returnRAW = false)
                                  {
                                      static $versionstring = null;
                                      if (null === $versionstring) {
                                          $versionstring = [0 => false, 1 => false];
                              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 ImageMagickVersion has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function ImageMagickVersion($returnRAW = false)
                                  {
                                      static $versionstring = null;
                                      if (null === $versionstring) {
                                          $versionstring = [0 => false, 1 => 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

                              Method ResolveSource has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function ResolveSource()
                                  {
                                      if (is_resource($this->gdimg_source)) {
                                          $this->DebugMessage('ResolveSource() exiting because is_resource($this->gdimg_source)', __FILE__, __LINE__);
                              
                              
                              Severity: Minor
                              Found in 0old/phpthumb/phpthumb.class.php - About 1 hr to fix

                                Method SafeExec has 35 lines of code (exceeds 25 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
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language