bpicode/fritzctl

View on GitHub

Showing 9 of 51 total issues

Function TestTableGeneration has 98 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func TestTableGeneration(t *testing.T) {
    tcs := []struct {
        name     string
        table    *Table
        expected string
Severity: Major
Found in internal/console/table_test.go - About 2 hrs to fix

    Function TestApplyViaAhaLargeSystemWithErrors has 59 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func TestApplyViaAhaLargeSystemWithErrors(t *testing.T) {
        applier := NewApplier(&fritzAlwaysError{})
        err := applier.Apply(
            &Plan{
                Switches: []Switch{
    Severity: Minor
    Found in manifest/applier_aha_http_test.go - About 1 hr to fix

      Function TestApplyViaAhaLargeSystem has 59 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func TestApplyViaAhaLargeSystem(t *testing.T) {
          applier := NewApplier(&fritzAlwaysSuccess{})
          err := applier.Apply(
              &Plan{
                  Switches: []Switch{
      Severity: Minor
      Found in manifest/applier_aha_http_test.go - About 1 hr to fix

        Function TestScatterGatherMixedResults has 11 return statements (exceeds 4 allowed).
        Open

        func TestScatterGatherMixedResults(t *testing.T) {
        
            work := map[string]func() (string, error){
                "1": func() (string, error) { return "1 says OK", nil },
                "2": func() (string, error) { return "", errors.New("2 says not ok") },
        Severity: Major
        Found in fritz/concurrent_test.go - About 1 hr to fix

          Function TestScatterGatherAllNotOk has 11 return statements (exceeds 4 allowed).
          Open

          func TestScatterGatherAllNotOk(t *testing.T) {
          
              work := map[string]func() (string, error){
                  "1": func() (string, error) { return "", errors.New("1 says not ok") },
                  "2": func() (string, error) { return "", errors.New("2 says not ok") },
          Severity: Major
          Found in fritz/concurrent_test.go - About 1 hr to fix

            Function TestCommands has 52 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func TestCommands(t *testing.T) {
                oldPlaces := defaultConfigPlaces
                defer func() { defaultConfigPlaces = oldPlaces }()
                defaultConfigPlaces = append([]config.Place{config.InDir("../testdata/config", "config_localhost_http_test.json", config.JSON())}, defaultConfigPlaces...)
            
            
            Severity: Minor
            Found in cmd/commands_test.go - About 1 hr to fix

              Function TestScatterGatherAllOk has 10 return statements (exceeds 4 allowed).
              Open

              func TestScatterGatherAllOk(t *testing.T) {
              
                  work := map[string]func() (string, error){
                      "1": func() (string, error) { return "1 says OK", nil },
                      "2": func() (string, error) { return "2 says OK", nil },
              Severity: Major
              Found in fritz/concurrent_test.go - About 1 hr to fix

                Function TestDeviceFiltering has 6 return statements (exceeds 4 allowed).
                Open

                func TestDeviceFiltering(t *testing.T) {
                    for _, tc := range []struct {
                        name    string
                        xmlfile string
                        filter  func(Devicelist) []Device
                Severity: Major
                Found in fritz/devicelist_test.go - About 40 mins to fix

                  Method cliConfigurer.Obtain has 5 return statements (exceeds 4 allowed).
                  Open

                  func (iCLI *cliConfigurer) Obtain(r io.Reader) (ExtendedConfig, error) {
                      f := ""
                      c := Config{}
                      err := proceedUntilFirstError(
                          func() (err error) {
                  Severity: Major
                  Found in config/configurer.go - About 35 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language