IET-OU/open-media-player

View on GitHub
application/controllers/scripts.php

Summary

Maintainability
A
3 hrs
Test Coverage

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 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 _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 _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

    There are no issues that match your filters.

    Category
    Status