Skip to content

Commit

Permalink
analizators/U2U1000
Browse files Browse the repository at this point in the history
  • Loading branch information
SuhorukovAnton committed Jan 20, 2022
1 parent 2f4d05a commit 5f78b37
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public string GetVersion()

public int GetNewMessagesCount()
{
var result = 0;
const int result = 0;
if (IsServiceProbablyNotAvailable()) return result;

using (var service = GetService())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public override SendResponse ProcessMessage(INoticeMessage message)
{
try
{
var result = SendResult.OK;
const SendResult result = SendResult.OK;
var m = new NotifyMessage
{
To = message.Recipient.ID,
Expand Down
2 changes: 1 addition & 1 deletion common/ASC.Data.Storage/GoogleCloud/GoogleCloudStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ public override string InitiateChunkedUpload(string domain, string path)
request.Content = new StreamContent(stream);


long MAX_RETRIES = 100;
const int MAX_RETRIES = 100;
int millisecondsTimeout;

for (var i = 0; i < MAX_RETRIES; i++)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ public override string InitiateChunkedUpload(string domain, string path)

public override string UploadChunk(string domain, string path, string filePath, Stream stream, long defaultChunkSize, int chunkNumber, long chunkLength)
{
var BufferSize = 4096;
const int BufferSize = 4096;

var mode = chunkNumber == 0 ? FileMode.Create : FileMode.Append;

Expand Down
2 changes: 1 addition & 1 deletion common/ASC.Data.Storage/StaticUploader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ public UploadOperationProgress(IServiceProvider serviceProvider, string key, int
this.relativePath = relativePath;
this.mappedPath = mappedPath;

var extensions = ".png|.jpeg|.jpg|.gif|.ico|.swf|.mp3|.ogg|.eot|.svg|.ttf|.woff|.woff2|.css|.less|.js";
const string extensions = ".png|.jpeg|.jpg|.gif|.ico|.swf|.mp3|.ogg|.eot|.svg|.ttf|.woff|.woff2|.css|.less|.js";
var extensionsArray = extensions.Split('|');

directoryFiles = Directory.GetFiles(mappedPath, "*", SearchOption.AllDirectories)
Expand Down
2 changes: 1 addition & 1 deletion products/ASC.Files/Core/Helpers/EasyBibHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public object GetEasyBibCitation(string data)
jsonBlogInfo.Add("key", easyBibappkey);
var citationData = jsonBlogInfo.ToString();

var uri = "https://api.citation-api.com/2.0/rest/cite";
const string uri = "https://api.citation-api.com/2.0/rest/cite";
const string contentType = "application/json";
const string method = "POST";
var body = citationData;
Expand Down
2 changes: 1 addition & 1 deletion products/ASC.Files/Core/HttpHandlers/FileHandler.ashx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,7 @@ private Task CreateFile(HttpContext context)
//var refererURL = context.Request.GetUrlRewriter().AbsoluteUri;

//context.Session["refererURL"] = refererURL;
var authUrl = "~/Auth.aspx";
const string authUrl = "~/Auth.aspx";
context.Response.Redirect(authUrl, true);
return Task.CompletedTask;
}
Expand Down
4 changes: 2 additions & 2 deletions products/ASC.Files/Core/Utils/EntryManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ public IEnumerable<FileEntry> GetEntries<T>(Folder<T> parent, int from, int coun
//var apiServer = new ASC.Api.ApiServer();
//var apiUrl = string.Format("{0}project/maxlastmodified.json", SetupInfo.WebApiBaseUrl);

string responseBody = null;// apiServer.GetApiResponse(apiUrl, "GET");
const string responseBody = null;// apiServer.GetApiResponse(apiUrl, "GET");
if (responseBody != null)
{
var responseApi = JObject.Parse(Encoding.UTF8.GetString(Convert.FromBase64String(responseBody)));
Expand All @@ -367,7 +367,7 @@ public IEnumerable<FileEntry> GetEntries<T>(Folder<T> parent, int from, int coun
if (!(responseData is JArray)) return entries.ToList();

folderIDProjectTitle = new Dictionary<int, KeyValuePair<int, string>>();
foreach (JObject projectInfo in responseData.Children())
foreach (JObject projectInfo in responseData.Children().OfType<JObject>())
{
var projectID = projectInfo["id"].Value<int>();
var projectTitle = Global.ReplaceInvalidCharsAndTruncate(projectInfo["title"].Value<string>());
Expand Down
4 changes: 2 additions & 2 deletions products/ASC.Files/Core/Utils/MailMergeTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ private void CreateDraftMail(MailMergeTask mailMergeTask)
HttpUtility.UrlEncode(mailMergeTask.To),
HttpUtility.UrlEncode(mailMergeTask.Message));

string responseCreateString = null; //TODO: Encoding.UTF8.GetString(Convert.FromBase64String(Api.GetApiResponse(apiUrlCreate, "PUT", bodyCreate)));
const string responseCreateString = null; //TODO: Encoding.UTF8.GetString(Convert.FromBase64String(Api.GetApiResponse(apiUrlCreate, "PUT", bodyCreate)));
var responseCreate = JObject.Parse(responseCreateString);

if (responseCreate["statusCode"].Value<int>() != (int)HttpStatusCode.OK)
Expand Down Expand Up @@ -185,7 +185,7 @@ private string SendMail(MailMergeTask mailMergeTask, string bodySendAttach)

bodySend += bodySendAttach;

string responseSendString = null;//TODO: Encoding.UTF8.GetString(Convert.FromBase64String(Api.GetApiResponse(apiUrlSend, "PUT", bodySend)));
const string responseSendString = null;//TODO: Encoding.UTF8.GetString(Convert.FromBase64String(Api.GetApiResponse(apiUrlSend, "PUT", bodySend)));
var responseSend = JObject.Parse(responseSendString);

if (responseSend["statusCode"].Value<int>() != (int)HttpStatusCode.OK)
Expand Down
2 changes: 1 addition & 1 deletion web/ASC.Web.Api/Controllers/SettingsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1942,7 +1942,7 @@ public bool ActivateTrial()

TenantManager.SaveTenantQuota(quota);

var DEFAULT_TRIAL_PERIOD = 30;
const int DEFAULT_TRIAL_PERIOD = 30;

var tariff = new Tariff
{
Expand Down
8 changes: 4 additions & 4 deletions web/ASC.Web.Core/Notify/TagValues.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ public static ITagValue BlueButton(Func<string> btnTextFunc, string btnUrl)
string action()
{
var btnText = btnTextFunc != null ? btnTextFunc() ?? string.Empty : string.Empty;
var td = "<td style=\"height: 48px; width: 80px; margin:0; padding:0;\">&nbsp;</td>";
var color = "color: #fff; font-family: Helvetica, Arial, Tahoma; font-size: 18px; font-weight: 600; vertical-align: middle; display: block; padding: 12px 0; text-align: center; text-decoration: none; background-color: #66b76d;";
const string td = "<td style=\"height: 48px; width: 80px; margin:0; padding:0;\">&nbsp;</td>";
const string color = "color: #fff; font-family: Helvetica, Arial, Tahoma; font-size: 18px; font-weight: 600; vertical-align: middle; display: block; padding: 12px 0; text-align: center; text-decoration: none; background-color: #66b76d;";

return $@"<table style=""height: 48px; width: 540px; border-collapse: collapse; empty-cells: show; vertical-align: middle; text-align: center; margin: 30px auto; padding: 0;""><tbody><tr cellpadding=""0"" cellspacing=""0"" border=""0"">{td}<td style=""height: 48px; width: 380px; margin:0; padding:0; background-color: #66b76d; -moz-border-radius: 2px; -webkit-border-radius: 2px; border-radius: 2px;""><a style=""{color}"" target=""_blank"" href=""{btnUrl}"">{btnText}</a></td>{td}</tr></tbody></table>";
}
Expand All @@ -67,8 +67,8 @@ public static ITagValue GreenButton(Func<string> btnTextFunc, string btnUrl)
string action()
{
var btnText = btnTextFunc != null ? btnTextFunc() ?? string.Empty : string.Empty;
var td = "<td style=\"height: 48px; width: 80px; margin:0; padding:0;\">&nbsp;</td>";
var color = "color: #fff; font-family: Helvetica, Arial, Tahoma; font-size: 18px; font-weight: 600; vertical-align: middle; display: block; padding: 12px 0; text-align: center; text-decoration: none; background-color: #66b76d;";
const string td = "<td style=\"height: 48px; width: 80px; margin:0; padding:0;\">&nbsp;</td>";
const string color = "color: #fff; font-family: Helvetica, Arial, Tahoma; font-size: 18px; font-weight: 600; vertical-align: middle; display: block; padding: 12px 0; text-align: center; text-decoration: none; background-color: #66b76d;";

return $@"<table style=""height: 48px; width: 540px; border-collapse: collapse; empty-cells: show; vertical-align: middle; text-align: center; margin: 30px auto; padding: 0;""><tbody><tr cellpadding=""0"" cellspacing=""0"" border=""0"">{td}<td style=""height: 48px; width: 380px; margin:0; padding:0; background-color: #66b76d; -moz-border-radius: 2px; -webkit-border-radius: 2px; border-radius: 2px;""><a style=""{3}"" target=""_blank"" href=""{btnUrl}"">{btnText}</a></td>{td}</tr></tbody></table>";
}
Expand Down

0 comments on commit 5f78b37

Please sign in to comment.