Skip to content

Commit

Permalink
Reshuffling of interface functions propagation for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
Yevhen Zavhorodnii committed Jun 7, 2024
1 parent cbd7a10 commit 7bb0cd7
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 39 deletions.
23 changes: 14 additions & 9 deletions pkg/model/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,15 @@ func (what ReadResult) ExplainRisk(cfg explainRiskConfig, risk string, reporter
// TODO: consider about splitting this function into smaller ones for better reusability

type configReader interface {
AppFolder() string
ServerFolder() string
BuildTimestamp() string
Verbose() bool
RiskRulesPlugins() []string
SkipRiskRules() []string
ExecuteModelMacro() string
GraphvizDPI() int
TechnologyFilename() string
ServerPort() int
KeyFolder() string

AppFolder() string
OutputFolder() string
ServerFolder() string
TempFolder() string
KeyFolder() string

InputFile() string
DataFlowDiagramFilenamePNG() string
DataAssetDiagramFilenamePNG() string
Expand All @@ -52,6 +48,15 @@ type configReader interface {
JsonRisksFilename() string
JsonTechnicalAssetsFilename() string
JsonStatsFilename() string
TechnologyFilename() string

RiskRulesPlugins() []string
SkipRiskRules() []string
ExecuteModelMacro() string

ServerPort() int
GraphvizDPI() int

KeepDiagramSourceFiles() bool
IgnoreOrphanedRiskTracking() bool
}
Expand Down
40 changes: 22 additions & 18 deletions pkg/report/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,33 +37,37 @@ func (c *GenerateCommands) Defaults() *GenerateCommands {
}

type reportConfigReader interface {
MinGraphvizDPI() int
MaxGraphvizDPI() int
DiagramDPI() int
InputFile() string
OutputFolder() string
BuildTimestamp() string
ThreagileVersion() string

AppFolder() string
OutputFolder() string
TempFolder() string

InputFile() string
DataFlowDiagramFilenamePNG() string
DataAssetDiagramFilenamePNG() string
DataFlowDiagramFilenameDOT() string
DataAssetDiagramFilenameDOT() string
ReportFilename() string
TemplateFilename() string
ExcelRisksFilename() string
ExcelTagsFilename() string
JsonRisksFilename() string
JsonTechnicalAssetsFilename() string
JsonStatsFilename() string
ExcelRisksFilename() string
ExcelTagsFilename() string
DataFlowDiagramFilenamePNG() string
DataFlowDiagramFilenameDOT() string
DataAssetDiagramFilenamePNG() string
DataAssetDiagramFilenameDOT() string
KeepDiagramSourceFiles() bool
TempFolder() string
AddModelTitle() bool
SkipRiskRules() []string
BuildTimestamp() string
ThreagileVersion() string
TemplateFilename() string

SkipRiskRules() []string
RiskExcelConfigHideColumns() []string
RiskExcelConfigSortByColumns() []string
RiskExcelConfigWidthOfColumns() map[string]float64

DiagramDPI() int
MinGraphvizDPI() int
MaxGraphvizDPI() int

KeepDiagramSourceFiles() bool
AddModelTitle() bool
}

func Generate(config reportConfigReader, readResult *model.ReadResult, commands *GenerateCommands, progressReporter progressReporter) error {
Expand Down
29 changes: 17 additions & 12 deletions pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,33 +23,38 @@ import (
)

type serverConfigReader interface {
AppFolder() string
ServerFolder() string
BuildTimestamp() string
Verbose() bool
RiskRulesPlugins() []string
SkipRiskRules() []string
ExecuteModelMacro() string
GraphvizDPI() int
TechnologyFilename() string
ServerPort() int
KeyFolder() string
ThreagileVersion() string

AppFolder() string
ServerFolder() string
TempFolder() string
KeyFolder() string

InputFile() string
BackupHistoryFilesToKeep() int
DataFlowDiagramFilenamePNG() string
DataFlowDiagramFilenameDOT() string
DataAssetDiagramFilenamePNG() string
DataFlowDiagramFilenameDOT() string
DataAssetDiagramFilenameDOT() string
ReportFilename() string
ExcelRisksFilename() string
ExcelTagsFilename() string
JsonRisksFilename() string
JsonTechnicalAssetsFilename() string
JsonStatsFilename() string
TechnologyFilename() string

RiskRulesPlugins() []string
SkipRiskRules() []string
ExecuteModelMacro() string

ServerPort() int
GraphvizDPI() int
BackupHistoryFilesToKeep() int

KeepDiagramSourceFiles() bool
IgnoreOrphanedRiskTracking() bool
ThreagileVersion() string

ProgressReporter() types.ProgressReporter
}
Expand Down

0 comments on commit 7bb0cd7

Please sign in to comment.