howardjones/network-weathermap

View on GitHub

Showing 380 of 1,093 total issues

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

    private function buildOverlibPositioning($mapItem, $midX, $mapCenterX, $midY, $mapCenterY)
    {
        $left = '';
        $above = '';
        $imageExtraHTML = '';
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 addPoint has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function addPoint($x, $y)
    {
        MapUtility::debug("Adding point $x,$y to '$this->name'\n");

        if (is_null($this->minimumX) || $x < $this->minimumX) {
Severity: Minor
Found in lib/Weathermap/Core/BoundingBox.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 help_handler has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function help_handler(e) {
    var objectid = jQuery(this).attr('id');
    var section = objectid.slice(0, objectid.indexOf('_'));
    var target = section + '_help';
    var helptext = "undefined";
Severity: Minor
Found in editor-resources/editor.js - 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 getNodeFromID has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function getNodeFromID(id) {
    for (var nodename in mapdata.Nodes) {
        if (mapdata.Nodes.hasOwnProperty(nodename)) {
            var node = mapdata.Nodes[nodename];
            if (node.id === id) {
Severity: Minor
Found in editor-resources/editor.js - 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 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 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 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 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 loadBackgroundImage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function loadBackgroundImage()
    {
        $bgImageRef = null;

        // do the basic prep work
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 make_target_string has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function make_target_string($local_data_id, $dsnames, $multiply, $multiplier)
{
    $new_target = sprintf("dsstats:%d:%s:%s", $local_data_id, $dsnames[IN], $dsnames[OUT]);
    $m = $multiply * $multiplier;

Severity: Minor
Found in random-bits/convert-to-dsstats.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 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 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 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 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

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

Severity
Category
Status
Source
Language