Showing 701 of 9,653 total issues
Function _mediumPhotoTreatment
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function _mediumPhotoTreatment($photoName, $filePath = null, $mediumFilePath = null)
{
/** @var Extgallery\Helper $helper */
$helper = Extgallery\Helper::getInstance();
- 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 getModuleOption
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function getModuleOption($option)
{
global $xoopsModule;
/** @var \XoopsModules\Extgallery\Helper $helper */
$helper = \XoopsModules\Extgallery\Helper::getInstance();
- 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 DrawCharacters
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function DrawCharacters()
{
$iShadowColour = '';
// loop through and write out selected number of characters
for ($i = 0, $iMax = mb_strlen($this->sCode); $i < $iMax; ++$i) {
- 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 rescale
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
rescale : function( width, height, complete ) {
var self = this;
// allow rescale(fn)
Function Video
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Video = function( type, id ) {
for( var i=0; i<_video._inst.length; i++ ) {
if ( _video._inst[i].id === id && _video._inst[i].type == type ) {
return _video._inst[i];
Function Video
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Video = function( type, id ) {
for( var i=0; i<_video._inst.length; i++ ) {
if ( _video._inst[i].id === id && _video._inst[i].type == type ) {
return _video._inst[i];
Function _get_zoom_to
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
_get_zoom_to = function () {
var view = _get_viewport(),
to = {},
resize = currentOpts.autoScale,
double_padding = currentOpts.padding * 2,
Function ccmValidateBlockForm
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ccmValidateBlockForm() {
if ($('#magnific_type').val() == 'select1') {
ccm_addError(ccm_t('selection-required'));
}
Method _parseShortOption
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected static function _parseShortOption($arg, $short_options, &$opts, &$argIdx, $args, $skip_unknown)
{
for ($i = 0, $iMax = strlen($arg); $i < $iMax; ++$i) {
$opt = $arg[$i];
$opt_arg = null;
Method get_public_slide
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_public_slide()
{
// get the image url (and handle cropping)
// disable wp_image_editor if metadata does not exist for the slide
$imageHelper = new MetaSliderImageHelper($this->slide->ID, $this->settings['width'], $this->settings['height'], isset($this->settings['smartCrop']) ? $this->settings['smartCrop'] : 'false', $this->use_wp_image_editor());
Method which
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function which($program, $fallback = false)
{
// enforce API
if (!is_string($program) || '' == $program) {
return $fallback;
Method mktemp
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function mktemp($args = null)
{
static $first_time = true;
$opts = self::_parseArgs($args, 't:d');
if (PEAR::isError($opts)) {
Method getDescendants
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getDescendants(
$id = 0,
$includeSelf = false,
$childrenOnly = false,
$withRestrict = true,
Method getDescendants
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getDescendants($id = 0, $includeSelf = false, $childrenOnly = false)
{
$idField = $this->fields['id'];
$node = $this->getNode($id);
Method TrFctStart
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function TrFctStart($p_file, $p_line, $p_name, $p_param = '', $p_message = '')
{
global $g_pcl_trace_level;
global $g_pcl_trace_mode;
global $g_pcl_trace_filename;
Function complete
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
complete: function( thumb ) {
// shrink thumbnails to fit
var top = ['left', 'top'],
arr = ['Width', 'Height'],
Function complete
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
complete: function( thumb ) {
// shrink thumbnails to fit
var top = ['left', 'top'],
arr = ['Width', 'Height'],
Function loop
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
loop: function() {
var distance = this.to - this.pos,
factor = 1;
Function buildImage
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildImage: function(imageData, isSync) {
var gallery = this;
var nextIndex = this.getNextIndex(imageData.index);
// Construct new hidden span for the image
Function _finish
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
_finish = function () {
if (!$.support.opacity) {
content.get(0).style.removeAttribute('filter');
wrap.get(0).style.removeAttribute('filter');
}