antimalware/manul

View on GitHub

Showing 400 of 400 total issues

Function __construct has a Cognitive Complexity of 13 (exceeds 5 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

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 inflateSync has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        that.inflateSync = function(z) {
            var n; // number of bytes to look at
            var p; // pointer to bytes
            var m; // number of marker bytes found in a row
            var r, w; // temporaries to save total_in and total_out
Severity: Minor
Found in src/log_analyzer/js/inflate.js - About 1 hr to fix

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

        function Config(good_length, max_lazy, nice_length, max_chain, func) {
            var that = this;
            that.good_length = good_length;
            that.max_lazy = max_lazy;
            that.nice_length = nice_length;
    Severity: Major
    Found in src/log_analyzer/js/deflate.js and 1 other location - About 1 hr to fix
    src/log_analyzer/js/deflate.js on lines 371..378

    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 66.

    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

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

            if(global.attachEvent) {
                var checkAsync = function() {
                        isPostMessageAsync = false;
                    };
                global.attachEvent('onmessage', checkAsync);
    Severity: Major
    Found in src/log_analyzer/js/analyzer.table.js and 1 other location - About 1 hr to fix
    src/log_analyzer/js/analyzer.table.js on lines 348..355

    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 66.

    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

                    var msg = '__modules' + (+new Date()),
                        onMessage = function(e) {
                            if(e.data === msg) {
                                e.stopPropagation && e.stopPropagation();
                                callFns();
    Severity: Major
    Found in src/log_analyzer/js/analyzer.table.js and 1 other location - About 1 hr to fix
    src/log_analyzer/js/analyzer.table.js on lines 1538..1544

    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 66.

    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

                var msg = '__nextTick' + (+new Date),
                    onMessage = function(e) {
                        if(e.data === msg) {
                            e.stopPropagation && e.stopPropagation();
                            callFns();
    Severity: Major
    Found in src/log_analyzer/js/analyzer.table.js and 1 other location - About 1 hr to fix
    src/log_analyzer/js/analyzer.table.js on lines 358..364

    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 66.

    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

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

                if(global.attachEvent) {
                    var checkAsync = function() {
                            isPostMessageAsync = false;
                        };
                    global.attachEvent('onmessage', checkAsync);
    Severity: Major
    Found in src/log_analyzer/js/analyzer.table.js and 1 other location - About 1 hr to fix
    src/log_analyzer/js/analyzer.table.js on lines 1528..1535

    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 66.

    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 StaticTree(static_tree, extra_bits, extra_base, elems, max_length) {
            var that = this;
            that.static_tree = static_tree;
            that.extra_bits = extra_bits;
            that.extra_base = extra_base;
    Severity: Major
    Found in src/log_analyzer/js/deflate.js and 1 other location - About 1 hr to fix
    src/log_analyzer/js/deflate.js on lines 411..418

    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 66.

    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 _liveCtxBind has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        _liveCtxBind : function(ctx, e, data, fn, fnCtx) {
            if(typeof e === 'object') {
                if(functions.isFunction(data) || functions.isFunction(fn)) { // mod change event
                    e = this._buildModEventName(e);
                } else {
    Severity: Minor
    Found in src/log_analyzer/js/analyzer.table.js - About 1 hr to fix

      Function getFileEntry has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function getFileEntry(fileEntry, entry, onend, onprogress, onerror, totalSize, checkCrc32) {
              var currentIndex = 0;
      
              function process(fileEntry, entry, onend, onprogress, onerror, totalSize) {
                  var childIndex = 0;
      Severity: Minor
      Found in src/log_analyzer/js/zip-fs.js - About 1 hr to fix

        Function fill_window has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                function fill_window() {
                    var n, m;
                    var p;
                    var more; // Amount of free space at the end of the window.
        
        
        Severity: Minor
        Found in src/log_analyzer/js/deflate.js - About 1 hr to fix

          Function append has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  that.append = function(data, onprogress) {
                      var err, buffers = [], lastIndex = 0, bufferIndex = 0, bufferSize = 0, array;
                      if (data.length === 0)
                          return;
                      z.next_in_index = 0;
          Severity: Minor
          Found in src/log_analyzer/js/inflate.js - About 1 hr to fix

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

                            if (z.next_out_index)
                                if (z.next_out_index == bufsize)
                                    buffers.push(new Uint8Array(buf));
                                else
                                    buffers.push(new Uint8Array(buf.subarray(0, z.next_out_index)));
            Severity: Major
            Found in src/log_analyzer/js/inflate.js and 1 other location - About 1 hr to fix
            src/log_analyzer/js/deflate.js on lines 2016..2020

            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 64.

            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

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

                            if (z.next_out_index)
                                if (z.next_out_index == bufsize)
                                    buffers.push(new Uint8Array(buf));
                                else
                                    buffers.push(new Uint8Array(buf.subarray(0, z.next_out_index)));
            Severity: Major
            Found in src/log_analyzer/js/deflate.js and 1 other location - About 1 hr to fix
            src/log_analyzer/js/inflate.js on lines 2112..2116

            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 64.

            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 addPointerEvent has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

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

              Function extendPointerRelease has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function extendPointerRelease(params) {
              
                  var data = params.event.data;
              
                  return {
              Severity: Minor
              Found in src/log_analyzer/js/analyzer.table.js - About 1 hr to fix

                Function HttpReader has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function HttpReader(url) {
                        var that = this;
                
                        function getData(callback, onerror) {
                            var request;
                Severity: Minor
                Found in src/log_analyzer/js/zip-ext.js - About 1 hr to fix

                  Function emit has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          emit : function(e, data) {
                              var storage = this[storageExpando],
                                  eventInstantiated = false;
                  
                              if(storage) {
                  Severity: Minor
                  Found in src/log_analyzer/js/analyzer.table.js - About 1 hr to fix

                    Function sanitize has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      function sanitize(options) {
                        var buttons;
                        var total;
                    
                        if (typeof options !== "object") {
                    Severity: Minor
                    Found in src/scanner/static/js/bootbox.js - About 1 hr to fix

                      Function getEntries has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                  getEntries : function(callback) {
                                      if (reader.size < 22) {
                                          onerror(ERR_BAD_FORMAT);
                                          return;
                                      }
                      Severity: Minor
                      Found in src/log_analyzer/js/zip.js - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language