Showing 380 of 1,093 total issues
Function getConfigSimple
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function getConfigSimple($simpleParameters, $comparison)
{
$output = '';
# TEMPLATE must come first. 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
Function findIndexNearDistance
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function findIndexNearDistance($targetDistance)
{
$left = 0;
$right = count($this->elements) - 1;
- 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 weathermap_poller_bottom
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function weathermap_poller_bottom()
{
global $config;
global $weathermapPollerStartTime;
- 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 processStringToken
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function processStringToken($includeNotes, $keyContents, $key, $context)
{
$value = '[UNKNOWN]';
$format = "";
$theItem = null;
Function click_handler
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function click_handler(e) {
var alt, objectname, objecttype, objectid, map_object;
alt = jQuery(this).attr("id");
Method testTidyAll
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testTidyAll()
{
$editor = new Editor();
$editor->newConfig();
Function show_node
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function show_node(name) {
mapmode('existing');
hide_all_dialogs();
Method getAvailableImages
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getAvailableImages($imageDirectory, $map)
{
$imageList = array();
if (is_dir($imageDirectory)) {
Method getExistingConfigs
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getExistingConfigs($mapDirectory)
{
$titles = array();
$notes = array();
Method weathermap_show_tab
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function weathermap_show_tab()
{
global $config, $user_auth_realm_filenames;
$realmID = 0;
Method handleLinkStep1
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handleLinkStep1($request, $context = null)
{
global $config;
// $pdo = weathermap_get_pdo();
Method has_transparency
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function has_transparency($imageRef)
{
$width = imagesx($imageRef);
$height = imagesy($imageRef);
$im2 = imagecreate($width, $height);
Method ReadData
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function ReadData($targetString, &$map, &$mapItem)
{
// By default, fail.
// Remove these 4 lines ONLY if you understand the risks, and have taken appropriate measures
// so that users (or the public) can't access your map editor! Otherwise they can run
Method compareImages
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function compareImages($src, $copy, $type)
{
$this->assertEquals(imagesx($src), imagesx($copy));
$this->assertEquals(imagesy($src), imagesy($copy));
$this->assertEquals(imageistruecolor($src), imageistruecolor($copy));
Method testKeywordCoverage
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testKeywordCoverage()
{
$docsIndex = $this->docsRoot . "/index.xml";
Method handleSCALE
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function handleSCALE($fullcommand, $args, $matches)
{
// The default scale name is DEFAULT
if ($matches[1] == '') {
Method handleMapSettingsSave
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handleMapSettingsSave(
$request,
$appObject
) {
$mapid = null;
Method drawTimestamp
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function drawTimestamp($imageRef, $font, $colour, $which = '')
{
// add a timestamp to the corner, so we can tell if it's all being updated
$fontObject = $this->fonts->getFont($font);
Method testObjects
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testObjects()
{
$table = new FontTable();
$this->assertEquals(0, $table->count());
Function MapCollection
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
const MapCollection = (props) => {
if (props.group_id === 'default' && props.maps[0]) {
return (
<Redirect to={`/group/${props.maps[0].group_id}`}/>