dszymczuk/dsEventCalendar57

View on GitHub

Showing 20 of 22 total issues

File list_event.php has 452 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php defined('C5_EXECUTE') or die('Access denied.');
?>

<?php echo Loader::helper('concrete/dashboard')->getDashboardPaneHeaderWrapper(t('Event Calendar')); ?>

Severity: Minor
Found in single_pages/dashboard/event_calendar/list_event.php - About 6 hrs to fix

    Method view has 95 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function view()
        {
            $this->addFooterItem(Loader::helper('html')->css('jquery.datetimepicker.min.css', 'dsEventCalendar'));
            $this->addFooterItem(Loader::helper('html')->css('dsStyle.css', 'dsEventCalendar'));
            $this->addFooterItem(Loader::helper('html')->javascript('moment.min.js', 'dsEventCalendar'));
    Severity: Major
    Found in controllers/single_page/dashboard/event_calendar/event.php - About 3 hrs to fix

      Function view has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

          public function view()
          {
              $this->addFooterItem(Loader::helper('html')->css('colorpicker.min.css', 'dsEventCalendar'));
              $this->addFooterItem(Loader::helper('html')->javascript('colorpicker.min.js', 'dsEventCalendar'));
              $this->addFooterItem(Loader::helper('html')->css('dsStyle.css', 'dsEventCalendar'));
      Severity: Minor
      Found in controllers/single_page/dashboard/event_calendar/settings.php - About 2 hrs 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 view has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

          public function view()
          {
              $this->addFooterItem(Loader::helper('html')->css('jquery.datetimepicker.min.css', 'dsEventCalendar'));
              $this->addFooterItem(Loader::helper('html')->css('dsStyle.css', 'dsEventCalendar'));
              $this->addFooterItem(Loader::helper('html')->javascript('moment.min.js', 'dsEventCalendar'));
      Severity: Minor
      Found in controllers/single_page/dashboard/event_calendar/event.php - About 2 hrs 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 installSettings has 63 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function installSettings()
          {
              $db = Loader::db();
      
              //check is settings are duplicate
      Severity: Major
      Found in controller.php - About 2 hrs to fix

        Method view has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function view()
            {
                $this->addFooterItem(Loader::helper('html')->css('colorpicker.min.css', 'dsEventCalendar'));
                $this->addFooterItem(Loader::helper('html')->javascript('colorpicker.min.js', 'dsEventCalendar'));
                $this->addFooterItem(Loader::helper('html')->css('dsStyle.css', 'dsEventCalendar'));
        Severity: Minor
        Found in controllers/single_page/dashboard/event_calendar/settings.php - About 1 hr to fix

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

              public function updateEvent()
              {
                  if (isset($_POST) && !empty($_POST)) {
                      //if calendarID === 0 -> is bad !!
                      if ($_POST['calendarID'] == 0)
          Severity: Minor
          Found in controllers/single_page/dashboard/event_calendar/list_event.php - About 1 hr to fix

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

                public function action_ical()
                {
                    $db = Loader::db();
                    $caltitle = $db->fetchColumn("select title from dsEventCalendar where calendarID = ?", array($this->calendarID), 0);
                    if ($this->calendarID == 0) {
            Severity: Minor
            Found in blocks/event_calendar/controller.php - About 1 hr to fix

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

                  public function view()
                  {
                      $this->addFooterItem(Loader::helper('html')->css('colorpicker.min.css', 'dsEventCalendar'));
                      $this->addFooterItem(Loader::helper('html')->javascript('colorpicker.min.js', 'dsEventCalendar'));
                      $this->addFooterItem(Loader::helper('html')->css('dsStyle.css', 'dsEventCalendar'));
              Severity: Minor
              Found in controllers/single_page/dashboard/event_calendar/types.php - About 1 hr to fix

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

                    public function getEventsFromCalendar($calendarID, $typeID = 0)
                    {
                        $db = Loader::db();
                
                        $q = "SELECT ECE.eventID as id,  ";
                Severity: Minor
                Found in src/dsEventCalendar/dsEventCalendar.php - About 1 hr to fix

                  Function getEventsFromCalendar has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function getEventsFromCalendar($calendarID, $typeID = 0)
                      {
                          $db = Loader::db();
                  
                          $q = "SELECT ECE.eventID as id,  ";
                  Severity: Minor
                  Found in src/dsEventCalendar/dsEventCalendar.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 installSettings has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function installSettings()
                      {
                          $db = Loader::db();
                  
                          //check is settings are duplicate
                  Severity: Minor
                  Found in controller.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 view has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function view()
                      {
                          $this->addFooterItem(Loader::helper('html')->css('colorpicker.min.css', 'dsEventCalendar'));
                          $this->addFooterItem(Loader::helper('html')->javascript('colorpicker.min.js', 'dsEventCalendar'));
                          $this->addFooterItem(Loader::helper('html')->css('dsStyle.css', 'dsEventCalendar'));
                  Severity: Minor
                  Found in controllers/single_page/dashboard/event_calendar/types.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 install has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function install() {
                          $pkg = parent::install();
                  
                          // install block
                          BlockType::installBlockTypeFromPackage('event_calendar', $pkg);
                  Severity: Minor
                  Found in controller.php - About 1 hr to fix

                    Function removeEvent has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function removeEvent()
                        {
                            if (isset($_POST) && !empty($_POST)) {
                                $eventID = $this->post('eventID');
                                if (is_numeric($eventID)) {
                    Severity: Minor
                    Found in controllers/single_page/dashboard/event_calendar/list_event.php - About 45 mins 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 updateEvent has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function updateEvent()
                        {
                            if (isset($_POST) && !empty($_POST)) {
                                //if calendarID === 0 -> is bad !!
                                if ($_POST['calendarID'] == 0)
                    Severity: Minor
                    Found in controllers/single_page/dashboard/event_calendar/list_event.php - About 45 mins 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 updateDateEvent has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function updateDateEvent()
                        {
                            if (isset($_POST) && !empty($_POST)) {
                                //if calendarID === 0 -> is bad !!
                                if ($_POST['calendarID'] == 0)
                    Severity: Minor
                    Found in controllers/single_page/dashboard/event_calendar/list_event.php - About 45 mins 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 update has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function update($calendar_id)
                        {
                            $this->set('pageTitle', t("Manage calendar"));
                    
                            if (is_numeric($calendar_id)) {
                    Severity: Minor
                    Found in controllers/single_page/dashboard/event_calendar/calendar.php - About 45 mins 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 install has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function install() {
                            $pkg = parent::install();
                    
                            // install block
                            BlockType::installBlockTypeFromPackage('event_calendar', $pkg);
                    Severity: Minor
                    Found in controller.php - About 25 mins 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 updateDateEventRange has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function updateDateEventRange()
                        {
                            if (isset($_POST) && !empty($_POST)) {
                                //if calendarID === 0 -> is bad !!
                                if ($_POST['calendarID'] == 0)
                    Severity: Minor
                    Found in controllers/single_page/dashboard/event_calendar/list_event.php - About 25 mins 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

                    Severity
                    Category
                    Status
                    Source
                    Language