lflux/eve-sdeloader

View on GitHub

Showing 182 of 182 total issues

Method Constellation.ImportSystem has 181 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (c *Constellation) ImportSystem(path string) error {
    f, err := os.Open(path)
    if err != nil {
        return err
    }
Severity: Major
Found in universe/system.go - About 6 hrs to fix

    Function Import has a Cognitive Complexity of 51 (exceeds 20 allowed). Consider refactoring.
    Open

    func Import(db *sql.DB, r io.Reader) error {
        defer utils.TimeTrack(time.Now(), "inventory")
        entries := make(map[int64]*Type)
    
        err := utils.LoadFromReader(r, entries)
    Severity: Minor
    Found in inventory/import.go - About 5 hrs to fix

    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 Import has a Cognitive Complexity of 44 (exceeds 20 allowed). Consider refactoring.
    Open

    func Import(db *sql.DB, r io.Reader) error {
        defer utils.TimeTrack(time.Now(), "blueprints")
    
        entries := make(map[string]*Blueprint)
    
    
    Severity: Minor
    Found in blueprints/import.go - About 4 hrs to fix

    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 Import has 99 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func Import(db *sql.DB, r io.Reader) error {
        defer utils.TimeTrack(time.Now(), "inventory")
        entries := make(map[int64]*Type)
    
        err := utils.LoadFromReader(r, entries)
    Severity: Major
    Found in inventory/import.go - About 2 hrs to fix

      Function ImportRegion has 87 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func ImportRegion(db *sql.DB, path string) error {
          defer utils.TimeTrack(time.Now(), path)
      
          f, err := os.Open(path)
          if err != nil {
      Severity: Major
      Found in universe/region.go - About 2 hrs to fix

        Function main has a Cognitive Complexity of 33 (exceeds 20 allowed). Consider refactoring.
        Open

        func main() {
            flag.Parse()
        
            if cpuprofile != "" {
                f, err := os.Create(cpuprofile)
        Severity: Minor
        Found in main.go - About 2 hrs to fix

        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 main has 84 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func main() {
            flag.Parse()
        
            if cpuprofile != "" {
                f, err := os.Create(cpuprofile)
        Severity: Major
        Found in main.go - About 2 hrs to fix

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

          func ImportMaterials(db *sql.DB, r io.Reader) error {
              defer utils.TimeTrack(time.Now(), "skin materials")
          
              entries := make(map[string]*SkinMaterial)
          
          
          Severity: Major
          Found in skins/import_materials.go and 1 other location - About 2 hrs to fix
          skins/import_licenses.go on lines 18..46

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 205.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

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

          func ImportLicenses(db *sql.DB, r io.Reader) error {
              defer utils.TimeTrack(time.Now(), "skin licenses")
          
              entries := make(map[string]*SkinLicense)
          
          
          Severity: Major
          Found in skins/import_licenses.go and 1 other location - About 2 hrs to fix
          skins/import_materials.go on lines 18..46

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 205.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Method Planet.ImportMoons has 81 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func (p *Planet) ImportMoons() error {
              var moons = make(Moons, 0, len(p.Moons))
              var err error
              for moonID, moon := range p.Moons {
                  moon.moonID = moonID
          Severity: Major
          Found in universe/planet.go - About 2 hrs to fix

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

            package blueprints
            
            type Reaction struct {
                Materials []Material
                Products  []Material
            Severity: Major
            Found in blueprints/reaction.go and 2 other locations - About 2 hrs to fix
            blueprints/invention.go on lines 1..28
            blueprints/manufacturing.go on lines 1..28

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 204.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

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

            package blueprints
            
            type Manufacturing struct {
                Materials []Material
                Products  []Material
            Severity: Major
            Found in blueprints/manufacturing.go and 2 other locations - About 2 hrs to fix
            blueprints/invention.go on lines 1..28
            blueprints/reaction.go on lines 1..28

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 204.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

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

            package blueprints
            
            type Invention struct {
                Materials []Material
                Products  []Material
            Severity: Major
            Found in blueprints/invention.go and 2 other locations - About 2 hrs to fix
            blueprints/manufacturing.go on lines 1..28
            blueprints/reaction.go on lines 1..28

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 204.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Method Region.ImportConstellation has 80 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func (r *Region) ImportConstellation(path string) error {
                f, err := os.Open(path)
                if err != nil {
                    return err
                }
            Severity: Major
            Found in universe/constellation.go - About 2 hrs to fix

              Method SolarSystem.ImportPlanet has 78 lines of code (exceeds 50 allowed). Consider refactoring.
              Open

              func (s *SolarSystem) ImportPlanet(planetID int64, planet Planet) error {
                  var err error
                  planet.name, err = getItemNameByID(planetID)
                  if err != nil {
                      return errors.Wrap(err, fmt.Sprintf("Error fetching planet name for planet %d, solar system %s",
              Severity: Major
              Found in universe/planet.go - About 2 hrs to fix

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

                func ImportVolume1(db *sql.DB, path string) error {
                    defer utils.TimeTrack(time.Now(), "volume1")
                
                    records, err := readCSV(path)
                    if err != nil {
                Severity: Major
                Found in volumes/import.go and 1 other location - About 1 hr to fix
                volumes/import.go on lines 73..96

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 181.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

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

                func ImportVolume2(db *sql.DB, path string) error {
                    defer utils.TimeTrack(time.Now(), "volume2")
                
                    records, err := readCSV(path)
                    if err != nil {
                Severity: Major
                Found in volumes/import.go and 1 other location - About 1 hr to fix
                volumes/import.go on lines 48..71

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 181.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Method Constellation.ImportSystem has 19 return statements (exceeds 4 allowed).
                Open

                func (c *Constellation) ImportSystem(path string) error {
                    f, err := os.Open(path)
                    if err != nil {
                        return err
                    }
                Severity: Major
                Found in universe/system.go - About 1 hr to fix

                  Function Import has 66 lines of code (exceeds 50 allowed). Consider refactoring.
                  Open

                  func Import(db *sql.DB, r io.Reader) error {
                      defer utils.TimeTrack(time.Now(), "blueprints")
                  
                      entries := make(map[string]*Blueprint)
                  
                  
                  Severity: Minor
                  Found in blueprints/import.go - About 1 hr to fix

                    Method Constellation.ImportSystem has a Cognitive Complexity of 28 (exceeds 20 allowed). Consider refactoring.
                    Open

                    func (c *Constellation) ImportSystem(path string) error {
                        f, err := os.Open(path)
                        if err != nil {
                            return err
                        }
                    Severity: Minor
                    Found in universe/system.go - About 1 hr to fix

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language