antimalware/manul

View on GitHub

Showing 400 of 400 total issues

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

                    while (k < (j)) {
                        if (n !== 0)
                            r = Z_OK;
                        else {

Severity: Major
Found in src/log_analyzer/js/inflate.js and 3 other locations - About 5 hrs to fix
src/log_analyzer/js/inflate.js on lines 860..876
src/log_analyzer/js/inflate.js on lines 890..906
src/log_analyzer/js/inflate.js on lines 940..956

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

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 4 locations. Consider refactoring.
Open

                    while (k < (j)) {
                        if (n !== 0)
                            r = Z_OK;
                        else {

Severity: Major
Found in src/log_analyzer/js/inflate.js and 3 other locations - About 5 hrs to fix
src/log_analyzer/js/inflate.js on lines 800..816
src/log_analyzer/js/inflate.js on lines 860..876
src/log_analyzer/js/inflate.js on lines 940..956

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

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

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

                setup: function() {
                    $(this)
                        .on(binds.mouse[type], event.mouseHandler)
                        .on(binds.touch[type], event.touchHandler)
                        .on(binds.touch.down, event.touchDownHandler)
        Severity: Major
        Found in src/log_analyzer/js/analyzer.table.js and 1 other location - About 5 hrs to fix
        src/log_analyzer/js/analyzer.table.js on lines 4293..4303

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

        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

                teardown: function() {
                    $(this)
                        .off(binds.mouse[type], event.mouseHandler)
                        .off(binds.touch[type], event.touchHandler)
                        .off(binds.touch.down, event.touchDownHandler)
        Severity: Major
        Found in src/log_analyzer/js/analyzer.table.js and 1 other location - About 5 hrs to fix
        src/log_analyzer/js/analyzer.table.js on lines 4280..4290

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

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

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

                                                      if (q - r > 0 && e > (q - r)) {
                                                          do {
                                                              s.window[q++] = s.window[r++];
                                                          } while (--e !== 0);
                                                      } else {
              Severity: Major
              Found in src/log_analyzer/js/inflate.js and 1 other location - About 4 hrs to fix
              src/log_analyzer/js/inflate.js on lines 629..638

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

              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

                                              if (q - r > 0 && c > (q - r)) {
                                                  do {
                                                      s.window[q++] = s.window[r++];
                                                  } while (--c !== 0);
                                              } else {
              Severity: Major
              Found in src/log_analyzer/js/inflate.js and 1 other location - About 4 hrs to fix
              src/log_analyzer/js/inflate.js on lines 613..622

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

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

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

                                  this.bindTo('columns', 'click tap', function () {
                                      this.toggleMod(this.elem('columns'), 'open', 'yes');
                                      var popupFlag = this.findBlockInside({block: 'popup', modName: 'name', modVal: 'columns'});
              
                                      popupFlag.domElem.on('hide', function () {
              Severity: Major
              Found in src/log_analyzer/js/analyzer.table.js and 1 other location - About 4 hrs to fix
              src/log_analyzer/js/analyzer.table.js on lines 5569..5578

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

              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

                                  this.bindTo('flag', 'click tap', function () {
                                      this.toggleMod(this.elem('flag'), 'open', 'yes');
                                      var popupFlag = this.findBlockInside({block: 'popup', modName: 'name', modVal: 'flag'});
              
                                      popupFlag.domElem.on('hide', function () {
              Severity: Major
              Found in src/log_analyzer/js/analyzer.table.js and 1 other location - About 4 hrs to fix
              src/log_analyzer/js/analyzer.table.js on lines 5579..5588

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

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

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

                                        if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29) {
                                            mode = BADBLOCKS;
                                            z.msg = "too many length or distance symbols";
                                            r = Z_DATA_ERROR;
                    
                    
                    Severity: Major
                    Found in src/log_analyzer/js/inflate.js and 1 other location - About 4 hrs to fix
                    src/log_analyzer/js/inflate.js on lines 1354..1366

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

                    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

                                        if ((((~b) >>> 16) & 0xffff) != (b & 0xffff)) {
                                            mode = BADBLOCKS;
                                            z.msg = "invalid stored block lengths";
                                            r = Z_DATA_ERROR;
                    
                    
                    Severity: Major
                    Found in src/log_analyzer/js/inflate.js and 1 other location - About 4 hrs to fix
                    src/log_analyzer/js/inflate.js on lines 1444..1456

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

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language