Showing 25 of 27 total issues
Function clickToggler
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
export default function clickToggler(selector, opts = {}) {
const elementPairs = [...document.querySelectorAll(selector)].map(elem => (
{
target: document.querySelector(elem.getAttribute('data-target')),
trigger: elem,
- 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 call
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
public function call()
{
$req = $this->request = f8\HttpRequest::instance();
$this->response = new f8\HttpResponse();
$method = strtolower($req->method());
- 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 clickToggler
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function clickToggler(selector, opts = {}) {
const elementPairs = [...document.querySelectorAll(selector)].map(elem => (
{
target: document.querySelector(elem.getAttribute('data-target')),
trigger: elem,
Function __call
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function __call($method, $args)
{
if (property_exists(__CLASS__, $method) && is_callable($method)) {
return call_user_func_array(array($this, $method), $args);
} else {
- 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 call
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function call()
{
$req = $this->request = f8\HttpRequest::instance();
$this->response = new f8\HttpResponse();
$method = strtolower($req->method());
Function ls
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public static function ls($path, $extension = null)
{
$result = array();
if ($handle = opendir($path)) {
while (($file = readdir($handle)) !== false) {
- 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_page_data
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function get_page_data($page, array $fields = [])
{
$outputFormatting = $page->outputFormatting;
$page->setOutputFormatting(false);
- 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 __construct
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(&$config, &$fields, &$input, &$page, &$pages, &$permissions, &$roles, &$sanitizer, &$session, &$templates, &$user, &$users)
Method __construct
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(&$config, &$fields, &$input, &$page, &$pages, &$permissions, &$roles, &$sanitizer, &$session, &$templates, &$user, &$users)
Method init
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function init($config, $fields, $input, $page, $pages, $permissions, $roles, $sanitizer, $session, $templates, $user, $users)
Method get_page_data
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_page_data($page, array $fields = [])
{
$outputFormatting = $page->outputFormatting;
$page->setOutputFormatting(false);
Method render_file
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function render_file($file, $_data = array(), $fallback = null)
{
if (!isset($this->data)) {
$this->data = array();
}
Method dynamic_load
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function dynamic_load($app)
{
$config = $app->config;
$fields = $app->fields;
$input = $app->input;
Function __og_render_tags
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function __og_render_tags($tags)
{
$html = '';
foreach ($tags as $name => $value) {
if ($value !== null) {
- 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 assets
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function assets($path, $use_min = true)
{
$is_production = Environment::is_production();
if ($is_production) {
// If use MD5# manifest in use get proper path
- 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 get_contact_form
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_contact_form()
{
$can_send = false;
$form_has_errors = false;
$input = $this->input;
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($statusCode, $message = null, \Exception $previous = null, array $headers = array(), $code = 0)
Function __og_get_prop
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function __og_get_prop($prop, $field = null, $default = null)
{
$prop = $this->page->get($this->__og_opts["{$prop}_get"]);
if ($prop && method_exists($this->page, $prop)) {
- 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 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();
}
- 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 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) {
- 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"