howardjones/network-weathermap

View on GitHub

Showing 463 of 1,093 total issues

Function replicateLegendSettings has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function replicateLegendSettings()
    {
        foreach ($this->legends as $scaleName => $legendObject) {
            // These are currently global settings for a map, not per-scale
            $legendObject->keyoutlinecolour = $this->colourtable['KEYOUTLINE'];
Severity: Minor
Found in lib/Weathermap/Core/Map.php - About 25 mins to fix

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 writeDataFile has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function writeDataFile($filename)
    {
        if ($filename == '') {
            return;
        }
Severity: Minor
Found in lib/Weathermap/Core/Map.php - About 25 mins to fix

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 handleSET has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function handleSET($fullcommand, $args, $matches)
    {
        global $weathermap_error_suppress;

        $key = null;
Severity: Minor
Found in lib/Weathermap/Core/ConfigReader.php - About 25 mins to fix

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 aggregateDataResults has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function aggregateDataResults()
    {
        $channels = $this->getChannelList();

        foreach ($channels as $channelName => $channel) {
Severity: Minor
Found in lib/Weathermap/Core/MapDataItem.php - About 25 mins to fix

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 handleNODE_USESCALE has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function handleNODE_USESCALE($fullcommand, $args, $matches)
    {
        $svar = '';
        $stype = 'percent';
        // in or out?
Severity: Minor
Found in lib/Weathermap/Core/ConfigReader.php - About 25 mins to fix

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 addConfigValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function addConfigValue($keyname, $value, $recalculate = false)
    {
        MapUtility::debug("Appending config %s = %s\n", $keyname, $value);
        if (is_null($this->config[$keyname])) {
            // create a new array, with this as the only item
Severity: Minor
Found in lib/Weathermap/Core/MapBase.php - About 25 mins to fix

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 formatTimeTicks has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function formatTimeTicks($value, $prefix, $tokenCharacter, $precision)
    {
        $joinCharacter = ' ';
        if ($prefix == '-') {
            $joinCharacter = '';
Severity: Minor
Found in lib/Weathermap/Core/StringUtility.php - About 25 mins to fix

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 handleNODE has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function handleNODE($fullcommand, $args, $matches)
    {
        $this->commitItem();
        unset($this->currentObject);

Severity: Minor
Found in lib/Weathermap/Core/ConfigReader.php - About 25 mins to fix

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 handleLINK has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function handleLINK($fullcommand, $args, $matches)
    {
        $this->commitItem();
        unset($this->currentObject);

Severity: Minor
Found in lib/Weathermap/Core/ConfigReader.php - About 25 mins to fix

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 sprintf has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function sprintf($format, $value, $kilo = 1000)
    {
        // if we get a null, it probably means no-data from the datasource plugin
        // don't coerce that into a zero
        if ($value === null) {
Severity: Minor
Found in lib/Weathermap/Core/StringUtility.php - About 25 mins to fix

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 getHintConfig has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getHintConfig($comparison)
    {
        $output = '';
        foreach ($this->hints as $hintName => $hint) {
            // all hints for DEFAULT node are for writing
Severity: Minor
Found in lib/Weathermap/Core/MapBase.php - About 25 mins to fix

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 handleTEMPLATE has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function handleTEMPLATE($fullcommand, $args, $matches)
    {
        $templateName = $matches[1];

        if (($this->currentType == 'NODE' && isset($this->mapObject->nodes[$templateName]))
Severity: Minor
Found in lib/Weathermap/Core/ConfigReader.php - About 25 mins to fix

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 imagecreatescaledfromfile has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function imagecreatescaledfromfile($filename, $scaleWidth, $scaleHeight)
    {
        list($width, $height) = getimagesize($filename);

        MapUtility::debug("Getting a (maybe cached) image for $filename at $scaleWidth x $scaleHeight\n");
Severity: Minor
Found in lib/Weathermap/Core/ImageLoader.php - About 25 mins to fix

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 drawComments has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function drawComments($gdImage)
    {
        MapUtility::debug('Link ' . $this->name . ": Drawing comments.\n");

        $directions = $this->getDirectionList();
Severity: Minor
Found in lib/Weathermap/Core/MapLink.php - About 25 mins to fix

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 warn has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function warn($string, $noticeOnly = false)
    {
        global $weathermap_map;
        global $weathermap_warncount;
        global $weathermap_error_suppress;
Severity: Minor
Found in lib/Weathermap/Core/MapUtility.php - About 25 mins to fix

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 getPluginFileList has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function getPluginFileList($pluginType, $searchDirectory)
    {
        $pluginList = array();

        $directoryHandle = $this->resolveDirectoryAndOpen($searchDirectory);
Severity: Minor
Found in lib/Weathermap/Core/PluginManager.php - About 25 mins to fix

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 weathermap_show_tab has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function weathermap_show_tab()
{
    global $config, $user_auth_realm_filenames;

    if (api_plugin_user_realm_auth('weathermap-cacti10-plugin.php')) {
Severity: Minor
Found in lib/Weathermap/Integrations/Cacti/cacti10-plugin-hooks.php - About 25 mins to fix

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 resortMaps has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function resortMaps()
    {
        $stmt = $this->pdo->query('SELECT * FROM weathermap_maps ORDER BY group_id,sortorder;');

        $newMapOrder = array();
Severity: Minor
Found in lib/Weathermap/Integrations/MapManager.php - About 25 mins to fix

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 cmdDrawMap has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function cmdDrawMap($params, $editor)
    {
        header("Content-type: image/png");
        // If the config file hasn't changed, then the image produced shouldn't have, either
        $etag = md5_file($this->mapFileName);
Severity: Minor
Found in lib/Weathermap/Editor/EditorUI.php - About 25 mins to fix

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 showMainPage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function showMainPage($editor)
    {
        global $hostPluginURL;
        global $hostEditorURL;
        global $hostType;
Severity: Minor
Found in lib/Weathermap/Editor/EditorUI.php - About 25 mins to fix

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

Severity
Category
Status
Source
Language