antimalware/manul

View on GitHub

Showing 272 of 400 total issues

Method startExecutor has 77 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function startExecutor()
    {
        $view = new View();
        $healer = new Healer();

Severity: Major
Found in src/scanner/classes/ExecutorController.inc.php - About 3 hrs to fix

    Method detectMalware has 76 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function detectMalware($filePath, &$foundFragment, &$pos, $startTime, $timeout, $ext)
        {
    
            if (filesize($filePath) > $this->MAX_FILESIZE) {
                return 'skipped';
    Severity: Major
    Found in src/scanner/classes/MalwareDetector.inc.php - About 3 hrs to fix

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

      <?php
      /*
      Example of usage:
      
      <?php
      Severity: Minor
      Found in src/scanner/classes/CmsVersionDetector.inc.php - About 3 hrs to fix

        Function malwareScanRound has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

            function malwareScanRound()
            {
        
                global $php_errormsg;
        
        
        Severity: Minor
        Found in src/scanner/classes/MalwareDetector.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 HashTable has 71 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function HashTable(obj)
        {
            this.length = 0;
            this.items = {};
            for (var p in obj) {
        Severity: Major
        Found in src/log_analyzer/js/HashTable.js - About 2 hrs to fix

          Function add has 71 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      add : function(name, reader, onend, onprogress, options) {
                          var header, filename, date;
          
                          function writeHeader(callback) {
                              var data;
          Severity: Major
          Found in src/log_analyzer/js/zip.js - About 2 hrs to fix

            Function nextTick has 66 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                nextTick = (function() {
                    var fns = [],
                        enqueueFn = function(fn) {
                            return fns.push(fn) === 1;
                        },
            Severity: Major
            Found in src/log_analyzer/js/analyzer.table.js - About 2 hrs to fix

              Method malwareScanRound has 64 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function malwareScanRound()
                  {
              
                      global $php_errormsg;
              
              
              Severity: Major
              Found in src/scanner/classes/MalwareDetector.inc.php - About 2 hrs to fix

                File spin.js has 268 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /**
                 * Copyright (c) 2011-2014 Felix Gnass
                 * Licensed under the MIT license
                 */
                (function(root, factory) {
                Severity: Minor
                Found in src/log_analyzer/js/spin.js - About 2 hrs to fix

                  Function Deflater has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

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

                    Function FastClick has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function FastClick(layer) {
                        'use strict';
                        var oldOnClick, self = this;
                    
                    
                    
                    Severity: Major
                    Found in src/log_analyzer/js/analyzer.table.js - About 2 hrs to fix

                      Function deflate_fast has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              function deflate_fast(flush) {
                                  // short hash_head = 0; // head of the hash chain
                                  var hash_head = 0; // head of the hash chain
                                  var bflush; // set if current block must be flushed
                      
                      
                      Severity: Major
                      Found in src/log_analyzer/js/deflate.js - About 2 hrs to fix

                        Function toObj has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              toObj: function(xml) {
                                 var o = {};
                                 if (xml.nodeType==1) {   // element node ..
                                    if (xml.attributes.length)   // element with attributes  ..
                                       for (var i=0; i<xml.attributes.length; i++)
                        Severity: Major
                        Found in src/log_analyzer/js/xml2json.js - About 2 hrs to fix

                          Function decl has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              decl : function(decl, props, staticProps) {
                                  // string as block
                                  typeof decl === 'string' && (decl = { block : decl });
                                  // inherit from itself
                                  if(arguments.length <= 2 &&
                          Severity: Major
                          Found in src/log_analyzer/js/analyzer.table.js - About 2 hrs to fix

                            Method getCompactPhpInfo has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private function getCompactPhpInfo()
                                {
                                    if (function_exists('phpinfo') && is_callable('phpinfo')) {
                                        ob_start();
                                        phpinfo();
                            Severity: Major
                            Found in src/scanner/classes/WebServerEnvInfo.inc.php - About 2 hrs to fix

                              Consider simplifying this complex logical expression.
                              Open

                                   var __$ref={};function apply(ctx){try{return applyc(ctx||this,__$ref)}catch(e){(ctx||this).xjstContext=e;throw e}}exports.apply=apply;function applyc(__$ctx,__$ref){var __$t=__$ctx._mode;if(__$t==="content"){__$ctx.__$a=0;return __$ctx.ctx.content}else if(__$t==="mix"){__$ctx.__$a=0;return undefined}else if(__$t==="bem"){__$ctx.__$a=0;return undefined}else if(__$t==="js"){__$ctx.__$a=0;return undefined}else if(__$t==="cls"){__$ctx.__$a=0;return undefined}else if(__$t==="attrs"){__$ctx.__$a=0;return undefined}else if(__$t==="tag"){__$ctx.__$a=0;return undefined}else if(__$t==="default"){__$ctx.__$a=0;var __$r=__$b8(__$ctx,__$ref);if(__$r!==__$ref)return __$r}else if(__$t===""){if(__$ctx.ctx&&__$ctx.ctx._vow&&__$ctx.__$a!==1){__$ctx.__$a=0;var __$r=__$b9(__$ctx,__$ref);if(__$r!==__$ref)return __$r}if(__$ctx._.isSimple(__$ctx.ctx)){__$ctx.__$a=0;var __$r=__$b10(__$ctx,__$ref);if(__$r!==__$ref)return __$r}if(!__$ctx.ctx){__$ctx.__$a=0;var __$r=__$b11(__$ctx,__$ref);if(__$r!==__$ref)return __$r}if(__$ctx._.isArray(__$ctx.ctx)){__$ctx.__$a=0;var __$r=__$b12(__$ctx,__$ref);if(__$r!==__$ref)return __$r}__$ctx.__$a=0;var __$r=__$b13(__$ctx,__$ref);if(__$r!==__$ref)return __$r}__$ctx.__$a=0}[function(exports){var BEM_={},toString=Object.prototype.toString,isArray=Array.isArray||function(obj){return toString.call(obj)==="[object Array]"},SHORT_TAGS={area:1,base:1,br:1,col:1,command:1,embed:1,hr:1,img:1,input:1,keygen:1,link:1,meta:1,param:1,source:1,wbr:1};!function(BEM,undefined){var MOD_DELIM="_",ELEM_DELIM="__",NAME_PATTERN="[a-zA-Z0-9-]+";function buildModPostfix(modName,modVal){var res=MOD_DELIM+modName;if(modVal!==true)res+=MOD_DELIM+modVal;return res}function buildBlockClass(name,modName,modVal){var res=name;if(modVal)res+=buildModPostfix(modName,modVal);return res}function buildElemClass(block,name,modName,modVal){var res=buildBlockClass(block)+ELEM_DELIM+name;if(modVal)res+=buildModPostfix(modName,modVal);return res}BEM.INTERNAL={NAME_PATTERN:NAME_PATTERN,MOD_DELIM:MOD_DELIM,ELEM_DELIM:ELEM_DELIM,buildModPostfix:buildModPostfix,buildClass:function(block,elem,modName,modVal){var typeOfModName=typeof modName;if(typeOfModName==="string"||typeOfModName==="boolean"){var typeOfModVal=typeof modVal;if(typeOfModVal!=="string"&&typeOfModVal!=="boolean"){modVal=modName;modName=elem;elem=undefined}}else if(typeOfModName!=="undefined"){modName=undefined}else if(elem&&typeof elem!=="string"){elem=undefined}if(!(elem||modName)){return block}if(elem)return buildElemClass(block,elem,modName,modVal);else return buildBlockClass(block,modName,modVal)},buildModsClasses:function(block,elem,mods){var res="";if(mods){var modName;for(modName in mods){if(!mods.hasOwnProperty(modName))continue;var modVal=mods[modName];if(!modVal&&modVal!==0)continue;typeof modVal!=="boolean"&&(modVal+="");res+=" "+(elem?buildElemClass(block,elem,modName,modVal):buildBlockClass(block,modName,modVal))}}return res},buildClasses:function(block,elem,mods){var res="";if(elem)res+=buildElemClass(block,elem);else res+=buildBlockClass(block);res+=this.buildModsClasses(block,elem,mods);return res}}}(BEM_);var ts={'"':"&quot;","&":"&amp;","<":"&lt;",">":"&gt;"},f=function(t){return ts[t]||t};var buildEscape=function(r){r=new RegExp(r,"g");return function(s){return(""+s).replace(r,f)}};function BEMContext(context,apply_){this.ctx=typeof context===null?"":context;this.apply=apply_;this._str="";var self=this;this._buf={push:function(){var chunks=Array.prototype.slice.call(arguments).join("");self._str+=chunks},join:function(){return this._str}};this._=this;this._start=true;this._mode="";this._listLength=0;this._notNewList=false;this.position=0;this.block=undefined;this.elem=undefined;this.mods=undefined;this.elemMods=undefined}BEMContext.prototype.isArray=isArray;BEMContext.prototype.isSimple=function isSimple(obj){var t=typeof obj;return t==="string"||t==="number"||t==="boolean"};BEMContext.prototype.isShortTag=function isShortTag(t){return SHORT_TAGS.hasOwnProperty(t)};BEMContext.prototype.extend=function extend(o1,o2){if(!o1||!o2)return o1||o2;var res={},n;for(n in o1)o1.hasOwnProperty(n)&&(res[n]=o1[n]);for(n in o2)o2.hasOwnProperty(n)&&(res[n]=o2[n]);return res};var cnt=0,id=+new Date,expando="__"+id,get=function(){return"uniq"+id+ ++cnt};BEMContext.prototype.identify=function(obj,onlyGet){if(!obj)return get();if(onlyGet||obj[expando]){return obj[expando]}else{return obj[expando]=get()}};BEMContext.prototype.xmlEscape=buildEscape("[&<>]");BEMContext.prototype.attrEscape=buildEscape('["&<>]');BEMContext.prototype.BEM=BEM_;BEMContext.prototype.isFirst=function isFirst(){return this.position===1};BEMContext.prototype.isLast=function isLast(){return this.position===this._listLength};BEMContext.prototype.generateId=function generateId(){return this.identify(this.ctx)};var oldApply=exports.apply;exports.apply=BEMContext.apply=function _apply(context){var ctx=new BEMContext(context||this,oldApply);ctx.apply();return ctx._str};BEMContext.prototype.reapply=BEMContext.apply}].forEach(function(fn){fn(exports,this)},{recordExtensions:function(ctx){ctx._str=undefined;ctx._mode=undefined;ctx.block=undefined;ctx.elem=undefined;ctx._notNewList=undefined;ctx.position=undefined;ctx._listLength=undefined;ctx.ctx=undefined;ctx.__$a=0;ctx._currBlock=undefined;ctx.mods=undefined;ctx.elemMods=undefined}});function __$b8(__$ctx,__$ref){__$ctx.__$a=0;var _this__$0=__$ctx,BEM___$1=_this__$0.BEM,v__$2=__$ctx.ctx,isBEM__$3,tag__$4,result__$5;var __$r__$6;var __$l0__$7=__$ctx._str;__$ctx._str="";var __$r__$8;var __$l1__$9=__$ctx._mode;__$ctx._mode="tag";__$r__$8=applyc(__$ctx,__$ref);__$ctx._mode=__$l1__$9;tag__$4=__$r__$8;typeof tag__$4!=="undefined"||(tag__$4=v__$2.tag);typeof tag__$4!=="undefined"||(tag__$4="div");if(tag__$4){var jsParams__$10,js__$11;if(__$ctx.block&&v__$2.js!==false){var __$r__$12;var __$l2__$13=__$ctx._mode;__$ctx._mode="js";__$r__$12=applyc(__$ctx,__$ref);__$ctx._mode=__$l2__$13;js__$11=__$r__$12;js__$11=js__$11?__$ctx._.extend(v__$2.js,js__$11===true?{}:js__$11):v__$2.js===true?{}:v__$2.js;js__$11&&((jsParams__$10={})[BEM___$1.INTERNAL.buildClass(__$ctx.block,v__$2.elem)]=js__$11)}__$ctx._str+="<"+tag__$4;var __$r__$14;var __$l3__$15=__$ctx._mode;__$ctx._mode="bem";__$r__$14=applyc(__$ctx,__$ref);__$ctx._mode=__$l3__$15;isBEM__$3=__$r__$14;typeof isBEM__$3!=="undefined"||(isBEM__$3=typeof v__$2.bem!=="undefined"?v__$2.bem:v__$2.block||v__$2.elem);var __$r__$17;var __$l4__$18=__$ctx._mode;__$ctx._mode="cls";__$r__$17=applyc(__$ctx,__$ref);__$ctx._mode=__$l4__$18;var cls__$16=__$r__$17;cls__$16||(cls__$16=v__$2.cls);var addJSInitClass__$19=v__$2.block&&jsParams__$10;if(isBEM__$3||cls__$16){__$ctx._str+=' class="';if(isBEM__$3){__$ctx._str+=BEM___$1.INTERNAL.buildClasses(__$ctx.block,v__$2.elem,v__$2.elemMods||v__$2.mods);var __$r__$21;var __$l5__$22=__$ctx._mode;__$ctx._mode="mix";__$r__$21=applyc(__$ctx,__$ref);__$ctx._mode=__$l5__$22;var mix__$20=__$r__$21;v__$2.mix&&(mix__$20=mix__$20?mix__$20.concat(v__$2.mix):v__$2.mix);if(mix__$20){var visited__$23={},visitedKey__$24=function(block,elem){return(block||"")+"__"+(elem||"")};visited__$23[visitedKey__$24(__$ctx.block,__$ctx.elem)]=true;if(!__$ctx._.isArray(mix__$20))mix__$20=[mix__$20];for(var i__$25=0;i__$25<mix__$20.length;i__$25++){var mixItem__$26=mix__$20[i__$25],hasItem__$27=mixItem__$26.block||mixItem__$26.elem,block__$28=mixItem__$26.block||mixItem__$26._block||_this__$0.block,elem__$29=mixItem__$26.elem||mixItem__$26._elem||_this__$0.elem;if(hasItem__$27)__$ctx._str+=" ";__$ctx._str+=BEM___$1.INTERNAL[hasItem__$27?"buildClasses":"buildModsClasses"](block__$28,mixItem__$26.elem||mixItem__$26._elem||(mixItem__$26.block?undefined:_this__$0.elem),mixItem__$26.elemMods||mixItem__$26.mods);if(mixItem__$26.js){(jsParams__$10||(jsParams__$10={}))[BEM___$1.INTERNAL.buildClass(block__$28,mixItem__$26.elem)]=mixItem__$26.js===true?{}:mixItem__$26.js;addJSInitClass__$19||(addJSInitClass__$19=block__$28&&!mixItem__$26.elem)}if(hasItem__$27&&!visited__$23[visitedKey__$24(block__$28,elem__$29)]){visited__$23[visitedKey__$24(block__$28,elem__$29)]=true;var __$r__$31;var __$l6__$32=__$ctx._mode;__$ctx._mode="mix";var __$l7__$33=__$ctx.block;__$ctx.block=block__$28;var __$l8__$34=__$ctx.elem;__$ctx.elem=elem__$29;__$r__$31=applyc(__$ctx,__$ref);__$ctx._mode=__$l6__$32;__$ctx.block=__$l7__$33;__$ctx.elem=__$l8__$34;var nestedMix__$30=__$r__$31;if(nestedMix__$30){for(var j__$35=0;j__$35<nestedMix__$30.length;j__$35++){var nestedItem__$36=nestedMix__$30[j__$35];if(!nestedItem__$36.block&&!nestedItem__$36.elem||!visited__$23[visitedKey__$24(nestedItem__$36.block,nestedItem__$36.elem)]){nestedItem__$36._block=block__$28;nestedItem__$36._elem=elem__$29;mix__$20.splice(i__$25+1,0,nestedItem__$36)}}}}}}}if(cls__$16)__$ctx._str+=isBEM__$3?" "+cls__$16:cls__$16;if(addJSInitClass__$19)__$ctx._str+=' i-bem"';else __$ctx._str+='"'}if(isBEM__$3&&jsParams__$10){__$ctx._str+=' data-bem="'+__$ctx._.attrEscape(JSON.stringify(jsParams__$10))+'"'}var __$r__$38;var __$l9__$39=__$ctx._mode;__$ctx._mode="attrs";__$r__$38=applyc(__$ctx,__$ref);__$ctx._mode=__$l9__$39;var attrs__$37=__$r__$38;attrs__$37=__$ctx._.extend(attrs__$37,v__$2.attrs);if(attrs__$37){var name__$40,attr__$41;for(name__$40 in attrs__$37){attr__$41=attrs__$37[name__$40];if(attr__$41===undefined)continue;__$ctx._str+=" "+name__$40+'="'+__$ctx._.attrEscape(__$ctx._.isSimple(attr__$41)?attr__$41:__$ctx.reapply(attr__$41))+'"'}}}if(__$ctx._.isShortTag(tag__$4)){__$ctx._str+="/>"}else{if(tag__$4)__$ctx._str+=">";var __$r__$43;var __$l10__$44=__$ctx._mode;__$ctx._mode="content";__$r__$43=applyc(__$ctx,__$ref);__$ctx._mode=__$l10__$44;var content__$42=__$r__$43;if(content__$42||content__$42===0){isBEM__$3=__$ctx.block||__$ctx.elem;var __$r__$45;var __$l11__$46=__$ctx._mode;__$ctx._mode="";var __$l12__$47=__$ctx._notNewList;__$ctx._notNewList=false;var __$l13__$48=__$ctx.position;__$ctx.position=isBEM__$3?1:__$ctx.position;var __$l14__$49=__$ctx._listLength;__$ctx._listLength=isBEM__$3?1:__$ctx._listLength;var __$l15__$50=__$ctx.ctx;__$ctx.ctx=content__$42;__$r__$45=applyc(__$ctx,__$ref);__$ctx._mode=__$l11__$46;__$ctx._notNewList=__$l12__$47;__$ctx.position=__$l13__$48;__$ctx._listLength=__$l14__$49;__$ctx.ctx=__$l15__$50}if(tag__$4)__$ctx._str+="</"+tag__$4+">"}result__$5=__$ctx._str;__$r__$6=undefined;__$ctx._str=__$l0__$7;__$ctx._buf.push(result__$5);return}function __$b9(__$ctx,__$ref){__$ctx.__$a=0;var __$r__$51;var __$l0__$52=__$ctx._mode;__$ctx._mode="";var __$l1__$53=__$ctx.ctx;__$ctx.ctx=__$ctx.ctx._value;var __$r__$54;__$ctx.__$a=1;__$r__$54=applyc(__$ctx,__$ref);__$r__$51=__$r__$54;__$ctx._mode=__$l0__$52;__$ctx.ctx=__$l1__$53;return}function __$b10(__$ctx,__$ref){__$ctx.__$a=0;__$ctx._listLength--;var ctx__$55=__$ctx.ctx;if(ctx__$55&&ctx__$55!==true||ctx__$55===0){__$ctx._buf.push(ctx__$55+"")}return}function __$b11(__$ctx,__$ref){__$ctx.__$a=0;__$ctx._listLength--;return}function __$b12(__$ctx,__$ref){__$ctx.__$a=0;var v__$56=__$ctx.ctx,l__$57=v__$56.length,i__$58=0,prevPos__$59=__$ctx.position,prevNotNewList__$60=__$ctx._notNewList;if(prevNotNewList__$60){__$ctx._listLength+=l__$57-1}else{__$ctx.position=0;__$ctx._listLength=l__$57}__$ctx._notNewList=true;while(i__$58<l__$57)!function(){var __$r__$61;var __$l0__$62=__$ctx.ctx;__$ctx.ctx=v__$56[i__$58++];__$r__$61=applyc(__$ctx,__$ref);__$ctx.ctx=__$l0__$62;return __$r__$61}();prevNotNewList__$60||(__$ctx.position=prevPos__$59);return}function __$b13(__$ctx,__$ref){__$ctx.__$a=0;var vBlock__$63=__$ctx.ctx.block,vElem__$64=__$ctx.ctx.elem,block__$65=__$ctx._currBlock||__$ctx.block;__$ctx.ctx||(__$ctx.ctx={});var __$r__$66;var __$l0__$67=__$ctx._mode;__$ctx._mode="default";var __$l1__$68=__$ctx.block;__$ctx.block=vBlock__$63||(vElem__$64?block__$65:undefined);var __$l2__$69=__$ctx._currBlock;__$ctx._currBlock=vBlock__$63||vElem__$64?undefined:block__$65;var __$l3__$70=__$ctx.elem;__$ctx.elem=__$ctx.ctx.elem;var __$l4__$71=__$ctx.mods;__$ctx.mods=(vBlock__$63?__$ctx.ctx.mods:__$ctx.mods)||{};var __$l5__$72=__$ctx.elemMods;__$ctx.elemMods=__$ctx.ctx.elemMods||{};__$ctx.block||__$ctx.elem?__$ctx.position=(__$ctx.position||0)+1:__$ctx._listLength--;applyc(__$ctx,__$ref);__$r__$66=undefined;__$ctx._mode=__$l0__$67;__$ctx.block=__$l1__$68;__$ctx._currBlock=__$l2__$69;__$ctx.elem=__$l3__$70;__$ctx.mods=__$l4__$71;__$ctx.elemMods=__$l5__$72;return};
                              Severity: Critical
                              Found in src/log_analyzer/js/analyzer.table.js - About 2 hrs to fix

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

                                                content: (function () {
                                                    var dates = [];
                                
                                                    for (var i = 0; i < gridMap.length; i++) {
                                                        dates.push({
                                Severity: Major
                                Found in src/log_analyzer/js/analyzer.table.js - About 2 hrs to fix

                                  Function gen_bitlen has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          function gen_bitlen(s) {
                                              var tree = that.dyn_tree;
                                              var stree = that.stat_desc.static_tree;
                                              var extra = that.stat_desc.extra_bits;
                                              var base = that.stat_desc.extra_base;
                                  Severity: Major
                                  Found in src/log_analyzer/js/deflate.js - About 2 hrs to fix

                                    Function _buildGreatChooserBEMJSON has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            _buildGreatChooserBEMJSON: function () {
                                                var self = this;
                                                return [
                                                    {
                                                        elem: 'choose-year',
                                    Severity: Major
                                    Found in src/log_analyzer/js/analyzer.table.js - About 2 hrs to fix

                                      CmsVersionDetector has 21 functions (exceeds 20 allowed). Consider refactoring.
                                      Open

                                      class CmsVersionDetector
                                      {
                                          private $rootPath;
                                          private $versions;
                                          private $types;
                                      Severity: Minor
                                      Found in src/scanner/classes/CmsVersionDetector.inc.php - About 2 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language