SpamExperts/OrangeAssassin

View on GitHub

Showing 287 of 802 total issues

Function check_header_count_range has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def check_header_count_range(self, msg, header, minr, maxr, target=None):
Severity: Minor
Found in oa/plugins/header_eval.py - About 35 mins to fix

    Function check_rbl_envfrom has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def check_rbl_envfrom(self, msg, zone_set, rbl_server, subtest=None,
    Severity: Minor
    Found in oa/plugins/dns_eval.py - About 35 mins to fix

      Function check_rbl_from_domain has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def check_rbl_from_domain(self, msg, zone_set, rbl_server, subtest=None,
      Severity: Minor
      Found in oa/plugins/dns_eval.py - About 35 mins to fix

        Function _update_base64_text_stats has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def _update_base64_text_stats(self, msg, content_type,
        Severity: Minor
        Found in oa/plugins/mime_eval.py - About 35 mins to fix

          Function _compute_declassification_distance has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def _compute_declassification_distance(self, Ns, Nn, ns, nn, prob):
          Severity: Minor
          Found in oa/plugins/bayes.py - About 35 mins to fix

            Function check_for_from_domain_in_received_headers has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def check_for_from_domain_in_received_headers(self, msg, domain, desired,
            Severity: Minor
            Found in oa/plugins/relay_eval.py - About 35 mins to fix

              Function check_razor2_range has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def check_razor2_range(self, msg, engine, min, max, target=None):
              Severity: Minor
              Found in oa/plugins/razor2.py - About 35 mins to fix

                Function check_blank_line_ratio has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def check_blank_line_ratio(self, msg, minr, maxr, minlines=1, target=None):
                Severity: Minor
                Found in oa/plugins/body_eval.py - About 35 mins to fix

                  Function check_rbl has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def check_rbl(self, msg, zone_set, rbl_server, subtest=None, target=None):
                  Severity: Minor
                  Found in oa/plugins/dns_eval.py - About 35 mins to fix

                    Function image_to_text_ratio has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def image_to_text_ratio(self, msg, img_type, min_ratio, max_ratio=None,
                    Severity: Minor
                    Found in oa/plugins/image_info.py - About 35 mins to fix

                      Function check_illegal_chars has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def check_illegal_chars(self, msg, header, ratio, count, target=None):
                      Severity: Minor
                      Found in oa/plugins/header_eval.py - About 35 mins to fix

                        Function image_size_exact has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def image_size_exact(self, msg, img_type, height, width,
                        Severity: Minor
                        Found in oa/plugins/image_info.py - About 35 mins to fix

                          Function pixel_coverage has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def pixel_coverage(self, msg, img_type, min_coverage, max_coverage=None,
                          Severity: Minor
                          Found in oa/plugins/image_info.py - About 35 mins to fix

                            Function _compute_prob_for_token has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                def _compute_prob_for_token(self, token, ns, nn, s, n):
                            Severity: Minor
                            Found in oa/plugins/bayes.py - About 35 mins to fix

                              Function image_count has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def image_count(self, msg, img_type, min_count, max_count=None,
                              Severity: Minor
                              Found in oa/plugins/image_info.py - About 35 mins to fix

                                Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    def __init__(self, name, score=None, desc=None, priority=0, tflags=None):
                                Severity: Minor
                                Found in oa/rules/base.py - About 35 mins to fix

                                  Function _handle_include has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      def _handle_include(self, value, line, line_no, _depth=0,
                                  Severity: Minor
                                  Found in oa/rules/parser.py - About 35 mins to fix

                                    Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        def __init__(self, rule, match_func, stype, spam_score, ham_score):
                                    Severity: Minor
                                    Found in oa/plugins/short_circuit.py - About 35 mins to fix

                                      Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                          def __init__(self, address, sitepath, configpath, paranoid=False,
                                      Severity: Minor
                                      Found in oa/server.py - About 35 mins to fix

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

                                            def check_for_fake_aol_relay_in_rcvd(self, msg, target=None):
                                                """Check for common AOL fake received header."""
                                                for recv in msg.get_decoded_header("Received"):
                                                    if not Regex(r" rly-[a-z][a-z]\d\d\.", re.I).search(recv):
                                                        continue
                                        Severity: Minor
                                        Found in oa/plugins/header_eval.py - 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

                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language