Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Pull Request — dev-extbase-fluid (#777)
by Alexander
02:59
created

ConfigurationForm::checkMetadataFormats()   F

Complexity

Conditions 11
Paths 768

Size

Total Lines 123
Code Lines 83

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 11
eloc 83
c 1
b 0
f 0
nc 768
nop 0
dl 0
loc 123
rs 3.1486

How to fix   Long Method    Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
/**
4
 * (c) Kitodo. Key to digital objects e.V. <[email protected]>
5
 *
6
 * This file is part of the Kitodo and TYPO3 projects.
7
 *
8
 * @license GNU General Public License version 3 or later.
9
 * For the full copyright and license information, please read the
10
 * LICENSE.txt file that was distributed with this source code.
11
 */
12
13
namespace Kitodo\Dlf\Hooks;
14
15
use Kitodo\Dlf\Common\Helper;
16
use Kitodo\Dlf\Common\Solr;
17
use TYPO3\CMS\Core\Core\Bootstrap;
18
use TYPO3\CMS\Core\Database\ConnectionPool;
19
use TYPO3\CMS\Core\Localization\LanguageService;
20
use TYPO3\CMS\Core\Utility\GeneralUtility;
21
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
22
use TYPO3\CMS\Core\Utility\VersionNumberUtility;
23
24
/**
25
 * Hooks and helper for \TYPO3\CMS\Core\TypoScript\ConfigurationForm
26
 *
27
 * @author Sebastian Meyer <[email protected]>
28
 * @package TYPO3
29
 * @subpackage dlf
30
 * @access public
31
 */
32
class ConfigurationForm
33
{
34
35
    /**
36
     * Check if a connection to a Solr server could be established with the given credentials.
37
     *
38
     * @access public
39
     *
40
     * @return string Message informing the user of success or failure
41
     */
42
    public function checkSolrConnection()
43
    {
44
        $solr = Solr::getInstance();
45
        if ($solr->ready) {
46
            Helper::addMessage(
47
                Helper::getLanguageService()->getLL('solr.status'),
48
                Helper::getLanguageService()->getLL('solr.connected'),
49
                \TYPO3\CMS\Core\Messaging\FlashMessage::OK
50
            );
51
        } else {
52
            Helper::addMessage(
53
                Helper::getLanguageService()->getLL('solr.error'),
54
                Helper::getLanguageService()->getLL('solr.notConnected'),
55
                \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING
56
            );
57
        }
58
        return Helper::renderFlashMessages();
59
    }
60
61
    /**
62
     * This is the constructor.
63
     *
64
     * @access public
65
     *
66
     * @return void
67
     */
68
    public function __construct()
69
    {
70
        // Load backend localization file.
71
        Helper::getLanguageService()->includeLLFile('EXT:dlf/Resources/Private/Language/locallang_be.xlf');
72
    }
73
74
}
75