Showing 9,653 of 9,653 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
'copyBlankFiles' => [
XOOPS_UPLOAD_PATH . '/' . $moduleDirName,
XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/public-photo',
XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/public-photo/original',
XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/public-photo/large',
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 110.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ( typeof Galleria.Picasa.prototype[ picasa[0] ] !== 'function' ) {
Galleria.raise( picasa[0] + ' method not found in Picasa plugin' );
return load.apply( this, args );
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 64.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ( typeof Galleria.Flickr.prototype[ flickr[0] ] !== 'function' ) {
Galleria.raise( flickr[0] + ' method not found in Flickr plugin' );
return load.apply( this, args );
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 64.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function enter
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
enter: function( callback ) {
fullscreen.beforeEnter(function() {
callback = fullscreen.parseCallback( callback, true );
Function enter
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
enter: function(callback) {
// hide the image until rescale is complete
Utils.hide( self.getActiveImage() );
Function enter
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
enter: function( callback ) {
fullscreen.beforeEnter(function() {
callback = fullscreen.parseCallback( callback, true );
Function complete
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
var complete = function() {
// remove stalled
self._queue.stalled = false;
Function _initSlidesFromAnchors
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _initSlidesFromAnchors( $tos, $anchors, $wrpr, $sldr, opts )
{
getZoomAnchors( $anchors, opts ).addClass( cls( 'zoom' ) );
$anchors
Function _close
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
_close: function() {
_mfpTrigger(CLOSE_EVENT);
var classesToRemove = REMOVING_CLASS + ' ' + READY_CLASS + ' ';
Function attach
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
attach: function (context, settings) {
settings.magnific_popup = settings.magnific_popup || {common_options: {}, common_options_iframe: {}};
var common_options = settings.magnific_popup.common_options || {};
var common_options_iframe = settings.magnific_popup.common_options_iframe || {};
// Allow modules to extend the set of patterns we support via iframe.
Function rebuildThumbs
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
rebuildThumbs: function() {
var needsPagination = this.data.length > this.numThumbs;
// Rebuild top pager
if (this.enableTopPager) {
Method _convert_image_type
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _convert_image_type($type)
{
switch (mb_strtolower($type)) {
case 'gif':
return IMAGETYPE_GIF;
Method PclTarHandleCreate
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function PclTarHandleCreate($p_tarname, $p_list, $p_mode, $p_add_dir = '', $p_remove_dir = '')
{
TrFctStart(__FILE__, __LINE__, 'PclTarHandleCreate', "tar=$p_tarname, list, mode=$p_mode, add_dir='$p_add_dir', remove_dir='$p_remove_dir'");
$v_result = 1;
$v_list_detail = [];
Method __construct
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct()
{
parent::__construct();
$this->initVar('photo_id', \XOBJ_DTYPE_INT, null, false);
$this->initVar('cat_id', \XOBJ_DTYPE_INT, 0, false);
Method TrFctEnd
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function TrFctEnd($p_file, $p_line, $p_return = 1, $p_message = '')
{
global $g_pcl_trace_level;
global $g_pcl_trace_mode;
global $g_pcl_trace_filename;
Function get_javascript_parameters
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function get_javascript_parameters()
{
$options = [];
// construct an array of all parameters
- 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 moduleLastVersionInfo
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function moduleLastVersionInfo()
{
static $result;
if (isset($result)) {
- 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 gal_getmoduleoption
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function gal_getmoduleoption($option)
{
global $xoopsModuleConfig, $xoopsModule;
static $tbloptions = [];
if (is_array($tbloptions) && array_key_exists($option, $tbloptions)) {
- 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 _generate
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function _generate($filename, $type = '', $quality = null)
{
$type = mb_strtolower(('' == $type) ? $this->type : $type);
$options = is_array($quality) ? $quality : [];
switch ($type) {
- 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 mktemp
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function mktemp($args = null)
{
static $first_time = true;
$opts = self::_parseArgs($args, 't:d');
if (PEAR::isError($opts)) {
- 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"