abrain/einsatzverwaltung

View on GitHub

Showing 280 of 285 total issues

Method getRegistrationArgs has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getRegistrationArgs()
    {
        return array(
            'label' => 'Einsatzarten',
            'labels' => array(
Severity: Minor
Found in src/Types/IncidentType.php - About 1 hr to fix

    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();
    Severity: Minor
    Found in src/Import/Sources/Csv.php - About 1 hr to fix

      Method getRegistrationArgs has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getRegistrationArgs()
          {
              return array(
                  'label' => 'Externe Einsatzmittel',
                  'labels' => array(
      Severity: Minor
      Found in src/Types/ExtEinsatzmittel.php - About 1 hr to fix

        Method upgrade130 has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function upgrade130()
            {
                /** @var wpdb $wpdb */
                global $wpdb;
        
        
        Severity: Minor
        Found in src/Update.php - About 1 hr to fix

          Method analysisPage has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function analysisPage()
              {
                  if (!$this->currentSource->checkPreconditions()) {
                      return;
                  }
          Severity: Minor
          Found in src/Import/Tool.php - About 1 hr to fix

            Function maybeCategorySpecialChanged has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                public function maybeCategorySpecialChanged($newValue, $oldValue)
                {
                    // Nur Änderungen sind interessant
                    if ($newValue == $oldValue) {
                        return $newValue;
            Severity: Minor
            Found in src/Settings/Pages/General.php - About 1 hr to fix

            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 upgrade120 has a Cognitive Complexity of 12 (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
            Severity: Minor
            Found in src/Update.php - About 1 hr to fix

            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 dropdownPosts has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                public function dropdownPosts($args)
                {
                    $defaults = array(
                        'echo' => true,
                        'post_type' => array('post'),
            Severity: Minor
            Found in src/CustomFields/PostSelector.php - About 1 hr to fix

            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()
            {
                var tables = document.getElementsByClassName('einsatzverwaltung-reportlist');
                for (var tablecounter = 0; tablecounter < tables.length; tablecounter++) {
                    var table = tables.item(tablecounter);
            Severity: Minor
            Found in src/js/reportlist.js - About 1 hr to fix

            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 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getEinsatzberichtHeader($post, $mayContainLinks = true, $showArchiveLinks = true)
                {
                    if (get_post_type($post) == "einsatz") {
                        $report = new IncidentReport($post);
            
            
            Severity: Minor
            Found in src/Frontend.php - About 1 hr to fix

              Method registerSettings has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function registerSettings()
                  {
                      register_setting(
                          'einsatzvw_settings_list',
                          'einsatzvw_list_columns',
              Severity: Minor
              Found in src/Settings/Pages/ReportList.php - About 1 hr to fix

                Method __construct has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function __construct()
                    {
                        $this->customColumns = array(
                            'title' => array(
                                'label' => 'Einsatzbericht',
                Severity: Minor
                Found in src/Admin/ReportListTable.php - About 1 hr to fix

                  Method getRegistrationArgs has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function getRegistrationArgs()
                      {
                          return array(
                              'label' => 'Fahrzeuge',
                              'labels' => array(
                  Severity: Minor
                  Found in src/Types/Vehicle.php - About 1 hr to fix

                    Method importPage has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function importPage()
                        {
                            if (!$this->currentSource->checkPreconditions()) {
                                return;
                            }
                    Severity: Minor
                    Found in src/Import/Tool.php - About 1 hr to fix

                      Method getRegistrationArgs has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function getRegistrationArgs()
                          {
                              return array(
                                  'label' => 'Alarmierungsart',
                                  'labels' => array(
                      Severity: Minor
                      Found in src/Types/Alarmierungsart.php - About 1 hr to fix

                        Method dropdownEigeneFelder has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function dropdownEigeneFelder($args)
                            {
                                $defaults = array(
                                    'name' => null,
                                    'selected' => '-',
                        Severity: Minor
                        Found in src/Import/Helper.php - About 1 hr to fix

                          Function renderMatchForm has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function renderMatchForm($source, $args)
                              {
                                  $defaults = array(
                                      'mapping' => array(),
                                      'next_action' => null,
                          Severity: Minor
                          Found in src/Import/Helper.php - About 1 hr to fix

                          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();
                                  }
                          Severity: Minor
                          Found in src/Data.php - About 1 hr to fix

                          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 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function maybeCategoryChanged($newValue, $oldValue)
                              {
                                  // Nur Änderungen sind interessant
                                  if ($newValue == $oldValue) {
                                      return $newValue;
                          Severity: Minor
                          Found in src/Settings/Pages/General.php - About 1 hr to fix

                          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 __construct has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function __construct(Data $data, Options $options, Utilities $utilities, PermalinkController $permalinkController, CustomFieldsRepository $customFieldsRepo)
                              {
                                  $pluginBasename = plugin_basename(einsatzverwaltung_plugin_file());
                                  add_action('admin_menu', array($this, 'hideTaxonomies'));
                                  add_action('admin_notices', array($this, 'displayAdminNotices'));
                          Severity: Minor
                          Found in src/Admin/Initializer.php - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language