Showing 380 of 1,093 total issues
Method testObjects
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testObjects()
{
$table = new FontTable();
$this->assertEquals(0, $table->count());
Function MapCollection
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
const MapCollection = (props) => {
if (props.group_id === 'default' && props.maps[0]) {
return (
<Redirect to={`/group/${props.maps[0].group_id}`}/>
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 drawTimestamp
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function drawTimestamp($imageRef, $font, $colour, $which = '')
{
// add a timestamp to the corner, so we can tell if it's all being updated
$fontObject = $this->fonts->getFont($font);
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 mapReadOnlySettings
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function mapReadOnlySettings(
$id,
$title = ''
) {
if ($title == '') {
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 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 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;
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];
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 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"
Further reading
Function translateRuntimeOptionsToSettings
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function translateRuntimeOptionsToSettings()
{
global $weathermap_error_suppress;
$this->configFile = $this->getOpt->getOption('config');
- 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 copyFrom
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function copyFrom(&$source)
{
MapUtility::debug("Initialising %s $this->name from $source->name\n", $this->myType());
assert(is_object($source));
- 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"