Showing 1,091 of 1,093 total issues
Function dispatchRequest
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function dispatchRequest($action, $request, $appObject)
{
if (!array_key_exists($action, $this->commands)) {
if (array_key_exists(":: DEFAULT ::", $this->commands)) {
$action = ":: DEFAULT ::";
- 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 drawMap
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$imageFileName = '',
$thumbnailFileName = '',
$thumbnailMaxSize = 250,
$includeNodes = true,
$showVIAOverlay = false,
Function findScaleHit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function findScaleHit($value)
{
$tag = '';
$smallestMatchColour = null;
$smallestMatchSize = null;
- 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 hitTest
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function hitTest($x, $y)
{
$c = false;
// do the easy bounding-box test first.
if (($x < $this->minx) || ($x > $this->maxx) || ($y < $this->miny) || ($y > $this->maxy)) {
- 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 render
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
render() {
let contents = null;
if (this.state.loaded) {
- 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 dataSelected
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function dataSelected(event) {
var newlocation;
var data_id = $(this).data("source-id");
var path = $(this).data("path");
- 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 drawArtificialIcon
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function drawArtificialIcon(&$map, $labelColour)
{
MapUtility::debug('Artificial Icon type ' . $this->iconfile . " for $this->name\n");
// this is an artificial icon - we don't load a file for it
- 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 ping
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function ping(&$item, $targetAddress, $pingCount)
{
if (!is_executable($this->fpingCommand)) {
MapUtility::warn("FPing ReadData: Can't find fping executable. Check path at line 36 of FPing");
return;
- 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 calculateCommentPosition
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function calculateCommentPosition($fontObject, $comment, $direction, $widthList)
{
list($textWidth, $textHeight) = $fontObject->calculateImageStringSize($comment);
// nudge pushes the comment out along the link arrow a little bit
- 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 drawImageString
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function drawImageString($gdImage, $x, $y, $string, $colour, $angle = 0)
Method drawLabelRotated
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private function drawLabelRotated($imageRef, $centre, $degreesAngle, $text, $padding, $direction)
Function prepareForDataCollection
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function prepareForDataCollection()
{
/** @var Target $target */
foreach ($this->targets as $target) {
MapUtility::debug("ProcessTargets: New Target: $target\n");
- 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 getConfigInOutOrBoth
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function getConfigInOutOrBoth($comparison, $configKeyword, $fieldName)
{
$output = '';
$myArray = $this->$fieldName;
$theirArray = $comparison->$fieldName;
- 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 readConfigSimpleAssignment
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function readConfigSimpleAssignment($keyword, $matches)
{
foreach ($keyword[1] as $key => $val) {
// so we can poke in numbers too, if the value starts with #
// then take the # off, and treat the rest as a number literal
- 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 initKeys
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
initKeys: function (that) {
$(document).keyup(function (event) {
if (event.keyCode === that.KEYCODE_ESCAPE) {
window.location.href = $('#cycle_stop').attr('href');
event.preventDefault();
- 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 testTidyAll
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function testTidyAll()
{
$editor = new Editor();
$editor->newConfig();
- 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 buildOverlibHTML
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private function buildOverlibHTML($mapItem, $dir, $imageExtraHTML, $left, $above, $caption)
Function mapReadOnlySettings
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function mapReadOnlySettings(
$id,
$title = ''
) {
if ($title == '') {
- 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
Avoid deeply nested control flow statements. Open
if ($size[0] > $this->minBGImageSize && $size[1] > $this->minBGImageSize) {
$bg = true;
}
Function weathermap_show_tab
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function weathermap_show_tab()
{
global $config, $user_auth_realm_filenames;
$realmID = 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"