Showing 380 of 1,093 total issues
Method initializeDatabase
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function initializeDatabase()
{
// only bother with all this if it's a new install, a new version, or we're in a development version
// - saves a handful of db hits per request!
Function updateNode
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function updateNode($nodeName, $params)
{
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
Method testProcessString
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testProcessString()
{
global $weathermap_debugging;
Method permissionsList
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function permissionsList(
$id
) {
$map = $this->manager->getMap($id);
$title = $map->titlecache;
Method testNotes
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testNotes()
{
$testSuiteRoot = realpath(dirname(__FILE__) . "/../../../") . "/test-suite";
$map = new Map();
Method testLinkProperties
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testLinkProperties()
{
$editor = new Editor();
$editor->newConfig();
Function readData
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function readData($targetString, &$map, &$mapItem)
{
$this->data[IN] = null;
$this->data[OUT] = 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 testIndexOrphans
has a Cognitive Complexity of 17 (exceeds 5 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";
- 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 drawLabelRotated
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function drawLabelRotated($imageRef, $centre, $degreesAngle, $text, $padding, $direction)
{
$fontObject = $this->owner->fonts->getFont($this->bwfont);
list($strWidth, $strHeight) = $fontObject->calculateImageStringSize($text);
Method imagecreatefromfile
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function imagecreatefromfile($filename)
{
$resultImage = null;
$newImage = null;
Method handleGroupSelect
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handleGroupSelect(
$request,
$appObject
) {
$this->cactiHeader();
Method handleMapGroupChangeForm
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handleMapGroupChangeForm(
$request,
$appObject
) {
$this->cactiHeader();
Method configlist
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function configlist()
{
self::checkPaths();
$summaryFileName = self::$testSuiteDirectory . DIRECTORY_SEPARATOR . "summary.html";
Method testConfigOutput
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testConfigOutput($configFileName, $referenceImageFileName)
{
$outputImageFileName = self::$result1Directory . DIRECTORY_SEPARATOR . $configFileName . ".png";
$comparisonImageFileName = self::$diffsDirectory . DIRECTORY_SEPARATOR . $configFileName . ".png";
$outputHTMLFileName = self::$result1Directory . DIRECTORY_SEPARATOR . $configFileName . ".html";
Function render
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let contents = null;
if (this.state.loaded) {
Function testCronPart
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public static function testCronPart($value, $checkstring)
{
if ($checkstring == '*') {
return true;
}
- 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 compareImages
has a Cognitive Complexity of 16 (exceeds 5 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));
- 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 calculateAICONColours
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private function calculateAICONColours($labelColour, &$map)
{
$finalFillColour = new Colour('none');
$finalInkColour = new Colour('none');
- 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 handleNODES
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private function handleNODES($fullcommand, $args, $matches)
{
$offsetDX = array();
$offsetDY = array();
$nodeNames = array();
- 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 getMapFileList
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private function getMapFileList()
{
$files = array();
$valid_files = array();
- 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"