antimalware/manul

View on GitHub

Showing 400 of 400 total issues

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

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

                    default:
                        r = Z_STREAM_ERROR;
    
                        s.bitb = b;
                        s.bitk = k;
    Severity: Major
    Found in src/log_analyzer/js/inflate.js and 1 other location - About 3 hrs to fix
    src/log_analyzer/js/inflate.js on lines 1709..1718

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 95.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

                    default:
                        r = Z_STREAM_ERROR;
    
                        that.bitb = b;
                        that.bitk = k;
    Severity: Major
    Found in src/log_analyzer/js/inflate.js and 1 other location - About 3 hrs to fix
    src/log_analyzer/js/inflate.js on lines 1086..1095

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 95.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    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

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

                        if (lookahead >= MIN_MATCH) {
                            ins_h = (((ins_h) << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;
                            // prev[strstart&w_mask]=hash_head=head[ins_h];
                            hash_head = (head[ins_h] & 0xffff);
                            prev[strstart & w_mask] = head[ins_h];
        Severity: Major
        Found in src/log_analyzer/js/deflate.js and 2 other locations - About 2 hrs to fix
        src/log_analyzer/js/deflate.js on lines 1393..1400
        src/log_analyzer/js/deflate.js on lines 1549..1555

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 88.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

                        if (lookahead >= MIN_MATCH) {
                            ins_h = (((ins_h) << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;
        
                            // prev[strstart&w_mask]=hash_head=head[ins_h];
                            hash_head = (head[ins_h] & 0xffff);
        Severity: Major
        Found in src/log_analyzer/js/deflate.js and 2 other locations - About 2 hrs to fix
        src/log_analyzer/js/deflate.js on lines 1501..1507
        src/log_analyzer/js/deflate.js on lines 1549..1555

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 88.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

                                if (++strstart <= max_insert) {
                                    ins_h = (((ins_h) << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;
                                    // prev[strstart&w_mask]=hash_head=head[ins_h];
                                    hash_head = (head[ins_h] & 0xffff);
                                    prev[strstart & w_mask] = head[ins_h];
        Severity: Major
        Found in src/log_analyzer/js/deflate.js and 2 other locations - About 2 hrs to fix
        src/log_analyzer/js/deflate.js on lines 1393..1400
        src/log_analyzer/js/deflate.js on lines 1501..1507

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 88.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        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

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            function add_delete(uid, name) {
                if (deleted.hasItem(uid)) {
                    triggerLink('d_' + uid, false);
                    deleted.removeItem(uid);
                } else {
            Severity: Major
            Found in src/log_analyzer/js/analyzer.table.js and 1 other location - About 2 hrs to fix
            src/log_analyzer/js/analyzer.table.js on lines 7338..7350

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 85.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            function add_quarantine(uid, name) {
                if (quarantened.hasItem(uid)) {
                    triggerLink('q_' + uid, false);
                    quarantened.removeItem(uid);
                } else {
            Severity: Major
            Found in src/log_analyzer/js/analyzer.table.js and 1 other location - About 2 hrs to fix
            src/log_analyzer/js/analyzer.table.js on lines 7352..7364

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 85.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            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
                          Severity
                          Category
                          Status
                          Source
                          Language