uccser/verto

View on GitHub

Showing 28 of 64 total issues

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

    def get_items(self, blocks):
        '''Collects all the blocks pertaining to the list. The
        list is are broken into blocks of each item.

        Args:
Severity: Minor
Found in verto/utils/overrides.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 run has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    def run(self, parent, blocks):
        ''' Generic run method for container tags.

        Args:
            parent: The parent node of the element tree that children
Severity: Minor
Found in verto/processors/GenericContainerBlockProcessor.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 parse_arguments has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

def parse_arguments(processor, inputs, arguments):
    '''Parses the arguments of a given input and ensures
    they meet the defined requirements.

    Args:
Severity: Minor
Found in verto/processors/utils.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 custom_parsing has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    def custom_parsing(self, content_blocks, argument_values):
        '''
        Extracts the text of an interactive block.

        Args:
Severity: Minor
Found in verto/processors/InteractiveContainerBlockProcessor.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 run has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    def run(self, lines):
        '''
        Validates lines and raising StyleErrors when rules are not upheld.
        Args:
            lines: A string of Markdown text.
Severity: Minor
Found in verto/processors/StylePreprocessor.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 VertoExtension.py has 259 lines of code (exceeds 250 allowed). Consider refactoring.
Open

from markdown.extensions import Extension
import markdown.util as utils

from verto.processors.CommentPreprocessor import CommentPreprocessor
from verto.processors.BlockquoteBlockProcessor import BlockquoteBlockProcessor
Severity: Minor
Found in verto/VertoExtension.py - About 2 hrs to fix

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

        def get_content(self, blocks):
            ''' Recursively parses blocks into an element tree, returning
            a string of the output.
    
            Args:
    Severity: Minor
    Found in verto/processors/ConditionalProcessor.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_parameters has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

    def process_parameters(ext, processor, parameters, argument_values):
        '''Processes a given set of arguments by the parameter definitions.
    
        Args:
            processor: The processor of the given arguments.
    Severity: Minor
    Found in verto/processors/utils.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 custom_parsing has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        def custom_parsing(self, argument_values):
            '''Determines the file path to use for an interactive's thumbnail.
    
            Args:
                argument_values (dict): Dictionary of arguments and values provided in tag block.
    Severity: Minor
    Found in verto/processors/InteractiveTagBlockProcessor.py - 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 run has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        def run(self, parent, blocks):
            ''' Replaces all conditionals with the given html template.
            Allows for recursively defined if statements.
    
            Args:
    Severity: Minor
    Found in verto/processors/ConditionalProcessor.py - 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 handle_data has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def handle_data(self, data):
            '''This method is called to process arbitrary data (e.g.
            text nodes and the content of <script>...</script> and
            <style>...</style>).
    
    
    Severity: Minor
    Found in verto/utils/HtmlParser.py - 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 run has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def run(self, root):
            ''' Processes the html tree finding code tags where scratch
            code is used and replaces with template html.
    
            Args:
    Severity: Minor
    Found in verto/processors/ScratchTreeprocessor.py - 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 __init__ has 10 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(self, uids=set(), occurance_separator='-', entities=True,
    Severity: Major
    Found in verto/utils/UniqueSlugify.py - About 1 hr to fix

      Function run has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def run(self, parent, blocks):
              ''' Generic run method for container tags.
      
              Args:
                  parent: The parent node of the element tree that children
      Severity: Minor
      Found in verto/processors/GenericContainerBlockProcessor.py - About 1 hr to fix

        Function extendMarkdown has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def extendMarkdown(self, md, md_globals):
                '''Inherited from the markdown.Extension class. Extends
                markdown with custom processors.
                    ['style', StylePreprocessor(self, md), '_begin']
        
        
        Severity: Minor
        Found in verto/VertoExtension.py - About 55 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 handle_endtag has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def handle_endtag(self, tag):
                '''This method is called to handle the end tag of an
                element (e.g. `</div>`).
        
                Args:
        Severity: Minor
        Found in verto/utils/HtmlParser.py - About 55 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 __init__ has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def __init__(self, processors=[], html_templates={}, extensions=[], settings={}, *args, **kwargs):
                '''
                Args:
                    processors: A set of processor names given as strings for which
                        their processors are enabled. If given, all other
        Severity: Minor
        Found in verto/VertoExtension.py - About 55 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 run has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def run(self, parent, blocks):
                '''Replaces all video tags {video url="example"} with embeded
                video link. Inherited from BlockProcessor class.
        
                Args:
        Severity: Minor
        Found in verto/processors/VideoBlockProcessor.py - About 55 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 extract_video_identifier has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def extract_video_identifier(self, video_url):
                '''Extracts an identifier and service from a video url.
                Args:
                    video_url: The input url.
                Returns:
        Severity: Minor
        Found in verto/processors/VideoBlockProcessor.py - About 55 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 custom_parsing has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            def custom_parsing(self, content_blocks, argument_values):
                '''
                Extracts the title and subtitle of panel block's contents.
        
                Args:
        Severity: Minor
        Found in verto/processors/PanelBlockProcessor.py - About 45 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