topic2k/pygcgen

View on GitHub

Showing 32 of 48 total issues

File generator.py has 926 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-

from __future__ import division, print_function

import copy
Severity: Major
Found in pygcgen/generator.py - About 2 days to fix

    Generator has 52 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Generator(object):
        """
        A Generator responsible for all logic, related with
        change log generation from ready-to-parse issues.
        """
    Severity: Major
    Found in pygcgen/generator.py - About 7 hrs to fix

      File options_parser.py has 347 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      
      from __future__ import print_function
      
      import argparse
      Severity: Minor
      Found in pygcgen/options_parser.py - About 4 hrs to fix

        File fetcher.py has 310 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        
        from __future__ import absolute_import, division, print_function
        
        import os
        Severity: Minor
        Found in pygcgen/fetcher.py - About 3 hrs to fix

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

              def fetch_events_async(self, issues, tag_name):
                  """
                  Fetch events for all issues and add them to self.events
          
                  :param list issues: all issues
          Severity: Minor
          Found in pygcgen/fetcher.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 parse_options has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def parse_options(self, options):
                  parser = argparse.ArgumentParser(
                      description='Fully automate changelog generation.',
                  )
          
          
          Severity: Major
          Found in pygcgen/options_parser.py - About 2 hrs to fix

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

                def fetch_closed_issues_and_pr(self):
                    """
                    This method fetches all closed issues and separate them to
                    pull requests and pure issues (pull request is kind of issue
                    in term of GitHub).
            Severity: Minor
            Found in pygcgen/fetcher.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_options has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

                def parse_options(self, options):
                    parser = argparse.ArgumentParser(
                        description='Fully automate changelog generation.',
                    )
            
            
            Severity: Minor
            Found in pygcgen/options_parser.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 fetch_tags_dates has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

                def fetch_tags_dates(self):
                    """ Async fetching of all tags dates. """
            
                    if self.options.verbose:
                        print(
            Severity: Minor
            Found in pygcgen/generator.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 filter_merged_pull_requests has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                def filter_merged_pull_requests(self, pull_requests):
                    """
                    This method filter only merged PR and fetch missing required
                    attributes for pull requests. Using merged date is more correct
                    than closed date.
            Severity: Minor
            Found in pygcgen/generator.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 detect_actual_closed_dates has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                def detect_actual_closed_dates(self, issues, kind):
                    """
                    Find correct closed dates, if issues was closed by commits.
            
                    :param list issues: issues to check
            Severity: Minor
            Found in pygcgen/generator.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 parse_by_sections_for_issues has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                def parse_by_sections_for_issues(self, issues, sections_a, issues_a):
                    for section, sect_labels in self.options.sections.items():
                        added_issues = []
                        for issue in issues:
                            is_labels = issue.get('labels')
            Severity: Minor
            Found in pygcgen/generator.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 convert_value has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                def convert_value(value, option_name):
                    if option_name in KNOWN_ARRAY_KEYS:
                        val = []
                        for item in regex.finditer(value):
                            val.append(
            Severity: Minor
            Found in pygcgen/optionsfile_parser.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 fetch_closed_pull_requests has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                def fetch_closed_pull_requests(self):
                    """
                    Fetch all pull requests. We need them to detect "merged_at" parameter
            
                    :rtype: list
            Severity: Minor
            Found in pygcgen/fetcher.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 parse_by_sections_for_pr has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                def parse_by_sections_for_pr(self, pull_requests, sections_a):
                    for section, sect_labels in self.options.sections.items():
                        added_pull_requests = []
                        for pr in pull_requests:
                            pr_labels = pr.get('labels')
            Severity: Minor
            Found in pygcgen/generator.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 get_all_tags has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                def get_all_tags(self):
                    """
                    Fetch all tags for repository from Github.
            
                    :return: tags in repository
            Severity: Minor
            Found in pygcgen/fetcher.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 NextPage has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

            def NextPage(gh):
                """
                Checks if a GitHub call returned multiple pages of data.
            
                :param gh: GitHub() instance
            Severity: Minor
            Found in pygcgen/fetcher.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 10 (exceeds 5 allowed). Consider refactoring.
            Open

                def run(self):
                    """
                    The entry point of this script to generate change log
                    'ChangelogGeneratorError' Is thrown when one
                    of the specified tags was not found in list of tags.
            Severity: Minor
            Found in pygcgen/main.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 remove_issues_in_milestones has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                def remove_issues_in_milestones(self, filtered_issues):
                    """
                    :param list(dict) filtered_issues: Filtered issues.
                    :rtype: list(dict)
                    :return: List with removed issues, that contain milestones with
            Severity: Minor
            Found in pygcgen/generator.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 exclude_issues_by_labels has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                def exclude_issues_by_labels(self, issues):
                    """
                    Delete all issues with labels from exclude-labels option.
            
                    :param list(dict) issues: All issues for tag.
            Severity: Minor
            Found in pygcgen/generator.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

            Severity
            Category
            Status
            Source
            Language