fisharebest/webtrees

View on GitHub
app/Module/SlideShowModule.php

Summary

Maintainability
B
6 hrs
Test Coverage

Method getBlock has 88 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getBlock(Tree $tree, int $block_id, string $context, array $config = []): string
    {
        $request       = Registry::container()->get(ServerRequestInterface::class);
        $default_start = (bool) $this->getBlockSetting($block_id, 'start');
        $filter_links  = $this->getBlockSetting($block_id, 'filter', self::LINK_ALL);
Severity: Major
Found in app/Module/SlideShowModule.php - About 3 hrs to fix

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

        public function editBlockConfiguration(Tree $tree, int $block_id): string
        {
            $filter   = $this->getBlockSetting($block_id, 'filter', self::LINK_ALL);
            $controls = $this->getBlockSetting($block_id, 'controls', '1');
            $start    = $this->getBlockSetting($block_id, 'start', '0');
    Severity: Minor
    Found in app/Module/SlideShowModule.php - About 1 hr to fix

      Avoid too many return statements within this method.
      Open

              return $content;
      Severity: Major
      Found in app/Module/SlideShowModule.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return view('modules/block-template', [
                        'block'      => Str::kebab($this->name()),
                        'id'         => $block_id,
                        'config_url' => $this->configUrl($tree, $context, $block_id),
                        'title'      => $this->title(),
        Severity: Major
        Found in app/Module/SlideShowModule.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                          return false;
          Severity: Major
          Found in app/Module/SlideShowModule.php - About 30 mins to fix

            There are no issues that match your filters.

            Category
            Status