IET-OU/open-media-player

View on GitHub

Showing 35 of 39 total issues

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

    protected function _player($class, $options)
    {
        header('Content-Type: text/html; charset=utf-8');

      // Security: No access control required?
Severity: Minor
Found in application/controllers/embed.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 pod has a Cognitive Complexity of 11 (exceeds 5 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: Minor
Found in application/controllers/embed.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 index has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function index($return = false)
    {
        @header('Content-Disposition: inline; filename=ouplayer-ou-embed-services.json');

      // JSON-P callback: security. Only allow eg. 'Object.func_CB_1234'
Severity: Minor
Found in application/controllers/services.php - About 1 hr to fix

    Function _authenticate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function _authenticate()
        {
            if ($this->config->item('auth_localhost_bypass') && 'localhost' == $_SERVER['HTTP_HOST']) {
                $this->_debug('auth_localhost_bypass');
                return;
    Severity: Minor
    Found in application/controllers/admin.php - About 55 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 get_item has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        public function get_item($basename, $shortcode = null, $captions = false)
        {
    
            $url = $this->_feed_url($basename, $shortcode);
    
    
    Severity: Minor
    Found in application/models/podcast_items_feed_model.php - About 55 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 initialize has a Cognitive Complexity of 8 (exceeds 5 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 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

    Method log_exception has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function log_exception($severity, $message, $filepath, $line, $label = 'Error')
    Severity: Minor
    Found in application/core/MY_Exceptions.php - About 35 mins to fix

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

          protected function _feed_url($basename, $shortcode)
          {
              $url_pattern = $this->config->item('podcast_feed_url_pattern');
              $locate = "\$config[podcast_feed_url_pattern] in 'config/embed_config.php'";
      
      
      Severity: Minor
      Found in application/models/podcast_items_feed_model.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 _join_yuicompress has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function _join_yuicompress($assets, $ctype = 'application/x-javascript')
          {
              #@header("Content-Type: $ctype; charset=utf-8");
              $out = array();
              foreach ($assets as $file) {
      Severity: Minor
      Found in application/controllers/scripts.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 url_exists has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function url_exists($url)
          {
              $url = str_replace("http://", "", $url);
              if (strstr($url, "/")) {
                  $url = explode("/", $url, 2);
      Severity: Minor
      Found in application/models/podcast_items_feed_model.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 index has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function index($return = false)
          {
              @header('Content-Disposition: inline; filename=ouplayer-ou-embed-services.json');
      
            // JSON-P callback: security. Only allow eg. 'Object.func_CB_1234'
      Severity: Minor
      Found in application/controllers/services.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 html has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          public function html($lang = 'x', $download = false)
          {
              $lang = $langx = strtolower($lang);
      
              if ('en'==$lang) {
      Severity: Minor
      Found in application/controllers/localize.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 _get_oembed_examples has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function _get_oembed_examples()
          {
              $examples = $names = array();
              $providers = $this->_get_oembed_providers();
      
      
      Severity: Minor
      Found in application/controllers/demo.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 _cache_init has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function _cache_init($key)
          {
              // Start with a low value for caching. (No, set expires headers in .htaccess/ httpd.conf)
              $cache = $this->input->get('cache');
              $minutes = $this->config->item('cache_minutes');
      Severity: Minor
      Found in application/controllers/scripts.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