Showing 151 of 250 total issues
Function mapEntryToInsertArgs
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function mapEntryToInsertArgs($mapping, $sourceEntry, &$insertArgs)
{
foreach ($mapping as $sourceField => $ownField) {
if (empty($ownField) || !is_string($ownField)) {
$this->utilities->printError("Feld '$ownField' ungültig");
- Read upRead up
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 renderPage
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function renderPage()
{
echo '<div class="wrap">';
echo '<h1>Einsatzverwaltung</h1>';
Method dropdownPosts
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function dropdownPosts($args): string
{
$defaults = array(
'echo' => true,
'post_type' => array('post'),
Method form
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function form($instance): string
{
$instance = array_merge($this->defaults, $instance);
printf(
Function saveTerm
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function saveTerm($termId, $ttId, $taxonomy)
{
if (!$this->hasTaxonomy($taxonomy)) {
return;
}
- Read upRead up
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 getEinsatzberichtHeader
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getEinsatzberichtHeader(WP_Post $post, bool $mayContainLinks = true, bool $showArchiveLinks = true): string
{
if (get_post_type($post) !== Report::getSlug()) {
return '';
}
Method addSettingsFields
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addSettingsFields()
{
add_settings_field(
'einsatzvw_einsatz_hideemptydetails',
'Einsatzdetails',
Method prepareArgsForInsertPost
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function prepareArgsForInsertPost(&$insertArgs, $dateTimeFormat, $postStatus, $alarmzeit)
{
// Datum des Einsatzes prüfen
if (false === $alarmzeit) {
throw new ImportPreparationException(sprintf(
Function upgrade120
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function upgrade120()
{
global $wpdb;
// Alle veröffentlichten Einsatzberichte einer Kategorie hinzufügen, wenn diese in den Einstellungen für die
- Read upRead up
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 getMapping
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function getMapping($sourceFields, $ownFields)
{
$mapping = array();
foreach ($sourceFields as $sourceField) {
$index = $this->getInputName($sourceField);
- Read upRead up
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 getInsertArgs
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function getInsertArgs(ReportInsertObject $reportImportObject)
{
$args = array(
'post_type' => Report::getSlug(),
'post_title' => $reportImportObject->getTitle(),
- Read upRead up
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 render
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function render(int $postId, $annotationIds = array()): string
{
$annotationRepository = ReportAnnotationRepository::getInstance();
$string = '';
$annotations = array();
- Read upRead up
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 constructList
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function constructList($reports, Parameters $parameters)
{
if (empty($reports)) {
$this->string = sprintf(
'<span>%s</span>',
Method addReportsToQuery
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addReportsToQuery(WP_Query $query)
{
// Nur, wenn Filter erlaubt sind, soll weitergemacht werden
if (!empty($query->query_vars['suppress_filters'])) {
return;
Method render
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render($attributes): string
{
$attributes = $this->getAttributes($attributes);
$year = $this->getYear($attributes['year']);
Method addSettingsSections
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addSettingsSections()
{
add_settings_section(
'einsatzvw_settings_permalinks',
__('Permalinks', 'einsatzverwaltung'),
Method readFile
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function readFile($numLines = null, $requestedFields = array())
{
$fieldMap = array();
if (!empty($requestedFields)) {
$fields = $this->getFields();
Method upgrade130
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function upgrade130()
{
global $wpdb;
$taxonomies = array(
Method getColumnContent
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getColumnContent($columnId, IncidentReport $report): string
{
switch ($columnId) {
case 'e_nummer':
$numberString = $report->getNumber();
Method getRegistrationArgs
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getRegistrationArgs(): array
{
return array(
'label' => 'Externe Einsatzmittel',
'labels' => array(