From 0a0bb01ef9a498ca354cd1fd869e6726e99f15ea Mon Sep 17 00:00:00 2001 From: ltramma Date: Fri, 31 May 2019 16:58:02 +0100 Subject: [PATCH] RDMPDEV-186: fixed security code scan warnings --- Rdmp.Core/Curation/Data/Plugin.cs | 2 +- .../Curation/Data/Serialization/JsonConvertExtensions.cs | 4 ++-- .../FilterUIs/ParameterUIs/ParameterCollectionUI.cs | 2 ++ rakefile.rb | 6 +++--- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Rdmp.Core/Curation/Data/Plugin.cs b/Rdmp.Core/Curation/Data/Plugin.cs index 4076f3ae83..a3d9ead131 100644 --- a/Rdmp.Core/Curation/Data/Plugin.cs +++ b/Rdmp.Core/Curation/Data/Plugin.cs @@ -63,7 +63,7 @@ public string GetShortName() } /// - /// The master version of the (not the dlls inside - See ). + /// The master version of the /// Not currently used /// public Version PluginVersion diff --git a/Rdmp.Core/Curation/Data/Serialization/JsonConvertExtensions.cs b/Rdmp.Core/Curation/Data/Serialization/JsonConvertExtensions.cs index 32085093c8..fd002dd364 100644 --- a/Rdmp.Core/Curation/Data/Serialization/JsonConvertExtensions.cs +++ b/Rdmp.Core/Curation/Data/Serialization/JsonConvertExtensions.cs @@ -28,7 +28,7 @@ public static string SerializeObject(object value, IRDMPPlatformRepositoryServic var settings = new JsonSerializerSettings { - TypeNameHandling = TypeNameHandling.Objects, + TypeNameHandling = TypeNameHandling.None, TypeNameAssemblyFormatHandling = TypeNameAssemblyFormatHandling.Simple, Converters = new JsonConverter[] {databaseEntityJsonConverter} }; @@ -56,7 +56,7 @@ public static object DeserializeObject(string value, Type type,IRDMPPlatformRepo var settings = new JsonSerializerSettings { - TypeNameHandling = TypeNameHandling.Objects, + TypeNameHandling = TypeNameHandling.None, TypeNameAssemblyFormatHandling = TypeNameAssemblyFormatHandling.Simple, Converters = new JsonConverter[] {databaseEntityJsonConverter, lazyJsonConverter} }; diff --git a/Rdmp.UI/ExtractionUIs/FilterUIs/ParameterUIs/ParameterCollectionUI.cs b/Rdmp.UI/ExtractionUIs/FilterUIs/ParameterUIs/ParameterCollectionUI.cs index ff052ec93c..1682123a1a 100644 --- a/Rdmp.UI/ExtractionUIs/FilterUIs/ParameterUIs/ParameterCollectionUI.cs +++ b/Rdmp.UI/ExtractionUIs/FilterUIs/ParameterUIs/ParameterCollectionUI.cs @@ -214,7 +214,9 @@ private void miAddParameter_Click(object sender, EventArgs e) { Random r = new Random(); +#pragma warning disable SCS0005 // Weak random generator: This is only used to create an initial value for a parameter. var dialog = new TypeTextOrCancelDialog("Parameter Name", "Name", 100, "@MyParam" + r.Next()); +#pragma warning restore SCS0005 // Weak random generator if (dialog.ShowDialog() == DialogResult.OK) { var newParameter = Options.CreateNewParameter(dialog.ResultText.Trim()); diff --git a/rakefile.rb b/rakefile.rb index c18678949d..7fcd43beae 100644 --- a/rakefile.rb +++ b/rakefile.rb @@ -5,7 +5,7 @@ load 'rakeconfig.rb' $MSBUILD15CMD = MSBUILD15CMD.gsub(/\\/,"/") -task :ci_low_warnings, [:config,:level] => [:assemblyinfo, :build_low_warning] +task :ci_low_warnings, [:config,:level,:aserrors] => [:assemblyinfo, :build_low_warning] task :ci_continuous, [:config] => [:setup_connection, :assemblyinfo, :build, :tests] @@ -43,9 +43,9 @@ sh "\"#{$MSBUILD15CMD}\" #{SOLUTION} \/t:Clean;Build \/p:Configuration=Release" end -task :build_low_warning, [:config,:level] => :restorepackages do |msb, args| +task :build_low_warning, [:config,:level,:aserrors] => :restorepackages do |msb, args| args.with_defaults(:level => 1) - sh "\"#{$MSBUILD15CMD}\" #{SOLUTION} \/t:Clean;Build \/p:Configuration=#{args.config} \/p:WarningLevel=#{args.level} \/p:TreatWarningsAsErrors=false" + sh "\"#{$MSBUILD15CMD}\" #{SOLUTION} \/t:Clean;Build \/p:Configuration=#{args.config} \/v:detailed \/p:WarningLevel=#{args.level} \/p:TreatWarningsAsErrors=#{args.aserrors}" end task :createtestdb, [:config] do |t, args|