yoyo-project/yoyo

View on GitHub

Showing 85 of 85 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

package city
 
import (
"fmt"
 
 
Severity: Major
Found in example/postgres/yoyo/repositories/query/city/query.go and 1 other location - About 4 days to fix
example/mysql/yoyo/repositories/query/city/query.go on lines 1..259

Similar blocks of code found in 2 locations. Consider refactoring.
Open

package city
 
import (
"fmt"
 
 
Severity: Major
Found in example/mysql/yoyo/repositories/query/city/query.go and 1 other location - About 4 days to fix
example/postgres/yoyo/repositories/query/city/query.go on lines 1..259

Similar blocks of code found in 2 locations. Consider refactoring.
Open

package no_pk_table
 
import (
"fmt"
 
 
Severity: Major
Found in example/postgres/yoyo/repositories/query/no_pk_table/query.go and 1 other location - About 4 days to fix
example/mysql/yoyo/repositories/query/no_pk_table/query.go on lines 1..225

Similar blocks of code found in 2 locations. Consider refactoring.
Open

package no_pk_table
 
import (
"fmt"
 
 
Severity: Major
Found in example/mysql/yoyo/repositories/query/no_pk_table/query.go and 1 other location - About 4 days to fix
example/postgres/yoyo/repositories/query/no_pk_table/query.go on lines 1..225

Similar blocks of code found in 2 locations. Consider refactoring.
Open

package repositories
 
import (
"database/sql"
"fmt"
Severity: Major
Found in example/postgres/yoyo/repositories/repository_city.go and 1 other location - About 2 days to fix
example/mysql/yoyo/repositories/repository_city.go on lines 1..187

Similar blocks of code found in 2 locations. Consider refactoring.
Open

package repositories
 
import (
"database/sql"
"fmt"
Severity: Major
Found in example/mysql/yoyo/repositories/repository_city.go and 1 other location - About 2 days to fix
example/postgres/yoyo/repositories/repository_city.go on lines 1..187

Similar blocks of code found in 2 locations. Consider refactoring.
Open

package repositories
 
import (
"database/sql"
"fmt"
Severity: Major
Found in example/mysql/yoyo/repositories/repository_no_pk_table.go and 1 other location - About 1 day to fix
example/postgres/yoyo/repositories/repository_no_pk_table.go on lines 1..117

Similar blocks of code found in 2 locations. Consider refactoring.
Open

package repositories
 
import (
"database/sql"
"fmt"
Severity: Major
Found in example/postgres/yoyo/repositories/repository_no_pk_table.go and 1 other location - About 1 day to fix
example/mysql/yoyo/repositories/repository_no_pk_table.go on lines 1..117

Function NewGenerator has a Cognitive Complexity of 84 (exceeds 20 allowed). Consider refactoring.
Open

func NewGenerator(
generateEntity EntityGenerator,
generateRepository EntityGenerator,
generateQueryFile EntityGenerator,
generateRepositoriesFile WriteGenerator,
Severity: Minor
Found in internal/repository/generate.go - About 1 day to fix

Identical blocks of code found in 2 locations. Consider refactoring.
Open

package repositories
 
import (
"context"
"database/sql"
Severity: Major
Found in example/postgres/yoyo/repositories/repositories.go and 1 other location - About 1 day to fix
example/mysql/yoyo/repositories/repositories.go on lines 1..71

Identical blocks of code found in 2 locations. Consider refactoring.
Open

package repositories
 
import (
"context"
"database/sql"
Severity: Major
Found in example/mysql/yoyo/repositories/repositories.go and 1 other location - About 1 day to fix
example/postgres/yoyo/repositories/repositories.go on lines 1..71

Function InitDatabaseReader has a Cognitive Complexity of 59 (exceeds 20 allowed). Consider refactoring.
Open

func InitDatabaseReader(loadAdapter AdapterLoader) DatabaseReader {
return func(config yoyo.Config) (db schema.Database, err error) {
var adapter Adapter
adapter, err = loadAdapter(config.Schema.Dialect)
if err != nil {
Severity: Minor
Found in internal/reverse/schema.go - About 6 hrs to fix

Similar blocks of code found in 4 locations. Consider refactoring.
Open

package repositories
 
import (
"database/sql"
"fmt"
Severity: Major
Found in example/mysql/yoyo/repositories/entity_no_pk_table.go and 3 other locations - About 6 hrs to fix
example/mysql/yoyo/repositories/entity_city.go on lines 1..68
example/postgres/yoyo/repositories/entity_city.go on lines 1..68
example/postgres/yoyo/repositories/entity_no_pk_table.go on lines 1..68

Similar blocks of code found in 4 locations. Consider refactoring.
Open

package repositories
 
import (
"database/sql"
"fmt"
Severity: Major
Found in example/postgres/yoyo/repositories/entity_no_pk_table.go and 3 other locations - About 6 hrs to fix
example/mysql/yoyo/repositories/entity_city.go on lines 1..68
example/mysql/yoyo/repositories/entity_no_pk_table.go on lines 1..68
example/postgres/yoyo/repositories/entity_city.go on lines 1..68

Similar blocks of code found in 4 locations. Consider refactoring.
Open

package repositories
 
import (
"database/sql"
"fmt"
Severity: Major
Found in example/postgres/yoyo/repositories/entity_city.go and 3 other locations - About 6 hrs to fix
example/mysql/yoyo/repositories/entity_city.go on lines 1..68
example/mysql/yoyo/repositories/entity_no_pk_table.go on lines 1..68
example/postgres/yoyo/repositories/entity_no_pk_table.go on lines 1..68

Similar blocks of code found in 4 locations. Consider refactoring.
Open

package repositories
 
import (
"database/sql"
"fmt"
Severity: Major
Found in example/mysql/yoyo/repositories/entity_city.go and 3 other locations - About 6 hrs to fix
example/mysql/yoyo/repositories/entity_no_pk_table.go on lines 1..68
example/postgres/yoyo/repositories/entity_city.go on lines 1..68
example/postgres/yoyo/repositories/entity_no_pk_table.go on lines 1..68

Query has 46 methods (exceeds 20 allowed). Consider refactoring.
Open

type Query struct {
n query.Node
}
Severity: Minor
Found in example/mysql/yoyo/repositories/query/person/query.go - About 6 hrs to fix

    File query.go has 676 lines of code (exceeds 500 allowed). Consider refactoring.
    Open

    package person
     
    import (
    "fmt"
     
     
    Severity: Minor
    Found in example/mysql/yoyo/repositories/query/person/query.go - About 6 hrs to fix

      Query has 40 methods (exceeds 20 allowed). Consider refactoring.
      Open

      type Query struct {
      n query.Node
      }
      Severity: Minor
      Found in example/postgres/yoyo/repositories/query/person/query.go - About 5 hrs to fix

        Function NewEntityRepositoryGenerator has a Cognitive Complexity of 48 (exceeds 20 allowed). Consider refactoring.
        Open

        func NewEntityRepositoryGenerator(packageName string, adapter Adapter, reposPath string, packagePath Finder, db schema.Database) EntityGenerator {
        return func(t schema.Table, w io.StringWriter) (err error) {
        var pkNames, insertCNames, selectCNames, scanFields, inFields, pkFields, colAssignments []string
        for _, col := range t.Columns {
        if col.PrimaryKey {
        Severity: Minor
        Found in internal/repository/generate_repository.go - About 4 hrs to fix
        Severity
        Category
        Status
        Source
        Language