Showing 207 of 259 total issues
File jsgrid.js
has 1961 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* jsGrid v1.5.3 (http://js-grid.com)
* (c) 2016 Artem Tabalin
* Licensed under MIT (https://github.com/tabalinas/jsgrid/blob/master/LICENSE)
*/
File IRI.php
has 835 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* IRI parser/serialiser/normaliser
*
* @package Requests
Function request
has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring. Open
public function request($url, $headers = array(), $data = array(), $options = array()) {
$options['hooks']->dispatch('fsockopen.before_request');
$url_parts = parse_url($url);
$host = $url_parts['host'];
- 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 remove_iunreserved_percent_encoded
has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring. Open
protected function remove_iunreserved_percent_encoded($match)
{
// As we just have valid percent encoded sequences we can just explode
// and ignore the first member of the returned array (an empty string).
$bytes = explode('%', $match[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"
Further reading
File reporting.js
has 451 lines of code (exceeds 250 allowed). Consider refactoring. Open
var hc_pie_options = {
credits: false,
chart: {
animation: false,
plotBackgroundColor: null,
Function replace_invalid_with_pct_encoding
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
protected function replace_invalid_with_pct_encoding($string, $extra_chars, $iprivate = FALSE)
{
// Normalize as many pct-encoded sections as possible
$string = preg_replace_callback('/(?:%[A-Fa-f0-9]{2})+/', array(&$this, 'remove_iunreserved_percent_encoded'), $string);
- 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 request
has 166 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function request($url, $headers = array(), $data = array(), $options = array()) {
$options['hooks']->dispatch('fsockopen.before_request');
$url_parts = parse_url($url);
$host = $url_parts['host'];
Function absolutize
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
public static function absolutize($base, $relative)
{
if (!($relative instanceof Requests_IRI))
{
$relative = new Requests_IRI($relative);
- 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 setup_db_structure
has 161 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setup_db_structure()
{
//check for database existence
$this->load->database('default');
$this->load->dbforge();
Consider simplifying this complex logical expression. Open
if (
// Invalid sequences
!$valid
// Non-shortest form sequences are invalid
|| $length > 1 && $character <= 0x7F
File Compliance_model.php
has 411 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Pacifica
*
* Pacifica is an open-source data management framework designed
File Requests.php
has 405 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Requests for PHP
*
* Inspired by Requests for Python.
Function utf8_to_codepoints
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
protected static function utf8_to_codepoints($input) {
$codepoints = array();
// Get number of bytes
$strlen = strlen($input);
- 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 update_object_preferences
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
public function update_object_preferences($object_type, $object_list, $group_id)
{
$table = 'reporting_selection_prefs';
$additions = array();
$removals = 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
File Group.php
has 363 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Pacifica
*
* Pacifica is an open-source data management framework designed
Method view
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function view(
$object_type = false,
$time_range = false,
$start_date = false,
$end_date = false,
Function load_compliance_report
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
var load_compliance_report = function(destination_object, month, year){
$("#compliance_loading_screen").show();
$("#booking_results_error").hide();
$("#search_results_display").fadeOut();
$("#booking_results_display").empty();
Function _get_reporting_info_list_base
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
private function _get_reporting_info_list_base(
$object_type,
$group_id,
$time_basis,
$time_range,
- 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 punycode_encode
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
public static function punycode_encode($input) {
$output = '';
# let n = initial_n
$n = self::BOOTSTRAP_INITIAL_N;
# let delta = 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"
Further reading
Consider simplifying this complex logical expression. Open
if (
// Invalid sequences
!$valid
// Non-shortest form sequences are invalid
|| $length > 1 && $character <= 0x7F