tcosolutions/betterscan

Error during analysis

Closed this issue · 4 comments

On a private git repository, it has access, connects then gives:

dockerhub-server-1 | <blitzdb.backends.sql.queryset.QuerySet object at 0x7f58ae8c73d0>
dockerhub-server-1 | local variable 'branch' referenced before assignment
dockerhub-server-1 | Traceback (most recent call last):
dockerhub-server-1 | File "/srv/scanmycode/quantifiedcode/backend/api/resource.py", line 129, in handle
dockerhub-server-1 | handler_response = handler(*args, **kwargs)
dockerhub-server-1 | File "/srv/scanmycode/quantifiedcode/backend/decorators.py", line 381, in decorated_function
dockerhub-server-1 | return f(*args, **kwargs)
dockerhub-server-1 | File "/srv/scanmycode/quantifiedcode/backend/decorators.py", line 58, in decorated
dockerhub-server-1 | return func(*args, **kwargs)
dockerhub-server-1 | File "/srv/scanmycode/quantifiedcode/backend/decorators.py", line 124, in decorated_function
dockerhub-server-1 | return f(*args, **kwargs)
dockerhub-server-1 | File "/srv/scanmycode/quantifiedcode/backend/api/v1/badge.py", line 35, in get
dockerhub-server-1 | snapshot = get_snapshot(project, snapshot_id, raw=False, include=('project',))
dockerhub-server-1 | File "/srv/scanmycode/quantifiedcode/backend/helpers/snapshot.py", line 31, in get_snapshot
dockerhub-server-1 | snapshot = params['provider'](project, snapshot_id, raw=raw, only=only, include=include)
dockerhub-server-1 | File "/srv/scanmycode/quantifiedcode/plugins/git/backend/providers/snapshot.py", line 64, in resolve
dockerhub-server-1 | snapshot['branch'] = branch
dockerhub-server-1 | UnboundLocalError: local variable 'branch' referenced before assignment

@r3l1c7 Thanks for your message.

What git server are you using?

just using github with ssh

@r3l1c7

Please take a look here for examples (different Git servers, including GitHub)

https://github.com/marcinguy/betterscan-ce/wiki/Repo-Cloning

If you use ssh, please use ssh format i.e

ssh://git@github.com/organization/repo.git

and make sure you have either added:

  • Public key from Settings->Git to the repo
  • Your Private key in Betterscan in Settings->Git

You should be also collaborator on the repo or owner.

This seem to be working. Cannot reproduce your issue.

What branches do you have in the project?

Also please be on a lookout on line breaking, new lines while copying/pasting keys.

Closing due to inactivity