Showing 9,653 of 9,653 total issues
Function extgalleryAjax
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function extgalleryAjax($options)
{
$photos = [];
/** @var Extgallery\PhotoHandler $photoHandler */
$photoHandler = Extgallery\Helper::getInstance()->getHandler('PublicPhoto');
- 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 getDescendants
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function getDescendants($id = 0, $includeSelf = false, $childrenOnly = false)
{
$idField = $this->fields['id'];
$node = $this->getNode($id);
- 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 getDescendants
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function getDescendants(
$id = 0,
$includeSelf = false,
$childrenOnly = false,
$withRestrict = true,
- 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 load
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Galleria.prototype.load = function() {
// pass if no data is provided or picasa option not found
if ( arguments.length || typeof this._options.picasa !== 'string' ) {
load.apply( this, Galleria.utils.array( arguments ) );
Function init
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function (options) {
Galleria.requires(1.33, 'This version of Classic theme requires Galleria 1.3.3 or later');
// add some elements
Function init
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function (options) {
Galleria.requires(1.33, 'This version of Classic theme requires Galleria 1.3.3 or later');
// add some elements
Identical blocks of code found in 2 locations. Consider refactoring. Open
$.each( _events, function( i, ev ) {
// legacy events
var type = /_/.test( ev ) ? ev.replace( /_/g, '' ) : ev;
- 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 76.
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
$.each( _events, function( i, ev ) {
// legacy events
var type = /_/.test( ev ) ? ev.replace( /_/g, '' ) : ev;
- 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 76.
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 slideshow
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function slideshow() {
var
timeOut,
className = prefix + "Slideshow_",
click = "click." + prefix,
Method factory
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function &factory($driver = '')
{
if ('' == $driver) {
$extensions = [
'imagick' => 'Imagick3',
Function _exit
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
_exit: function( callback ) {
fullscreen.active = false;
var inBrowser = !self._options.trueFullscreen || !_nativeFullscreen.support,
Function _exit
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
_exit: function( callback ) {
fullscreen.active = false;
var inBrowser = !self._options.trueFullscreen || !_nativeFullscreen.support,
Function FlameViewportScale
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
function FlameViewportScale() {
this.delay = 600; // Delay after calling update to account for viewport bounce
this.orientation;
this.screenWidth; // Screen width corrected for orientation
this.timeout;
Method getAll
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function &getAll(CriteriaElement $criteria = null, $fields = null, $asObject = true, $id_as_key = true)
{
if ($fields && \is_array($fields)) {
if (!\in_array($this->handler->keyName, $fields)) {
$fields[] = $this->handler->keyName;
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (this.$controlsContainer) {
this.$controlsContainer
.find('div.ss-controls a').removeClass().addClass('play')
.attr('title', this.playLinkText)
.attr('href', '#play')
- 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 75.
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 (this.$controlsContainer) {
this.$controlsContainer
.find('div.ss-controls a').removeClass().addClass('pause')
.attr('title', this.pauseLinkText)
.attr('href', '#pause')
- 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 75.
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 addTheme
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Galleria.addTheme = function( theme ) {
// make sure we have a name
if ( !theme.name ) {
Galleria.raise('No theme name specified');
Function addTheme
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Galleria.addTheme = function( theme ) {
// make sure we have a name
if ( !theme.name ) {
Galleria.raise('No theme name specified');
Method _parseLongOption
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected static function _parseLongOption($arg, $long_options, &$opts, &$argIdx, $args, $skip_unknown)
{
@list($opt, $opt_arg) = explode('=', $arg, 2);
$opt_len = strlen($opt);
Method render
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render()
{
// load all child ids for javascript codes
foreach (\array_keys($this->_itemTree) as $item_id) {
$this->_itemTree[$item_id]['allchild'] = [];