Showing 151 of 250 total issues
Method updateRoles
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function updateRoles()
{
// Make sure, the administrator role has all the necessary capabilities
$adminRole = get_role('administrator');
if (!empty($adminRole)) {
Method analysisPage
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function analysisPage()
{
if (!$this->currentSource->checkPreconditions()) {
return;
}
Function dropdownPosts
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function dropdownPosts($args): string
{
$defaults = array(
'echo' => true,
'post_type' => array('post'),
- 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 maybeCategorySpecialChanged
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function maybeCategorySpecialChanged($newValue, $oldValue): string
{
// Nur Änderungen sind interessant
if ($newValue == $oldValue) {
return $newValue;
- 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 setUpMobileView
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function setUpMobileView()
{
const tables = document.getElementsByClassName('einsatzverwaltung-reportlist');
for (let tablecounter = 0; tablecounter < tables.length; tablecounter++) {
const table = tables.item(tablecounter);
- 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 echoSingleReport
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function echoSingleReport(IncidentReport $report, $instance)
{
if (true === ($instance['showAnnotations'])) {
$annotationIconBar = AnnotationIconBar::getInstance();
printf('<div class="annotation-icon-bar">%s</div>', $annotationIconBar->render($report->getPostId()));
- 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 maybeCategoryChanged
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function maybeCategoryChanged($newValue, $oldValue): string
{
// Nur Änderungen sind interessant
if ($newValue == $oldValue) {
return $newValue;
- 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 echoStaticContent
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function echoStaticContent()
{
?>
<div class="aboutpage-icons">
<div class="aboutpage-icon"><a href="https://einsatzverwaltung.org" target="_blank"><i class="fa-solid fa-globe fa-4x"></i><br>Webseite</a></div>
Method addSettingsFields
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addSettingsFields()
{
add_settings_field(
'einsatzvw_permalinks_base',
__('Base', 'einsatzverwaltung'),
Method registerSettings
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function registerSettings()
{
register_setting(
'einsatzvw_settings_list',
'einsatzvw_list_columns',
Method getRegistrationArgs
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getRegistrationArgs(): array
{
return array(
'labels' => array(
'name' => _x('Incident Categories', 'taxonomy general name', 'einsatzverwaltung'),
Method __construct
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct()
{
$this->customColumns = array(
'title' => array(
'label' => __('Title', 'einsatzverwaltung'),
Method getRegistrationArgs
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getRegistrationArgs(): array
{
return array(
'label' => 'Fahrzeuge',
'labels' => array(
Method echoVehiclesByUnit
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function echoVehiclesByUnit(WP_Post $post, WP_Taxonomy $vehicleTaxonomy, array $vehicles, array $assignedVehicleIds)
{
$unitTaxObj = get_taxonomy(Unit::getSlug());
if (empty($unitTaxObj)) {
return;
Method importPage
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function importPage()
{
if (!$this->currentSource->checkPreconditions()) {
return;
}
Method registerCustomFields
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function registerCustomFields(CustomFieldsRepository $customFields)
{
$customFields->add($this, new UnitSelector(
'vehicle_unit',
_x('Unit', 'taxonomy singular name', 'einsatzverwaltung'),
Method dropdownEigeneFelder
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function dropdownEigeneFelder($args)
{
$defaults = array(
'name' => null,
'selected' => '-',
Method getRegistrationArgs
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getRegistrationArgs(): array
{
return array(
'labels' => array(
'name' => _x('Alerting Methods', 'taxonomy general name', 'einsatzverwaltung'),
Function render
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function render($attributes): string
{
$attributes = $this->getAttributes($attributes);
$year = $this->getYear($attributes['year']);
- 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 updateSequenceNumbers
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function updateSequenceNumbers($yearToUpdate = null)
{
if (empty($yearToUpdate)) {
$years = self::getYearsWithReports();
}
- 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"