Showing 140 of 176 total issues
Field
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class Field extends ContentObject implements FormElement
{
protected $validations = array();
protected $name;
protected $label;
Method upload
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
function upload($isImage=false)
{
if ($this->acceptedMimetype($this->mimetype)) {
$this->checkDirectory();
Method createFeed
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createFeed() {
$feed = "<?xml version=\"1.0\" encoding=\"".$this->encoding."\"?>\n";
$feed.= $this->_createGeneratorComment();
$feed.= $this->_createStylesheetReferences();
$feed.= "<feed xmlns=\"http://www.w3.org/2005/Atom\"";
Method createPreview
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createPreview($newHeight,$newWidth)
{
if (empty($newHeight) && empty($newWidth)) {
$newHeight = 275;
$newWidth = 250;
Method _prepare_post_body
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _prepare_post_body($formvars, $formfiles)
{
settype($formvars, "array");
settype($formfiles, "array");
Method createFeed
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createFeed() {
$feed = "<?xml version=\"1.0\" encoding=\"".$this->encoding."\"?>\n";
$feed.= $this->_createGeneratorComment();
$feed.= $this->_createStylesheetReferences();
$feed.= "<feed version=\"0.3\" xmlns=\"http://purl.org/atom/ns#\"";
Function _setFormat
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function _setFormat($format) {
switch (strtoupper($format)) {
case "2.0":
// fall through
- 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 _setFormat
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _setFormat($format) {
switch (strtoupper($format)) {
case "2.0":
// fall through
Function _set_navigation
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _set_navigation() {
$('#lightbox-nav').show();
// Instead to define this configuration in CSS file, we define here. And it�s need to IE. Just.
$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });
Function setVideoVersions
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function setVideoVersions($video, $entry, $namespaces)
{
$ns_media = $entry->children($namespaces['media']);
$versions = $ns_media->group->content;
- 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 __toString
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function __toString()
{
$hour = substr($this->getValue(), 0, 2);
if ($hour >= 12) {
$ampm = 'pm';
- 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 FeedDate
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function FeedDate($dateString="") {
if ($dateString=="") $dateString = date("r");
if (is_numeric($dateString)) {
$this->unix = $dateString;
Function createFeed
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function createFeed() {
$feed = "<?xml version=\"1.0\" encoding=\"".$this->encoding."\"?>\n";
$feed.= $this->_createGeneratorComment();
$feed.= $this->_createStylesheetReferences();
$feed.= "<feed xmlns=\"http://www.w3.org/2005/Atom\"";
- 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 objectToArray
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function objectToArray($item)
{
if (is_object($item)) {
$itemResult = array();
$ref = new \ReflectionClass($item);
- 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 client_data
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function client_data(info) {
if (info == 'width') {
width = (screen.width) ? screen.width : '';
height = (screen.height) ? screen.height : '';
width_height_html = width + " x " + height + " pixels";
- 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 ___getPageSize
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ___getPageSize() {
var xScroll, yScroll;
if (window.innerHeight && window.scrollMaxY) {
xScroll = window.innerWidth + window.scrollMaxX;
yScroll = window.innerHeight + window.scrollMaxY;
Method _setMIME
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _setMIME($format) {
switch (strtoupper($format)) {
case "2.0":
// fall through
Method _connect
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _connect(&$fp)
{
if(!empty($this->proxy_host) && !empty($this->proxy_port))
{
$this->_isproxy = true;
Function _resize_container_image_box
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _resize_container_image_box(intImageWidth,intImageHeight) {
// Get current width and height
var intCurrentWidth = $('#lightbox-container-image-box').width();
var intCurrentHeight = $('#lightbox-container-image-box').height();
//Adjust the image size to fit within the viewport
Function qp_enc
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function qp_enc($input = "", $line_max = 76) {
$hex = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
$lines = preg_split("/(?:\r\n|\r|\n)/", $input);
$eol = "\r\n";
$escape = "=";
- 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"