Showing 63 of 199 total issues
Function Mock
has 284 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func Mock(w http.ResponseWriter, req *http.Request) {
ctx := appengine.NewContext(req)
coduno, err := model.Company{
Address: mail.Address{
- Create a ticketCreate a ticket
Function MockFrequentisChallenge
has 158 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func MockFrequentisChallenge(ctx context.Context, company *datastore.Key, w http.ResponseWriter, req *http.Request) {
taskOne, err := model.Task{
Assignment: model.Assignment{
Name: "Diamond Bot",
Description: "Diamond Bot is a simple remote-controlled robot. It is placed in a big hall that contains precious diamonds and dangerous bombs. " +
- Create a ticketCreate a ticket
Function Invitation
has 110 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func Invitation(ctx context.Context, w http.ResponseWriter, r *http.Request) (status int, err error) {
if r.Method != "POST" {
return http.StatusMethodNotAllowed, nil
}
- Create a ticketCreate a ticket
Function TaskByKey
has a Cognitive Complexity of 35 (exceeds 20 allowed). Consider refactoring. Open
Open
func TaskByKey(ctx context.Context, w http.ResponseWriter, r *http.Request) (status int, err error) {
p, ok := passenger.FromContext(ctx)
if !ok {
return http.StatusUnauthorized, nil
}
- Read upRead up
- Create a ticketCreate a ticket
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 JUnit
has 80 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func JUnit(ctx context.Context, tests, code io.Reader) (*model.JunitTestResult, error) {
image := newImage("javaut")
if err := prepareImage(image); err != nil {
return nil, err
- Create a ticketCreate a ticket
Function PostSubmission
has 74 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func PostSubmission(ctx context.Context, w http.ResponseWriter, r *http.Request) (status int, err error) {
if r.Method != "POST" {
return http.StatusMethodNotAllowed, nil
}
- Create a ticketCreate a ticket
Function SpringInt
has 72 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func SpringInt(ctx context.Context, sub model.KeyedSubmission, ball io.Reader) (*model.JunitTestResult, error) {
image := newImage("spring-integration")
if err := prepareImage(image); err != nil {
return nil, err
- Create a ticketCreate a ticket
Function mockData
has 67 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func mockData(ctx context.Context) {
var err error
CompanyKey, err = model.Company{
Address: mail.Address{
Name: "Coduno",
- Create a ticketCreate a ticket
Function Invitation
has 18 return statements (exceeds 4 allowed). Open
Open
func Invitation(ctx context.Context, w http.ResponseWriter, r *http.Request) (status int, err error) {
if r.Method != "POST" {
return http.StatusMethodNotAllowed, nil
}
- Create a ticketCreate a ticket
Function IODiffRun
has 64 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func IODiffRun(ctx context.Context, t model.KeyedTest, sub model.KeyedSubmission, ball io.Reader) (ts model.TestStats, err error) {
image := newImage(sub.Language)
if err = prepareImage(image); err != nil {
return
- Create a ticketCreate a ticket
Function CreateResult
has 61 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func CreateResult(ctx context.Context, w http.ResponseWriter, r *http.Request) (int, error) {
if r.Method != "POST" {
return http.StatusMethodNotAllowed, nil
}
- Create a ticketCreate a ticket
Function PostSubmission
has 15 return statements (exceeds 4 allowed). Open
Open
func PostSubmission(ctx context.Context, w http.ResponseWriter, r *http.Request) (status int, err error) {
if r.Method != "POST" {
return http.StatusMethodNotAllowed, nil
}
- Create a ticketCreate a ticket
Function createUser
has 59 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func createUser(ctx context.Context, w http.ResponseWriter, r *http.Request) (status int, err error) {
var body = struct {
Address, Nick, Password, Company string
}{}
- Create a ticketCreate a ticket
Function getUsers
has 55 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func getUsers(p *passenger.Passenger, ctx context.Context, w http.ResponseWriter, r *http.Request) (status int, err error) {
var u model.User
if err = datastore.Get(ctx, p.User, &u); err != nil {
return http.StatusInternalServerError, nil
}
- Create a ticketCreate a ticket
Function createUser
has 12 return statements (exceeds 4 allowed). Open
Open
func createUser(ctx context.Context, w http.ResponseWriter, r *http.Request) (status int, err error) {
var body = struct {
Address, Nick, Password, Company string
}{}
- Create a ticketCreate a ticket
Function CreateResult
has 12 return statements (exceeds 4 allowed). Open
Open
func CreateResult(ctx context.Context, w http.ResponseWriter, r *http.Request) (int, error) {
if r.Method != "POST" {
return http.StatusMethodNotAllowed, nil
}
- Create a ticketCreate a ticket
Function testRobot
has 54 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func testRobot(m *model.Map, in io.Reader) (tr model.RobotTestResults, err error) {
tr.Moves = append(tr.Moves, model.RobotLogEntry{Position: m.Start, Event: model.Move})
direction := model.Right
r := bufio.NewReader(in)
var picks []int
- Create a ticketCreate a ticket
Function TaskByKey
has 53 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func TaskByKey(ctx context.Context, w http.ResponseWriter, r *http.Request) (status int, err error) {
p, ok := passenger.FromContext(ctx)
if !ok {
return http.StatusUnauthorized, nil
}
- Create a ticketCreate a ticket
Function JUnit
has 11 return statements (exceeds 4 allowed). Open
Open
func JUnit(ctx context.Context, tests, code io.Reader) (*model.JunitTestResult, error) {
image := newImage("javaut")
if err := prepareImage(image); err != nil {
return nil, err
- Create a ticketCreate a ticket
Function SpringInt
has 10 return statements (exceeds 4 allowed). Open
Open
func SpringInt(ctx context.Context, sub model.KeyedSubmission, ball io.Reader) (*model.JunitTestResult, error) {
image := newImage("spring-integration")
if err := prepareImage(image); err != nil {
return nil, err
- Create a ticketCreate a ticket