Showing 380 of 1,093 total issues
Function runOutputTest
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function runOutputTest($iconFileName, $imageFileName, $htmlFileName, $newConfigFileName)
{
$map = new Map();
$map->readConfig($iconFileName);
- 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 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();
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 processStringToken
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function processStringToken($includeNotes, $keyContents, $key, $context)
{
$value = '[UNKNOWN]';
$format = "";
$theItem = null;
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 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 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 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 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 testKeywordCoverage
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testKeywordCoverage()
{
$docsIndex = $this->docsRoot . "/index.xml";
Method handleMapSettingsSave
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handleMapSettingsSave(
$request,
$appObject
) {
$mapid = null;
Method readData
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function readData($targetString, &$map, &$mapItem)
{
$pdo = null;
$this->data[IN] = null;
$this->data[OUT] = null;
Method createColorizePalette
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function createColorizePalette($red, $green, $blue)
{
// We will create a monochromatic palette based on the input color
// which will go from black to white
Method readData
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function readData(&$map, &$mapItem)
{
MapUtility::debug("ReadData for $mapItem ($this->pluginName $this->pluginRunnable)\n");
if (!$this->pluginRunnable) {
MapUtility::debug("Plugin %s isn't runnable\n", $this->pluginName);