librenms/librenms

View on GitHub

Showing 1,513 of 31,501 total issues

Method load_graph_definitions has 1568 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function load_graph_definitions($logarithmic = false, $tinylegend = false)
{
    global $GraphDefs, $MetaGraphDefs;

    $Canvas = 'FFFFFF';
Severity: Major
Found in includes/html/collectd/definitions.php - About 1 wk to fix

    File api_functions.inc.php has 2667 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    /*
     * LibreNMS
     *
    Severity: Major
    Found in includes/html/api_functions.inc.php - About 1 wk to fix

      File definitions.php has 1971 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      // vim:fenc=utf-8:filetype=php:ts=4
      /*
       * Copyright (C) 2009  Bruno Prémont <bonbons AT linux-vserver.org>
      Severity: Major
      Found in includes/html/collectd/definitions.php - About 5 days to fix

        File settings.php has 1765 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        return [
            'title' => 'Settings',
            'readonly' => 'Set in config.php, remove from config.php to enable.',
        Severity: Major
        Found in lang/en/settings.php - About 4 days to fix

          File settings.php has 1602 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          return [
              'title' => 'Settings',
              'readonly' => 'Set in config.php, remove from config.php to enable.',
          Severity: Major
          Found in lang/it/settings.php - About 4 days to fix

            File settings.php has 1585 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            
            return [
                'title' => 'Налаштування',
                'readonly' => 'Зазначено у config.php, для увімкнення видаліть з config.php.',
            Severity: Major
            Found in lang/uk/settings.php - About 4 days to fix

              Method rewriteHardware has 605 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function rewriteHardware()
                  {
                      $rewrite_ironware_hardware = [
                          'snFIWGSwitch' => 'Stackable FastIron workgroup',
                          'snFIBBSwitch' => 'Stackable FastIron backbone',
              Severity: Major
              Found in LibreNMS/OS/Ironware.php - About 3 days to fix

                File settings.php has 1153 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                
                return [
                    'readonly' => 'Dejà configuré dans config.php, le supprimer avant de pouvoir l\'éditer ici',
                    'groups' => [
                Severity: Major
                Found in lang/fr/settings.php - About 2 days to fix

                  File functions.inc.php has 1132 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  
                  /*
                   * LibreNMS Network Management and Monitoring System
                   * Copyright (C) 2006-2011, Observium Developers - http://www.observium.org
                  Severity: Major
                  Found in includes/discovery/functions.inc.php - About 2 days to fix

                    File settings.php has 1022 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    
                    return [
                        'readonly' => '在 config.php 裡被設定成唯讀,請由 config.php 移除它來啟用。',
                        'groups' => [
                    Severity: Major
                    Found in lang/zh-TW/settings.php - About 2 days to fix

                      Function discovery_process has a Cognitive Complexity of 126 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function discovery_process(&$valid, $os, $sensor_class, $pre_cache)
                      {
                          $discovery = $os->getDiscovery('sensors');
                          $device = $os->getDeviceArray();
                      
                      
                      Severity: Minor
                      Found in includes/discovery/functions.inc.php - About 2 days 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

                      File custom-edit.blade.php has 1002 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      @extends('layouts.librenmsv1')
                      
                      @section('title', __('map.custom.title.edit'))
                      
                      @section('content')
                      Severity: Major
                      Found in resources/views/map/custom-edit.blade.php - About 2 days to fix

                        Device has 121 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        class Device extends BaseModel
                        {
                            use PivotEventTrait, HasFactory;
                        
                            public $timestamps = false;
                        Severity: Major
                        Found in app/Models/Device.php - About 2 days to fix

                          File cape.inc.php has 943 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          <?php
                          
                          use LibreNMS\Exceptions\JsonAppException;
                          use LibreNMS\RRD\RrdDefinition;
                          
                          
                          Severity: Major
                          Found in includes/polling/applications/cape.inc.php - About 2 days to fix

                            Function command_runner has a Cognitive Complexity of 113 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def command_runner(
                                command,  # type: Union[str, List[str]]
                                valid_exit_codes=None,  # type: Optional[List[int]]
                                timeout=3600,  # type: Optional[int]
                                shell=False,  # type: bool
                            Severity: Minor
                            Found in LibreNMS/command_runner.py - About 2 days 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

                            File functions.inc.php has 891 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            <?php
                            
                            /**
                             * LibreNMS
                             *
                            Severity: Major
                            Found in includes/html/functions.inc.php - About 2 days to fix

                              File settings.php has 826 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              <?php
                              
                              return [
                                  'readonly' => '在 config.php 里被设定成只读,请由 config.php 移除它来启用。',
                                  'groups' => [
                              Severity: Major
                              Found in lang/zh-CN/settings.php - About 1 day to fix

                                File IRCBot.php has 824 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                <?php
                                /*
                                 * Copyright (C) 2014  <singh@devilcode.org>
                                 * Modified and Relicensed by <f0o@devilcode.org> under the expressed
                                 * permission by the Copyright-Holder <singh@devilcode.org>.
                                Severity: Major
                                Found in LibreNMS/IRCBot.php - About 1 day to fix

                                  File settings.php has 812 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  <?php
                                  
                                  return [
                                      'readonly' => 'Ist in config.php konfiguriert. Zur Aktivierung entfernen Sie den Eintrag aus der config.php.',
                                      'groups' => [
                                  Severity: Major
                                  Found in lang/de/settings.php - About 1 day to fix

                                    File service.py has 802 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    import logging
                                    import os
                                    import sys
                                    import threading
                                    import time
                                    Severity: Major
                                    Found in LibreNMS/service.py - About 1 day to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language