antimalware/manul

View on GitHub

Showing 272 of 400 total issues

Function auth has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function auth()
    {
        $result = false;
        $isPasswordSet = is_file($this->passwordHashFilepath);
        $isPasswordSent = !empty($_POST['password']);
Severity: Minor
Found in src/scanner/classes/Auth.inc.php - About 2 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 checkJoomla has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    private function checkJoomla(&$version)
    {
        $version = CMS_VERSION_UNDEFINED;
        $res = false;

Severity: Minor
Found in src/scanner/classes/CmsVersionDetector.inc.php - About 2 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 onTouchEnd has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

FastClick.prototype.onTouchEnd = function(event) {
    'use strict';
    var forElement, trackingClickStart, targetTagName, scrollParent, touch, targetElement = this.targetElement;

    if (!this.trackingClick) {
Severity: Major
Found in src/log_analyzer/js/analyzer.table.js - About 2 hrs to fix

    Function Inflater has 50 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function Inflater() {
            var that = this;
            var z = new ZStream();
            var bufsize = 512;
            var flush = Z_NO_FLUSH;
    Severity: Minor
    Found in src/log_analyzer/js/inflate.js - About 2 hrs to fix

      Function initVML has 49 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function initVML() {
      
          /* Utility function to create a VML tag */
          function vml(tag, attr) {
            return createEl('<' + tag + ' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">', attr)
      Severity: Minor
      Found in src/log_analyzer/js/spin.js - About 1 hr to fix

        Function content has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                                    content: (function () { //TODO: move to separate methods
                                        var dayBEMJSON,
                                            currentDayISO,
                                            currentDateISO,
                                            currentMonthISO,
        Severity: Minor
        Found in src/log_analyzer/js/analyzer.table.js - About 1 hr to fix

          Function send_tree has 47 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  function send_tree(tree,// the tree to be sent
                  max_code // and its largest code of non zero frequency
                  ) {
                      var n; // iterates over all tree elements
                      var prevlen = -1; // last emitted length
          Severity: Minor
          Found in src/log_analyzer/js/deflate.js - About 1 hr to fix

            Function launchWorkerProcess has 47 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function launchWorkerProcess(worker, reader, writer, offset, size, onappend, onprogress, onend, onreaderror, onwriteerror) {
                    var chunkIndex = 0, index, outputSize;
            
                    function onflush() {
                        worker.removeEventListener(MESSAGE_EVENT, onmessage, false);
            Severity: Minor
            Found in src/log_analyzer/js/zip.js - About 1 hr to fix

              Function inited has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                              'inited': function () {
                                  if (this.hasMod('type', 'setting')) {
                                      var popup = this.findBlockOutside('page').findBlockInside({block: 'popup', modName: 'name', modVal: 'setting'});
                                      this.bindTo('click', function () {
                                          popup.toggle()
              Severity: Minor
              Found in src/log_analyzer/js/analyzer.table.js - About 1 hr to fix

                Function setMod has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    setMod : function(elem, modName, modVal) {
                        if(typeof modVal === 'undefined') {
                            if(typeof elem === 'string') { // if no elem
                                modVal = typeof modName === 'undefined'?
                                    true :  // e.g. setMod('focused')
                Severity: Minor
                Found in src/log_analyzer/js/analyzer.table.js - About 1 hr to fix

                  Function localize has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      localize: function() {
                  
                          $('label.load_file_button')._t('Common.LoadFile');
                          $('title')._t('Common.Title');
                  
                  Severity: Minor
                  Found in src/log_analyzer/js/localization.js - About 1 hr to fix

                    Function _getDatePickerBEMJSON has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            _getDatePickerBEMJSON: function () {
                                
                                var clearBEMJSON,
                                    datePickerBEMJSON = [
                                        {
                    Severity: Minor
                    Found in src/log_analyzer/js/analyzer.table.js - About 1 hr to fix

                      Function _getDatePickerHeadBEMJSON has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              _getDatePickerHeadBEMJSON: function () {
                                  var datePickerHeadBEMJSON,
                                      titleClickContent = this.months[this._dates.current.month + 1] + ' ' + this._dates.current.year;
                      
                      //            if (!this.changeDisabled) {
                      Severity: Minor
                      Found in src/log_analyzer/js/analyzer.table.js - About 1 hr to fix

                        Function addPointerEvent has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function addPointerEvent(type, toExtend) {
                        
                            var eventName = 'pointer' + type,
                                pointerevent,
                        
                        
                        Severity: Minor
                        Found in src/log_analyzer/js/analyzer.table.js - About 1 hr to fix

                          Function build_tree has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  that.build_tree = function(s) {
                                      var tree = that.dyn_tree;
                                      var stree = that.stat_desc.static_tree;
                                      var elems = that.stat_desc.elems;
                                      var n, m; // iterate over heap elements
                          Severity: Minor
                          Found in src/log_analyzer/js/deflate.js - About 1 hr to fix

                            Function un has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    un : function(e, fn, ctx) {
                                        if(typeof e === 'string' || typeof e === 'undefined') {
                                            var storage = this[storageExpando];
                                            if(storage) {
                                                if(e) { // if event type was passed
                            Severity: Minor
                            Found in src/log_analyzer/js/analyzer.table.js - About 1 hr to fix

                              Method __construct has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function __construct($rootPath = '.')
                                  {
                                      $this->rootPath = $rootPath;
                                      $this->versions = array();
                                      $this->types = array();
                              Severity: Minor
                              Found in src/scanner/classes/CmsVersionDetector.inc.php - About 1 hr to fix

                                Function getData has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        Entry.prototype.getData = function(writer, onend, onprogress, checkCrc32) {
                                            var that = this, worker;
                                
                                            function terminate(callback, param) {
                                                if (worker)
                                Severity: Minor
                                Found in src/log_analyzer/js/zip.js - About 1 hr to fix

                                  Function addFileEntry has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      function addFileEntry(zipEntry, fileEntry, onend, onerror) {
                                          function getChildren(fileEntry, callback) {
                                              if (fileEntry.isDirectory)
                                                  fileEntry.createReader().readEntries(callback);
                                              if (fileEntry.isFile)
                                  Severity: Minor
                                  Found in src/log_analyzer/js/zip-fs.js - About 1 hr to fix

                                    Consider simplifying this complex logical expression.
                                    Open

                                                if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || _method != Z_DEFLATED || bits < 9 || bits > 15 || _level < 0 || _level > 9 || _strategy < 0
                                                        || _strategy > Z_HUFFMAN_ONLY) {
                                                    return Z_STREAM_ERROR;
                                                }
                                    Severity: Critical
                                    Found in src/log_analyzer/js/deflate.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language