dszymczuk/dsEventCalendar

View on GitHub

Showing 19 of 21 total issues

File list_event.php has 459 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 7 hrs to fix

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

        public function view()
        {
            $db = Loader::db();
            if (!empty($_POST)) {
    
    
    Severity: Major
    Found in controllers/dashboard/event_calendar/event.php - About 3 hrs to fix

      Method installSettings has 73 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

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

            public function view()
            {
                 $db = Loader::db();
                if (!empty($_POST)) {
        
        
        Severity: Minor
        Found in controllers/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()
            {
                $db = Loader::db();
                if (!empty($_POST)) {
        
        
        Severity: Minor
        Found in controllers/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 view has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function view()
            {
                 $db = Loader::db();
                if (!empty($_POST)) {
        
        
        Severity: Minor
        Found in controllers/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/dashboard/event_calendar/list_event.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 libraries/dsEventCalendar.php - About 1 hr to fix

              Method installSP has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function installSP($pkg)
                  {
                      Loader::model('single_page');
              
                      $p1 = SinglePage::add('/dashboard/event_calendar', $pkg);
              Severity: Minor
              Found in controller.php - About 1 hr to fix

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

                    public function view()
                    {
                        $db = Loader::db();
                
                
                
                Severity: Minor
                Found in controllers/dashboard/event_calendar/types.php - About 1 hr to fix

                  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 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 libraries/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 view has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function view()
                      {
                          $db = Loader::db();
                  
                  
                  
                  Severity: Minor
                  Found in controllers/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

                  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/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 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/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)
                      {
                          if (is_numeric($calendar_id)) {
                              $db = Loader::db();
                              $sql = "SELECT * FROM dsEventCalendar WHERE calendarID=" . $calendar_id;
                  Severity: Minor
                  Found in controllers/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 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)
                                  die("ERROR");
                  Severity: Minor
                  Found in controllers/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 installSP has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function installSP($pkg)
                      {
                          Loader::model('single_page');
                  
                          $p1 = SinglePage::add('/dashboard/event_calendar', $pkg);
                  Severity: Minor
                  Found in controller.php - About 35 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)
                                  die("ERROR");
                  Severity: Minor
                  Found in controllers/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