Completed
Push — develop ( 388072...279bca )
by
unknown
02:50
created

BackendController   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 79
Duplicated Lines 37.97 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 14
Bugs 0 Features 2
Metric Value
wmc 5
c 14
b 0
f 2
lcom 1
cbo 2
dl 30
loc 79
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A indexAction() 0 12 1
A SeoAction() 10 10 1
A ContentAction() 10 10 1
A TechnicalAction() 10 10 1
A keywordAction() 0 6 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
namespace HDNET\OnpageIntegration\Controller;
4
5
use HDNET\OnpageIntegration\Service\ProgressService;
6
use TYPO3\CMS\Core\Utility\GeneralUtility;
7
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
8
9
class BackendController extends ActionController
10
{
11
12
    /**
13
     * @var \HDNET\OnpageIntegration\Loader\ApiResultLoader
14
     * @inject
15
     */
16
    protected $loader;
17
18
    /**
19
     * Represent the index page
20
     */
21
    public function indexAction()
22
    {
23
        $lastCrawl = $this->loader->load('zoom_lastcrawl');
24
25
        $progressService = GeneralUtility::makeInstance(ProgressService::class);
26
        $progressService->makeProgress($lastCrawl);
27
28
        $this->view->assignMultiple([
29
            'lastCrawl' => $lastCrawl,
30
            'moduleName' => 'Zoom Module'
31
        ]);
32
    }
33
34
    /**
35
     * Detail Page
36
     *
37
     * @param string $call
38
     */
39 View Code Duplication
    public function SeoAction($call)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
40
    {
41
        $apiCallString = 'zoom_' . $call . '_table';
42
43
        $table = $this->loader->load($apiCallString);
44
        $this->view->assignMultiple([
45
            'table' => $table,
46
            'moduleName' => 'SEO Aspekte'
47
        ]);
48
    }
49
50
    /**
51
     * @param string $call
52
     */
53 View Code Duplication
    public function ContentAction($call)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
54
    {
55
        $apiCallString = 'zoom_' . $call . '_table';
56
57
        $table = $this->loader->load($apiCallString);
58
        $this->view->assignMultiple([
59
            'table' => $table,
60
            'moduleName' => 'Inhaltliche Aspekte'
61
        ]);
62
    }
63
64
    /**
65
     * @param string $call
66
     */
67 View Code Duplication
    public function TechnicalAction($call)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
68
    {
69
        $apiCallString = 'zoom_' . $call . '_table';
70
71
        $table = $this->loader->load($apiCallString);
72
        $this->view->assignMultiple([
73
            'table' => $table,
74
            'moduleName' => 'Technische Aspekte'
75
        ]);
76
    }
77
78
    /**
79
     *
80
     */
81
    public function keywordAction()
82
    {
83
        $this->view->assignMultiple([
84
            'moduleName' => 'Keyword'
85
        ]);
86
    }
87
}
88