Showing 380 of 1,093 total issues
Method handleManagementMainScreen
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handleManagementMainScreen($request, $appObject)
{
global $wm_showOldUI, $config;
$weathermapPath = $config['url_path'] . 'plugins/weathermap/';
Method drawArtificialIconPie
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function drawArtificialIconPie($iconImageRef, $finalFillColour, $finalInkColour, $channel)
{
$percentValue = $this->percentUsages[$channel];
$segmentAngle = MathUtility::clip(($percentValue / 100) * 360, 1, 360);
Method readData
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function readData($targetString, &$map, &$mapItem)
{
$this->data[IN] = null;
$this->data[OUT] = null;
Method handleInheritance
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function handleInheritance($inheritables, $params)
{
$defaultLink = $this->map->getLink("DEFAULT");
$defaultNode = $this->map->getNode("DEFAULT");
Method testNodeProperties
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testNodeProperties()
{
$editor = new Editor();
$editor->newConfig();
Method createThumbnailFile
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function createThumbnailFile($thumbnailFileName, $thumbnailMaxSize, $imageRef)
{
MapUtility::debug("Writing thumbnail to $thumbnailFileName\n");
if (!function_exists('imagecopyresampled')) {
Method handleDefaultView
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handleDefaultView($request, $appObject)
{
global $wm_showOldUI, $config;
$weathermapPath = $config['url_path'] . 'plugins/weathermap/';
Function deleteNode
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function deleteNode($nodeName)
{
if (!$this->isLoaded()) {
throw new WeathermapInternalFail("Map must be loaded before editing API called.");
}
- 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 readDataFromFile
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function readDataFromFile($targetstring, $matchvalue, $matchperiod)
{
$fd = fopen($targetstring, "r");
if ($fd) {
- 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 click_handler
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function click_handler(e) {
var alt, objectname, objecttype, objectid, map_object;
alt = jQuery(this).attr("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 mapSettings
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function mapSettings(
$id
) {
if ($id == 0) {
$title = __('Additional settings for ALL maps');
- 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 permissionsList
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function permissionsList(
$id
) {
$map = $this->manager->getMap($id);
$title = $map->titlecache;
- 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 __construct
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct()
{
$this->alpha = 255;
// a set of 3 colours
Method getMapFileList
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getMapFileList()
{
$files = array();
$valid_files = array();
Method renameNode
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function renameNode($oldName, $newName)
{
if (!$this->map->nodeExists($oldName)) {
return $oldName;
}
Method getConfig
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getConfig()
{
assert(isset($this->owner));
$output = '';
Method outputHTML
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function outputHTML()
{
if ($this->htmlFile != '') {
MapUtility::debug("Writing HTML to $this->htmlFile\n");
Function render
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let higher = <div/>
if (this.props.scope === 'map') {
Method testMapSettings
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testMapSettings()
{
$settings = $this->manager->getMapSettings(0);
$this->assertEquals(1, count($settings));
Method generateSortedImagemap
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function generateSortedImagemap($imagemapname)
{
$html = "\n<map name=\"" . $imagemapname . '" id="' . $imagemapname . "\">\n";
$allLayers = array_keys($this->seenZLayers);