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();
}
- 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 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');
- 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
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+
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();
}
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';
- 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
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).
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);
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';
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');
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.
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');
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');
- 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 _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?
File layout_ouice_2.php
has 270 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/** -- DEPRECATED! -- Use 'layout_oueep_2019.php' -- **/
/**
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);
}
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
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');
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);
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
- 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 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').