msimerson/Haraka

View on GitHub
plugins/helo.checks.js

Summary

Maintainability
F
5 days
Test Coverage

File helo.checks.js has 399 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';
// Check various bits of the HELO string

const tlds      = require('haraka-tld');
const dns       = require('dns');
Severity: Minor
Found in plugins/helo.checks.js - About 5 hrs to fix

    Function forward_dns has 54 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    exports.forward_dns = function (next, connection, helo) {
    
        if (this.should_skip(connection, 'forward_dns')) return next();
        if (!this.cfg.check.valid_hostname) {
            connection.results.add(this, {err: 'forward_dns(valid_hostname disabled)'});
    Severity: Major
    Found in plugins/helo.checks.js - About 2 hrs to fix

      Function get_a_records has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

      exports.get_a_records = async function (host) {
      
          if (!/\./.test(host)) {
              // a single label is not a host name
              const e = new Error("invalid hostname");
      Severity: Minor
      Found in plugins/helo.checks.js - 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 big_company has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

      exports.big_company = function (next, connection, helo) {
      
          if (this.should_skip(connection, 'big_company')) return next();
      
          if (net_utils.is_ip_literal(helo)) {
      Severity: Minor
      Found in plugins/helo.checks.js - 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 proto_mismatch has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

      exports.proto_mismatch = function (next, connection, helo, proto) {
      
          if (this.should_skip(connection, 'proto_mismatch')) return next();
      
          const r = connection.results.get('helo.checks');
      Severity: Minor
      Found in plugins/helo.checks.js - 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 get_a_records has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      exports.get_a_records = async function (host) {
      
          if (!/\./.test(host)) {
              // a single label is not a host name
              const e = new Error("invalid hostname");
      Severity: Minor
      Found in plugins/helo.checks.js - About 1 hr to fix

        Function big_company has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        exports.big_company = function (next, connection, helo) {
        
            if (this.should_skip(connection, 'big_company')) return next();
        
            if (net_utils.is_ip_literal(helo)) {
        Severity: Minor
        Found in plugins/helo.checks.js - About 1 hr to fix

          Function load_helo_checks_ini has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          exports.load_helo_checks_ini = function () {
          
              const booleans = [
                  '+skip.private_ip',
                  '+skip.whitelist',
          Severity: Minor
          Found in plugins/helo.checks.js - About 1 hr to fix

            Function literal_mismatch has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            exports.literal_mismatch = function (next, connection, helo) {
            
                if (this.should_skip(connection, 'literal_mismatch')) return next();
            
                const literal = net_utils.get_ipany_re('^\\[(?:IPv6:)?','\\]$','').exec(helo);
            Severity: Minor
            Found in plugins/helo.checks.js - About 1 hr to fix

              Function valid_hostname has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

              exports.valid_hostname = function (next, connection, helo) {
              
                  if (this.should_skip(connection, 'valid_hostname')) return next();
              
                  if (net_utils.is_ip_literal(helo)) {
              Severity: Minor
              Found in plugins/helo.checks.js - 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 literal_mismatch has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

              exports.literal_mismatch = function (next, connection, helo) {
              
                  if (this.should_skip(connection, 'literal_mismatch')) return next();
              
                  const literal = net_utils.get_ipany_re('^\\[(?:IPv6:)?','\\]$','').exec(helo);
              Severity: Minor
              Found in plugins/helo.checks.js - 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 valid_hostname has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              exports.valid_hostname = function (next, connection, helo) {
              
                  if (this.should_skip(connection, 'valid_hostname')) return next();
              
                  if (net_utils.is_ip_literal(helo)) {
              Severity: Minor
              Found in plugins/helo.checks.js - About 1 hr to fix

                Function rdns_match has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                exports.rdns_match = function (next, connection, helo) {
                
                    if (this.should_skip(connection, 'rdns_match')) return next();
                
                    if (!helo) {
                Severity: Minor
                Found in plugins/helo.checks.js - About 35 mins 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 register has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                exports.register = function () {
                    this.load_helo_checks_ini();
                
                    if (this.cfg.check.proto_mismatch) {
                        // NOTE: these *must* run before init
                Severity: Minor
                Found in plugins/helo.checks.js - About 35 mins 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

                Avoid too many return statements within this function.
                Open

                        return next(DENY, 'HELO host does not match rDNS');
                Severity: Major
                Found in plugins/helo.checks.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return next(DENY, "You are not who you say you are");
                  Severity: Major
                  Found in plugins/helo.checks.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                return next(DENY, 'HELO IP literal not in the same /24 as your IP address');
                    Severity: Major
                    Found in plugins/helo.checks.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return next();
                      Severity: Major
                      Found in plugins/helo.checks.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return next(DENY, 'HELO IP literal does not match your IP address');
                        Severity: Major
                        Found in plugins/helo.checks.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                      return next();
                          Severity: Major
                          Found in plugins/helo.checks.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                        return next();
                            Severity: Major
                            Found in plugins/helo.checks.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                          return next(DENY, "HELO host name invalid");
                              Severity: Major
                              Found in plugins/helo.checks.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                        return next();
                                Severity: Major
                                Found in plugins/helo.checks.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                              return next(DENY, "Big company w/o rDNS? Unlikely.");
                                  Severity: Major
                                  Found in plugins/helo.checks.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                            return next();
                                    Severity: Major
                                    Found in plugins/helo.checks.js - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                              return next();
                                      Severity: Major
                                      Found in plugins/helo.checks.js - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                                return next();
                                        Severity: Major
                                        Found in plugins/helo.checks.js - About 30 mins to fix

                                          Avoid too many return statements within this function.
                                          Open

                                                  return next();
                                          Severity: Major
                                          Found in plugins/helo.checks.js - About 30 mins to fix

                                            Avoid too many return statements within this function.
                                            Open

                                                    return next();
                                            Severity: Major
                                            Found in plugins/helo.checks.js - About 30 mins to fix

                                              Function forward_dns has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                              Open

                                              exports.forward_dns = function (next, connection, helo) {
                                              
                                                  if (this.should_skip(connection, 'forward_dns')) return next();
                                                  if (!this.cfg.check.valid_hostname) {
                                                      connection.results.add(this, {err: 'forward_dns(valid_hostname disabled)'});
                                              Severity: Minor
                                              Found in plugins/helo.checks.js - About 25 mins 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 dynamic has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                              Open

                                              exports.dynamic = function (next, connection, helo) {
                                              
                                                  if (this.should_skip(connection, 'dynamic')) return next();
                                              
                                                  // Skip if no dots or an IP literal or address
                                              Severity: Minor
                                              Found in plugins/helo.checks.js - About 25 mins 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 load_helo_checks_ini has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                              Open

                                              exports.load_helo_checks_ini = function () {
                                              
                                                  const booleans = [
                                                      '+skip.private_ip',
                                                      '+skip.whitelist',
                                              Severity: Minor
                                              Found in plugins/helo.checks.js - About 25 mins 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 6 locations. Consider refactoring.
                                              Open

                                                  if (!connection.results.has('helo.checks', 'pass', /^valid_hostname/)) {
                                                      connection.results.add(this, {fail: 'forward_dns(invalid_hostname)'});
                                                      if (this.cfg.reject.forward_dns) {
                                                          return next(DENY, "Invalid HELO host cannot achieve forward DNS match");
                                                      }
                                              Severity: Major
                                              Found in plugins/helo.checks.js and 5 other locations - About 1 hr to fix
                                              plugins/helo.checks.js on lines 162..168
                                              plugins/helo.checks.js on lines 194..200
                                              plugins/helo.checks.js on lines 244..250
                                              plugins/helo.checks.js on lines 271..277
                                              plugins/helo.checks.js on lines 303..309

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

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

                                                  if (this.cfg.list_re?.test(helo)) {
                                                      connection.results.add(this, {fail: 'match_re'});
                                                      if (this.cfg.reject.match_re) {
                                                          return next(DENY, "That HELO not allowed here");
                                                      }
                                              Severity: Major
                                              Found in plugins/helo.checks.js and 5 other locations - About 1 hr to fix
                                              plugins/helo.checks.js on lines 162..168
                                              plugins/helo.checks.js on lines 244..250
                                              plugins/helo.checks.js on lines 271..277
                                              plugins/helo.checks.js on lines 303..309
                                              plugins/helo.checks.js on lines 382..388

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

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

                                                  if (!rdns || rdns === 'Unknown' || rdns === 'DNSERROR') {
                                                      connection.results.add(this, {fail: 'big_co(rDNS)'});
                                                      if (this.cfg.reject.big_company) {
                                                          return next(DENY, "Big company w/o rDNS? Unlikely.");
                                                      }
                                              Severity: Major
                                              Found in plugins/helo.checks.js and 5 other locations - About 1 hr to fix
                                              plugins/helo.checks.js on lines 162..168
                                              plugins/helo.checks.js on lines 194..200
                                              plugins/helo.checks.js on lines 244..250
                                              plugins/helo.checks.js on lines 271..277
                                              plugins/helo.checks.js on lines 382..388

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

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

                                                  if (!/\./.test(helo)) {
                                                      connection.results.add(this, {fail: 'valid_hostname(no_dot)'});
                                                      if (this.cfg.reject.valid_hostname) {
                                                          return next(DENY, 'HELO host must be a FQDN or address literal (RFC 5321 2.3.5)');
                                                      }
                                              Severity: Major
                                              Found in plugins/helo.checks.js and 5 other locations - About 1 hr to fix
                                              plugins/helo.checks.js on lines 194..200
                                              plugins/helo.checks.js on lines 244..250
                                              plugins/helo.checks.js on lines 271..277
                                              plugins/helo.checks.js on lines 303..309
                                              plugins/helo.checks.js on lines 382..388

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

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

                                                  if (net_utils.is_ip_in_str(connection.remote.ip, helo)) {
                                                      connection.results.add(this, {fail: 'dynamic'});
                                                      if (this.cfg.reject.dynamic) {
                                                          return next(DENY, 'HELO is dynamic');
                                                      }
                                              Severity: Major
                                              Found in plugins/helo.checks.js and 5 other locations - About 1 hr to fix
                                              plugins/helo.checks.js on lines 162..168
                                              plugins/helo.checks.js on lines 194..200
                                              plugins/helo.checks.js on lines 244..250
                                              plugins/helo.checks.js on lines 303..309
                                              plugins/helo.checks.js on lines 382..388

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

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

                                                  if (net_utils.get_ipany_re('^(?:IPv6:)?','$','').test(helo)) {
                                                      connection.results.add(this, {fail: 'bare_ip(invalid literal)'});
                                                      if (this.cfg.reject.bare_ip) {
                                                          return next(DENY, "Invalid address format in HELO");
                                                      }
                                              Severity: Major
                                              Found in plugins/helo.checks.js and 5 other locations - About 1 hr to fix
                                              plugins/helo.checks.js on lines 162..168
                                              plugins/helo.checks.js on lines 194..200
                                              plugins/helo.checks.js on lines 271..277
                                              plugins/helo.checks.js on lines 303..309
                                              plugins/helo.checks.js on lines 382..388

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

                                              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 (!this.cfg.bigco[helo]) {
                                                      connection.results.add(this, {pass: 'big_co(not)'});
                                                      return next();
                                                  }
                                              Severity: Minor
                                              Found in plugins/helo.checks.js and 1 other location - About 40 mins to fix
                                              plugins/helo.checks.js on lines 372..375

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

                                              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 (!this.cfg.check.valid_hostname) {
                                                      connection.results.add(this, {err: 'forward_dns(valid_hostname disabled)'});
                                                      return next();
                                                  }
                                              Severity: Minor
                                              Found in plugins/helo.checks.js and 1 other location - About 40 mins to fix
                                              plugins/helo.checks.js on lines 297..300

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

                                              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 (this.cfg.reject.mismatch !== undefined && this.cfg.reject.mismatch) {
                                                      this.logerror('deprecated setting mismatch renamed to host_mismatch');
                                                      this.cfg.reject.host_mismatch = this.cfg.reject.mismatch;
                                                  }
                                              Severity: Minor
                                              Found in plugins/helo.checks.js and 1 other location - About 35 mins to fix
                                              plugins/helo.checks.js on lines 93..96

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

                                              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 (this.cfg.check.mismatch !== undefined && !this.cfg.check.mismatch) {
                                                      this.logerror('deprecated setting mismatch renamed to host_mismatch');
                                                      this.cfg.check.host_mismatch = this.cfg.check.mismatch;
                                                  }
                                              Severity: Minor
                                              Found in plugins/helo.checks.js and 1 other location - About 35 mins to fix
                                              plugins/helo.checks.js on lines 97..100

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

                                              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 (!this.cfg.bigco) {
                                                      connection.results.add(this, {err: 'big_co(config missing)'});
                                                      return next();
                                                  }
                                              Severity: Minor
                                              Found in plugins/helo.checks.js and 1 other location - About 30 mins to fix
                                              plugins/relay.js on lines 139..142

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

                                              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

                                              There are no issues that match your filters.

                                              Category
                                              Status