Showing 380 of 1,093 total issues
Method calculateCommentPosition
has 33 lines of code (exceeds 25 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
Method outputTestHTML
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function outputTestHTML($htmlfile, &$map)
{
$fd = fopen($htmlfile, 'w');
fwrite(
$fd,
Method resolveRelativePositions
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function resolveRelativePositions()
{
// calculate any relative positions here - that way, nothing else
// really needs to know about them
Method testScaleManagement
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testScaleManagement()
{
$this->object->populateDefaultsIfNecessary();
$this->assertEquals(9, $this->object->spanCount());
Method resolveRelativePosition
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function resolveRelativePosition($anchorNode)
{
$anchorPosition = $anchorNode->getPosition();
if ($this->polar) {
Method selfValidate
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function selfValidate()
{
$classes = array(
'GLOBAL' => 'Weathermap\\Core\\Map',
'LINK' => 'Weathermap\\Core\\MapLink',
Method testTidy
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testTidy()
{
$editor = new Editor();
$editor->newConfig();
Method weathermap_poller_bottom
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function weathermap_poller_bottom()
{
global $config;
global $weathermapPollerStartTime;
Method translateRuntimeOptionsToSettings
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function translateRuntimeOptionsToSettings()
{
global $weathermap_error_suppress;
$this->configFile = $this->getOpt->getOption('config');
Method testIndexOrphans
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testIndexOrphans()
{
# Check that all the little config XML files actually appear somewhere in the index.xml
$docsIndex = $this->docsRoot . "/index.xml";
Method drawRealIcon
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function drawRealIcon(&$map, $iconColour)
{
$this->iconfile = $map->processString($this->iconfile, $this);
MapUtility::debug('Actual image-based icon from ' . $this->iconfile . " for $this->name\n");
Function render
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
if (!this.state.map) {
return <div className='wm-map-properties-container wm-popup'>No such map? (or loading)</div>
}
Method updateLink
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function updateLink($linkName, $params)
{
if (!$this->isLoaded()) {
throw new WeathermapInternalFail("Map must be loaded before editing API called.");
}
Function show_link
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function show_link(name) {
mapmode('existing');
hide_all_dialogs();
- 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 configlist
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function configlist()
{
self::checkPaths();
$summaryFileName = self::$testSuiteDirectory . DIRECTORY_SEPARATOR . "summary.html";
- 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 drawLegendVertical
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function drawLegendVertical($keyHeight = 400, $inverted = false)
{
$title = $this->keytitle;
$nScales = $this->scale->spanCount();
- 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 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 importMapSettings
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function importMapSettings($map)
{
global $weathermap_error_suppress;
# in the order of precedence - global extras, group extras, and finally map extras
- 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 createThumbnailFile
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function createThumbnailFile($thumbnailFileName, $thumbnailMaxSize, $imageRef)
{
MapUtility::debug("Writing thumbnail to $thumbnailFileName\n");
if (!function_exists('imagecopyresampled')) {
- 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 drawBandwidthLabels
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function drawBandwidthLabels($gdImage)
{
MapUtility::debug('Link ' . $this->name . ": Drawing bwlabels.\n");
$directions = $this->getDirectionList();
- 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"