Function migrateissues
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def migrateissues(owner, origin, destination, *issuenos, token=None):
token = lib.github.pat(token)
print("fetch issues to migrate")
- Read upRead up
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 github.py
has 377 lines of code (exceeds 250 allowed). Consider refactoring. Open
import lib.config
import lib.git
import lib.error
import lib.check
import lib.github
Function archive
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def archive(username, forks=False, gist=True, metadata=True):
"""
All credits go to Filippo Valsorda (https://filippo.io).
original -> https://filippo.io/archive-your-github-repo-and-data/
- Read upRead up
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 issues
has 16 arguments (exceeds 4 allowed). Consider refactoring. Open
def issues(owner=None, repo=None, number=None, user=False, org=None, token=None, milestone=None, filter=None, state=None, creator=None, assignee=None, mentioned=None, labels=None, sort=None, direction=None, since=None):
Function new
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
def new(name, org=None, team_id=None, token=None, auto_init=FALSE, private=FALSE, description=None, homepage=None, has_issues=TRUE, has_wiki=TRUE, has_downloads=TRUE, gitignore_template=None, license_template=None):
Function patch
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def patch(owner, repo, name, token=None, private=FALSE, description=None, homepage=None, has_issues=TRUE, has_wiki=TRUE, has_downloads=TRUE, default_branch=None):
Function migrateissues
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def migrateissues(owner, origin, destination, *issuenos, token=None):
token = lib.github.pat(token)
print("fetch issues to migrate")
Function editissue
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def editissue(owner, repo, number, title=None, body=None, assignee=None, state=None, milestone=None, labels=None, token=None):
Function download
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def download(target=YOU, name=None, t=None, token=None, prompt=True, prefix="", suffix="", regexp="", asuser=None, **kwargs):
for repo in lib.github.list(target, name, t, token):
repo = repo["full_name"]
- Read upRead up
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 download
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def download(target=YOU, name=None, t=None, token=None, prompt=True, prefix="", suffix="", regexp="", asuser=None, **kwargs):
Function createhook
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def createhook(owner, repo, url, name="web", content_type="json", secret=None, insecure_ssl="0", events="push", active=True, token=None):
Function createissue
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def createissue(owner, repo, title, body=None, assignee=None, milestone=None, labels=None, token=None):
Function updatemilestone
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def updatemilestone(owner, repo, number, title, state=None, description=None, due_on=None, token=None):
Function comments
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def comments(owner, repo, id=None, number=None, sort=None, direction=None, since=None, token=None):
Function milestones
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def milestones(owner, repo, number=None, state=None, sort=None, direction=None, token=None):
Function createmilestone
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def createmilestone(owner, repo, title, state=None, description=None, due_on=None, token=None):
Function updatelabel
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def updatelabel(owner, repo, oldname, newname, color, token=None):
Function editcomment
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def editcomment(owner, repo, id, body, token=None):
Function addlabels
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def addlabels(owner, repo, issue, labels=None, token=None):
Function migrateissues
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def migrateissues(owner, origin, destination, *issuenos, token=None):
Function listforks
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def listforks(owner, repo, sort=NEWEST, token=None, identify=False):
Function labels
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def labels(owner, repo, name=None, issue=None, token=None):
Function notifications
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def notifications(all=False, participating=False, since=None, before=None, token=None):
Function list
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def list(target=YOU, name=None, t=None, format="{full_name}", token=None):
Function createcomment
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def createcomment(owner, repo, number, body, token=None):
Function removelabel
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def removelabel(owner, repo, issue, label, token=None):
Function updatelabels
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def updatelabels(owner, repo, issue, labels=None, token=None):
Function createlabel
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def createlabel(owner, repo, name, color, token=None):
Function search
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def search(what, query, token=None, **kwargs):
response = lib.args.forward(lib.github.search, locals())
for result in response:
- Read upRead up
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"