DarkmatterVale/regex4dummies

View on GitHub

Showing 57 of 274 total issues

Function default_parser has a Cognitive Complexity of 107 (exceeds 5 allowed). Consider refactoring.
Open

    def default_parser(self, base_string, test_string, pattern_arg):
        """
        Parsing code for the default literal parser.
        """

Severity: Minor
Found in regex4dummies/literal_parsers/literal_parsing.py - About 2 days 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 identify_common_patterns has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring.
Open

    def identify_common_patterns(self, base_sentence_info, test_sentence_info, patterns):
        # Creating variables
        sentence_information = {}

        # Comparing the two sets of strings together & finding patterns
Severity: Minor
Found in regex4dummies/semantic_parsers/nltk_parser.py - About 1 day 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 identify_common_patterns has a Cognitive Complexity of 90 (exceeds 5 allowed). Consider refactoring.
Open

    def identify_common_patterns(self, base_sentence_info, test_sentence_info, patterns):
        # Creating variables
        sentence_information = {}

        # Comparing the two sets of strings together & finding patterns
Severity: Minor
Found in regex4dummies/semantic_parsers/pattern_parser.py - About 1 day 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 identify_common_patterns has a Cognitive Complexity of 90 (exceeds 5 allowed). Consider refactoring.
Open

    def identify_common_patterns(self, base_sentence_info, test_sentence_info, patterns):
        # Creating variables
        sentence_information = {}

        # Comparing the two sets of strings together & finding patterns
Severity: Minor
Found in regex4dummies/semantic_parsers/nlpnet_parser.py - About 1 day 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 remove_sub_patterns has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring.
Open

    def remove_sub_patterns(self, patterns, pattern_information, strings):
        """
        Removes sub patterns, which are patterns within patterns.

        The sub patterns are not referenced in any context other than the context of the
Severity: Minor
Found in regex4dummies/literal_parsers/literal_parsing.py - About 1 day 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 find_object has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
Open

    def find_object(self, capitalized_sentence, raw_sentence, tagged_sentence, full_tagged_sentence):
        # Creating the variable that will hold the object(s) of the sentence
        updated_object = ""

        # Finding objects
Severity: Minor
Found in regex4dummies/semantic_parsers/nltk_parser.py - About 1 day 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 use_pattern has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
Open

    def use_pattern(self, base_string, test_string, pattern_arg):
        patterns = pattern_arg

        # Creating string textblob for analysis & analyzing the base_string's sentences
        base_blob = TextBlob(base_string)
Severity: Minor
Found in regex4dummies/semantic_parsers/pattern_parser.py - About 6 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function full_pattern_comparison has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
Open

    def full_pattern_comparison(self, parsed_data, patterns):
        # Creating variable containing pattern information that will be returned
        pattern_information = {}

        """
Severity: Minor
Found in regex4dummies/semantic_parsing.py - About 5 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function identify_topics has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
Open

    def identify_topics(self, strings):
        """
        Topic identifier function.

        inputs:
Severity: Minor
Found in regex4dummies/topic_finder.py - About 5 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function find_subject has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    def find_subject(self, capitalized_sentence, sentence_raw, sentence_tagged):
        """
        Get the full subject.
        """

Severity: Minor
Found in regex4dummies/semantic_parsers/nltk_parser.py - 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

Function generate_parsed_text has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    def generate_parsed_text(self):
        while True:
            input_text = self.input_text.get("1.0", tk.END)
            output_text = self.output_text.get("1.0", tk.END)

Severity: Minor
Found in examples/gui_application/main.py - About 3 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function find_prepositional_phrases has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    def find_prepositional_phrases(self, capitalized_sentence, raw_sentence, tagged_sentence):
        prepositional_phrases = ""

        for index in range(0, len(tagged_sentence)):
            # Removing prepositions
Severity: Minor
Found in regex4dummies/semantic_parsers/nltk_parser.py - About 3 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function use_nlpnet has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    def use_nlpnet(self, base_string, test_string, pattern_arg):
        """
        Main interface method from the NLPNET class to the rest of
        the program.
        """
Severity: Minor
Found in regex4dummies/semantic_parsers/nlpnet_parser.py - About 3 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function use_nltk has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    def use_nltk(self, base_string, test_string, pattern_arg):
        patterns = pattern_arg

        base_blob = TextBlob(base_string)
        base_sentence_info = []
Severity: Minor
Found in regex4dummies/semantic_parsers/nltk_parser.py - About 3 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function find_dependencies has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    def find_dependencies(self, **kwargs):
        """
        Interface method to regex4dummies returning
        the sentence dependencies gathered by given parser.
        """
Severity: Minor
Found in regex4dummies/dependency.py - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function process_raw_data_semantic has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    def process_raw_data_semantic(self, parser_name, information, correct_topics):
        """
        This function processes the raw data and turns it into useful information.
        That data provides useful statistics about the library's current "health".
        The function returns the overall score for the data, and specific statistics of the data.
Severity: Minor
Found in examples/accuracy_tester/main.py - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function find_verb has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    def find_verb(self, capitalized_sentence, raw_sentence, tagged_sentence):
        # Creating the variable that will hold the verb(s) of the sentence
        updated_verb = ""

        # Finding verb
Severity: Minor
Found in regex4dummies/semantic_parsers/nltk_parser.py - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

File nltk_parser.py has 266 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import re
import os
from textblob import TextBlob
import nltk
from fuzzywuzzy import fuzz
Severity: Minor
Found in regex4dummies/semantic_parsers/nltk_parser.py - About 2 hrs to fix

    Function identify_sentence_parts_nlpnet has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        def identify_sentence_parts_nlpnet(self, tokens, labels):
            subject = ""
            verb = ""
            object = ""
            prepositional_phrases = ""
    Severity: Minor
    Found in regex4dummies/semantic_parsers/nlpnet_parser.py - About 2 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function find_patterns has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        def find_patterns(self, strings, current_index, literal_find, patterns_arg, parser_name):
            """
            Recursive function that compares all strings and determins
            reliability score, applicability score, and pattern.
            """
    Severity: Minor
    Found in regex4dummies/compare.py - About 2 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Severity
    Category
    Status
    Source
    Language