Showing 380 of 1,093 total issues
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 handleNODE_USESCALE
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function handleNODE_USESCALE($fullcommand, $args, $matches)
{
$svar = '';
$stype = 'percent';
// in or out?
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);
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 drawBandwidthLabels
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function drawBandwidthLabels($gdImage)
{
MapUtility::debug('Link ' . $this->name . ": Drawing bwlabels.\n");
$directions = $this->getDirectionList();
Method drawArtificialIcon
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function drawArtificialIcon(&$map, $labelColour)
{
MapUtility::debug('Artificial Icon type ' . $this->iconfile . " for $this->name\n");
// this is an artificial icon - we don't load a file for it
Method addNode
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addNode($x, $y, $nodeName = "", $template = "DEFAULT")
{
if (!$this->isLoaded()) {
throw new WeathermapInternalFail("Map must be loaded before editing API called.");
}
Method mapReadOnlySettings
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function mapReadOnlySettings(
$id,
$title = ''
) {
if ($title == '') {
Method cloneNode
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function cloneNode($sourceNodeName, $targetName = "", $orFail = false)
{
if (!$this->isLoaded()) {
throw new WeathermapInternalFail("Map must be loaded before editing API called.");
}
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const groups = Object.keys(this.props.groups).map((key, index) => {
const group = this.props.groups[key];
Function updateView
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateView() {
if (this.state.redirect === true) {
this.setState({
redirect: false
});
Method readData
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function readData($targetString, &$map, &$mapItem)
{
$this->data[IN] = null;
$this->data[OUT] = null;
Method draw
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function draw($gdImage)
{
if (is_null($this->curvePoints)) {
throw new WeathermapInternalFail('DrawingEmptySpline');
}
Method generateFontSampleImage
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function generateFontSampleImage($map)
{
$keyFontNumber = 2;
$keyFont = $map->fonts->getFont($keyFontNumber);
$keyHeight = imagefontheight($keyFontNumber) + 2;
Method drawOneFullMap
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function drawOneFullMap($map)
{
$htmlFileName = $this->outputDirectory . DIRECTORY_SEPARATOR . $map->filehash . ".html";
$mapTitle = $this->getMapTitle($map);
print '<div class="weathermapholder" id="mapholder_' . $map->filehash . '">';
Method handleSettingsAPI
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handleSettingsAPI($request, $appObject)
{
header('Content-type: application/json');
$styleTextOptions = array("thumbs", "full", "full-first-only");
Function checkPaths
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function checkPaths()
{
$version = explode('.', PHP_VERSION);
self::$phpTag = "php-" . $version[0] . "." . $version[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 processStringFindReferredObject
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function processStringFindReferredObject(&$context, $itemname, $type)
{
if (($itemname == "this") && ($type == strtolower($context->myType()))) {
return $context;
}
- 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 MapCollection
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const MapCollection = (props) => {
if (props.group_id === 'default' && props.maps[0]) {
return (
<Redirect to={`/group/${props.maps[0].group_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 updateView
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
updateView() {
if (this.state.redirect === true) {
this.setState({
redirect: false
});
- 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"