fixate/pw-mvc-boilerplate

View on GitHub

Showing 27 of 27 total issues

Function render_file has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function render_file($file, $_data = array(), $fallback = null)
    {
        if (!isset($this->data)) {
            $this->data = array();
        }
Severity: Minor
Found in core/View.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 starts_with has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function starts_with($haystack, $needle)
    {
        if (is_array($needle)) {
            foreach ($needle as $i) {
                if (strpos($haystack, $i) === 0) {
Severity: Minor
Found in core/Utils.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 call has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function call()
    {
        $this->request = f8\HttpRequest::instance();
        $this->response = new f8\HttpResponse();
        $input = PW\wire('input');
Severity: Minor
Found in core/Controller.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 resolve_view_path has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function resolve_view_path($file)
    {
        if (!($base_path = $this->base_path)) {
            $base_path = f8\Paths::resolve(f8\Paths::join(dirname(__FILE__), '../views'));
        }
Severity: Minor
Found in core/View.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 __og_image_meta has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function __og_image_meta($image)
    {
        $config = &$this->config;
        $protocol = $config->https ? 'https://' : 'http://';
        $hostname = $protocol . $config->httpHost;
Severity: Minor
Found in controllers/traits/open_graph.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 __load_bower_main has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  private function __load_bower_main($vendor)
  {
    $tries = array('.bower.json', 'bower.json', 'component.json');

    foreach ($tries as $t) {
Severity: Minor
Found in controllers/traits/javascript.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 render_scripts has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  public function render_scripts()
  {
    $html = '';
    foreach ($this->__js_scripts as $script) {
      list($type, $script_name, $script_path, $url) = $script;
Severity: Minor
Found in controllers/traits/javascript.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