Showing 20 of 62 total issues
Function init
has 83 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func init() {
r = render.New(render.Options{
// HTML layout to be used for all HTML requests:
HTMLLayout: "application.html",
Function init
has 18 return statements (exceeds 4 allowed). Open
Open
func init() {
r = render.New(render.Options{
// HTML layout to be used for all HTML requests:
HTMLLayout: "application.html",
Function init
has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring. Open
Open
func init() {
r = render.New(render.Options{
// HTML layout to be used for all HTML requests:
HTMLLayout: "application.html",
- 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 moduleOptions
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
moduleOptions: function() {
return {
rules: [
{
test: /\.css$/,
Function buildConfig
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
buildConfig: function(){
const env = process.env.NODE_ENV || "development";
var config = {
mode: env,
Function AuthCallback
has 7 return statements (exceeds 4 allowed). Open
Open
func AuthCallback(c buffalo.Context) error {
gu, err := gothic.CompleteUserAuth(c.Response(), c.Request())
if err != nil {
return c.Error(401, err)
}
Method DutoniansResource.Update
has 6 return statements (exceeds 4 allowed). Open
Open
func (v DutoniansResource) Update(c buffalo.Context) error {
// Get the DB connection from the context
tx, ok := c.Value("tx").(*pop.Connection)
if !ok {
return errors.WithStack(errors.New("no transaction found"))
Method ProposalsResource.Update
has 6 return statements (exceeds 4 allowed). Open
Open
func (v ProposalsResource) Update(c buffalo.Context) error {
// Get the DB connection from the context
tx, ok := c.Value("tx").(*pop.Connection)
if !ok {
return errors.WithStack(errors.New("no transaction found"))
Method ProposalsResource.Edit
has 6 return statements (exceeds 4 allowed). Open
Open
func (v ProposalsResource) Edit(c buffalo.Context) error {
// Get the DB connection from the context
// tx, ok := c.Value("tx").(*pop.Connection)
// if !ok {
// return errors.WithStack(errors.New("no transaction found"))
Method SponsorshipsResource.Update
has 6 return statements (exceeds 4 allowed). Open
Open
func (v SponsorshipsResource) Update(c buffalo.Context) error {
// Get the DB connection from the context
tx, ok := c.Value("tx").(*pop.Connection)
if !ok {
return errors.WithStack(errors.New("no transaction found"))
Method LinksResource.Update
has 6 return statements (exceeds 4 allowed). Open
Open
func (v LinksResource) Update(c buffalo.Context) error {
// Get the DB connection from the context
tx, ok := c.Value("tx").(*pop.Connection)
if !ok {
return errors.WithStack(errors.New("no transaction found"))
Method EventsResource.Update
has 6 return statements (exceeds 4 allowed). Open
Open
func (v EventsResource) Update(c buffalo.Context) error {
// Get the DB connection from the context
tx, ok := c.Value("tx").(*pop.Connection)
if !ok {
return errors.WithStack(errors.New("no transaction found"))
Method AbstractsResource.Update
has 6 return statements (exceeds 4 allowed). Open
Open
func (v AbstractsResource) Update(c buffalo.Context) error {
// Get the DB connection from the context
tx, ok := c.Value("tx").(*pop.Connection)
if !ok {
return errors.WithStack(errors.New("no transaction found"))
Method LinksResource.Create
has 5 return statements (exceeds 4 allowed). Open
Open
func (v LinksResource) Create(c buffalo.Context) error {
// Get the DB connection from the context
tx, ok := c.Value("tx").(*pop.Connection)
if !ok {
return errors.WithStack(errors.New("no transaction found"))
Method ProposalsResource.New
has 5 return statements (exceeds 4 allowed). Open
Open
func (v ProposalsResource) New(c buffalo.Context) error {
// return c.Render(200, r.Auto(c, &models.Proposal{}))
// }
// func NewProposal(c buffalo.Context) error {
Method EventsResource.Create
has 5 return statements (exceeds 4 allowed). Open
Open
func (v EventsResource) Create(c buffalo.Context) error {
// Get the DB connection from the context
tx, ok := c.Value("tx").(*pop.Connection)
if !ok {
return errors.WithStack(errors.New("no transaction found"))
Method AbstractsResource.Create
has 5 return statements (exceeds 4 allowed). Open
Open
func (v AbstractsResource) Create(c buffalo.Context) error {
// Get the DB connection from the context
tx, ok := c.Value("tx").(*pop.Connection)
if !ok {
return errors.WithStack(errors.New("no transaction found"))
Method DutoniansResource.Create
has 5 return statements (exceeds 4 allowed). Open
Open
func (v DutoniansResource) Create(c buffalo.Context) error {
// Get the DB connection from the context
tx, ok := c.Value("tx").(*pop.Connection)
if !ok {
Method ProposalsResource.Create
has 5 return statements (exceeds 4 allowed). Open
Open
func (v ProposalsResource) Create(c buffalo.Context) error {
// Get the DB connection from the context
tx, ok := c.Value("tx").(*pop.Connection)
if !ok {
Method SponsorshipsResource.Create
has 5 return statements (exceeds 4 allowed). Open
Open
func (v SponsorshipsResource) Create(c buffalo.Context) error {
// Get the DB connection from the context
tx, ok := c.Value("tx").(*pop.Connection)
if !ok {