IET-OU/open-media-player

View on GitHub

Showing 35 of 39 total issues

Function xml2array has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring.
Open

    protected function xml2array($contents, $get_attributes = 1, $priority = 'tag')
    {
        if (!$contents) {
            return array();
        }
Severity: Minor
Found in application/models/podcast_items_feed_model.php - About 1 day 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 get_item_v1 has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_item_v1($basename, $shortcode = null, $captions = false)
    {

        $pod_base = Oupodcast_serv::POD_BASE;
        $file=$pod_base."/feeds/$basename/".config_item('podcast_feed_file');
Severity: Minor
Found in application/models/podcast_items_feed_model.php - About 5 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

File podcast_items_feed_model.php has 367 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Part of Open Media Player.
 *
 * @license   http://gnu.org/licenses/gpl.html GPL-3.0+
Severity: Minor
Found in application/models/podcast_items_feed_model.php - About 4 hrs to fix

    Method xml2array has 100 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function xml2array($contents, $get_attributes = 1, $priority = 'tag')
        {
            if (!$contents) {
                return array();
            }
    Severity: Major
    Found in application/models/podcast_items_feed_model.php - About 4 hrs to fix

      Function webvtt has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

          public function webvtt()
          {
      
              $ttml_url = $this->input->get('url');
              #'http://podcast.open.ac.uk/feeds/student-experiences/closed-captions/openings-being-an-ou-student.xml';
      Severity: Minor
      Found in application/controllers/timedtext.php - About 3 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

      File layout_oueep_2019.php has 324 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * OU V4-EEP compatible layout for Open Media Player web-site (21-August-2019).
       *
       * @copyright © 2019 The Open University (IET).
      Severity: Minor
      Found in application/views/site_layout/layout_oueep_2019.php - About 3 hrs to fix

        Method get_item has 91 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function get_item($basename, $shortcode = null, $captions = false)
            {
        
                $url = $this->_feed_url($basename, $shortcode);
        
        
        Severity: Major
        Found in application/models/podcast_items_feed_model.php - About 3 hrs to fix

          Method webvtt has 80 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function webvtt()
              {
          
                  $ttml_url = $this->input->get('url');
                  #'http://podcast.open.ac.uk/feeds/student-experiences/closed-captions/openings-being-an-ou-student.xml';
          Severity: Major
          Found in application/controllers/timedtext.php - About 3 hrs to fix

            Method get_item_v1 has 80 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function get_item_v1($basename, $shortcode = null, $captions = false)
                {
            
                    $pod_base = Oupodcast_serv::POD_BASE;
                    $file=$pod_base."/feeds/$basename/".config_item('podcast_feed_file');
            Severity: Major
            Found in application/models/podcast_items_feed_model.php - About 3 hrs to fix

              File learn3-mod-oucontent-many.php has 288 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
              /**
               * A test page for the OU-VLE with many media players.
               *
               * @copyright Copyright 2012 The Open University.
              Severity: Minor
              Found in application/views/vle_demo/learn3-mod-oucontent-many.php - About 2 hrs to fix

                Method index has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function index()
                    {
                        #@header('Content-Type: text/plain; charset=UTF-8');
                        #header('Content-Disposition: inline; filename=ouplayer-oembed.json.txt');
                
                
                Severity: Major
                Found in application/controllers/oembed.php - About 2 hrs to fix

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

                      public function index()
                      {
                          #@header('Content-Type: text/plain; charset=UTF-8');
                          #header('Content-Disposition: inline; filename=ouplayer-oembed.json.txt');
                  
                  
                  Severity: Minor
                  Found in application/controllers/oembed.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 _player has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected function _player($class, $options)
                      {
                          header('Content-Type: text/html; charset=utf-8');
                  
                        // Security: No access control required?
                  Severity: Major
                  Found in application/controllers/embed.php - About 2 hrs to fix

                    File layout_ouice_2.php has 270 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    
                    /** -- DEPRECATED! -- Use 'layout_oueep_2019.php' -- **/
                    
                    /**
                    Severity: Minor
                    Found in application/views/site_layout/layout_ouice_2.php - About 2 hrs to fix

                      Method pod has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function pod($custom_id = null, $shortcode = null)
                          {
                              if (!$custom_id || !$shortcode) {
                                  $this->_error("an album ID and track MD5 hash are required in the URL", 400);
                              }
                      Severity: Major
                      Found in application/controllers/embed.php - About 2 hrs to fix

                        Method get_item has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function get_item($basename, $shortcode = null, $captions = false)
                            {
                        
                            /* SELECT * FROM podcast_items
                              JOIN podcasts ON podcasts.id=podcast_items.podcast_id
                        Severity: Major
                        Found in application/models/podcast_items_model.php - About 2 hrs to fix

                          Method initialize has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function initialize()
                              {
                                  $CI =& get_instance();
                                  //$CI->load->library('POParser');
                                #$lang = $CI->input->get('lang');
                          Severity: Minor
                          Found in application/core/MY_Lang.php - About 1 hr to fix

                            Method jquery_oembed has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function jquery_oembed($cache_minutes = 10)
                                {
                            
                                    $cache_key = 'scripts_jquery.oembed.js';
                                    $this->_cache_init($cache_key);
                            Severity: Minor
                            Found in application/controllers/scripts.php - About 1 hr to fix

                              Function get_item has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function get_item($basename, $shortcode = null, $captions = false)
                                  {
                              
                                  /* SELECT * FROM podcast_items
                                    JOIN podcasts ON podcasts.id=podcast_items.podcast_id
                              Severity: Minor
                              Found in application/models/podcast_items_model.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 vle has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function vle($page = 'video')
                                  {
                                      $this->_sams_check();
                              
                                      # Not, $this->_load_layout('ouvle').
                              Severity: Minor
                              Found in application/controllers/demo.php - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language