antimalware/manul

View on GitHub

Showing 272 of 400 total issues

File localization.js has 415 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var localization = {

    browser_language: 'en',
    chosen_language: 'en',
Severity: Minor
Found in src/log_analyzer/js/localization.js - About 5 hrs to fix

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

    <?php
    
    define('MANUL_LANG_ID_RU', 'ru');
    define('MANUL_LANG_ID_EN', 'en');
    define('MANUL_LANG_ID_UA', 'uk');
    Severity: Minor
    Found in src/scanner/classes/Localization.inc.php - About 5 hrs to fix

      Function xml2json has 146 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function xml2json(xml, tab) {
         var X = {
            toObj: function(xml) {
               var o = {};
               if (xml.nodeType==1) {   // element node ..
      Severity: Major
      Found in src/log_analyzer/js/xml2json.js - About 5 hrs to fix

        Function prompt has 141 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          exports.prompt = function() {
            var options;
            var defaults;
            var dialog;
            var form;
        Severity: Major
        Found in src/scanner/static/js/bootbox.js - About 5 hrs to fix

          Function Tree has 136 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function Tree() {
                  var that = this;
          
                  // dyn_tree; // the dynamic tree
                  // max_code; // largest code with non zero frequency
          Severity: Major
          Found in src/log_analyzer/js/deflate.js - About 5 hrs to fix

            Function huft_build has 133 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    function huft_build(b, // code lengths in bits (all assumed <=
                    // BMAX)
                    bindex, n, // number of codes (assumed <= 288)
                    s, // number of simple-valued codes (0..s-1)
                    d, // list of base values for non-simple codes
            Severity: Major
            Found in src/log_analyzer/js/inflate.js - About 5 hrs to fix

              Function createZipWriter has 120 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function createZipWriter(writer, onerror, dontDeflate) {
                      var worker, files = {}, filenames = [], datalength = 0;
              
                      function terminate(callback, message) {
                          if (worker)
              Severity: Major
              Found in src/log_analyzer/js/zip.js - About 4 hrs to fix

                File analyzer.tableBuilder.js has 361 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                var logLoaded = false;
                var filesDataTable = null;
                var numberItemsInFilter;
                
                var data = "";
                Severity: Minor
                Found in src/log_analyzer/js/analyzer.tableBuilder.js - About 4 hrs to fix

                  Function detectMalware has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                  Open

                      function detectMalware($filePath, &$foundFragment, &$pos, $startTime, $timeout, $ext)
                      {
                  
                          if (filesize($filePath) > $this->MAX_FILESIZE) {
                              return 'skipped';
                  Severity: Minor
                  Found in src/scanner/classes/MalwareDetector.inc.php - About 4 hrs 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 inflate has 107 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          that.inflate = function(z, f) {
                              var r;
                              var b;
                  
                              if (!z || !z.istate || !z.next_in)
                  Severity: Major
                  Found in src/log_analyzer/js/inflate.js - About 4 hrs to fix

                    Function createZipReader has 101 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function createZipReader(reader, onerror) {
                            function Entry() {
                            }
                    
                            Entry.prototype.getData = function(writer, onend, onprogress, checkCrc32) {
                    Severity: Major
                    Found in src/log_analyzer/js/zip.js - About 4 hrs to fix

                      Function _buildDatepickerGridBEMJSON has 100 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              _buildDatepickerGridBEMJSON: function (dateCtx) {
                                  var self = this,
                                      grid = [],
                                      gridMap = this._buildGridMap(dateCtx);
                      
                      
                      Severity: Major
                      Found in src/log_analyzer/js/analyzer.table.js - About 4 hrs to fix

                        Function buildTable has 98 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function buildTable(data) {
                            window.filesDataTable = $('#filesTable').dataTable({
                               "order": [[ 0, "desc" ]],
                        
                               "aLengthMenu": [[100, 10, 500, -1], [100, 10, 500, "All"]],
                        Severity: Major
                        Found in src/log_analyzer/js/analyzer.tableBuilder.js - About 3 hrs to fix

                          Function folderWalker has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                          Open

                              private function folderWalker($path, &$files_found)
                              {
                                  if ($path === '.')
                                      $path = $_SERVER['DOCUMENT_ROOT'];
                          
                          
                          Severity: Minor
                          Found in src/scanner/classes/FileList.inc.php - About 3 hrs 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 MalwareDetector.inc.php has 327 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          <?php
                          
                          ob_start();
                          require_once('XmlValidator.inc.php');
                          require_once('FileInfo.inc.php');
                          Severity: Minor
                          Found in src/scanner/classes/MalwareDetector.inc.php - About 3 hrs to fix

                            Function HashTable has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                            Open

                            function HashTable(obj)
                            {
                                this.length = 0;
                                this.items = {};
                                for (var p in obj) {
                            Severity: Minor
                            Found in src/log_analyzer/js/HashTable.js - About 3 hrs 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 start has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function start()
                                {
                                    global $projectTmpDir, $php_errormsg;
                            
                                    $authenticator = new Auth();
                            Severity: Minor
                            Found in src/scanner/classes/ScannerController.inc.php - About 3 hrs 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 deflate has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    that.deflate = function(_strm, flush) {
                                        var i, header, level_flags, old_flush, bstate;
                            
                                        if (flush > Z_FINISH || flush < 0) {
                                            return Z_STREAM_ERROR;
                            Severity: Major
                            Found in src/log_analyzer/js/deflate.js - About 3 hrs to fix

                              Function dialog has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                exports.dialog = function(options) {
                                  options = sanitize(options);
                              
                                  var dialog = $(templates.dialog);
                                  var innerDialog = dialog.find(".modal-dialog");
                              Severity: Major
                              Found in src/scanner/static/js/bootbox.js - About 3 hrs to fix

                                Function deflate_slow has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        function deflate_slow(flush) {
                                            // short hash_head = 0; // head of hash chain
                                            var hash_head = 0; // head of hash chain
                                            var bflush; // set if current block must be flushed
                                            var max_insert;
                                Severity: Major
                                Found in src/log_analyzer/js/deflate.js - About 3 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language