Skip to content

Commit 25ee9ae

Browse files
committed
Fixed Issues based on CodeFactor
1 parent 4d6ef86 commit 25ee9ae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+80119
-14113
lines changed

src/LetsDisc.Application/MultiTenancy/Dto/CreateTenantDto.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ public class CreateTenantDto
2424
[StringLength(AbpTenantBase.MaxConnectionStringLength)]
2525
public string ConnectionString { get; set; }
2626

27-
public bool IsActive {get; set;}
27+
public bool IsActive { get; set; }
2828
}
2929
}

src/LetsDisc.Application/Posts/PostAppService.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ public override async Task<PostDto> Create(CreatePostDto input)
5757
CheckCreatePermission();
5858

5959
var post = ObjectMapper.Map<Post>(input);
60-
6160
var newPostId = await _postRepository.InsertAndGetIdAsync(post);
6261

6362
await insertTagData(input.Tags, newPostId);
@@ -218,8 +217,7 @@ public async Task<PagedResultDto<PostDto>> GetQuestions(PagedAndSortedResultRequ
218217
questions = _postRepository
219218
.GetAll()
220219
.Include(a => a.CreatorUser)
221-
.Where(a => a.PostTypeId == (int)PostTypes.Question);
222-
220+
.Where(a => a.PostTypeId == (int)PostTypes.Question);
223221
}
224222

225223
switch (input.Sorting)
@@ -380,7 +378,6 @@ public async Task<VoteChangeOutput> PostVoteDown(int id)
380378

381379
public async Task<PostWithVoteInfo> SubmitAnswer(SubmitAnswerInput input)
382380
{
383-
384381
var answer = await _postRepository.InsertAsync(
385382
new Post()
386383
{

src/LetsDisc.Web.Core/Controllers/TokenAuthController.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,6 @@ private string GetEncrpyedAccessToken(string accessToken)
274274
[HttpGet]
275275
public IActionResult SignInWithExternalProvider(string provider)
276276
{
277-
278277
var authenticationProperties = _signInManager.ConfigureExternalAuthenticationProperties(provider, Url.Action(nameof(ExternalLoginCallback), new { p = provider }));
279278
//await HttpContext.SignOutAsync(IdentityConstants.ExternalScheme);
280279
return Challenge(authenticationProperties, provider);
@@ -312,7 +311,6 @@ public async Task<ActionResult> ExternalLoginCallback(string p, string returnUrl
312311
if (userInDB == null)
313312
{
314313
userInDB = await RegisterForExternalLogin(claims);
315-
316314
}
317315

318316
var claimsIdentity = new ClaimsIdentity(claims, CookieAuthenticationDefaults.AuthenticationScheme);
@@ -383,7 +381,5 @@ public async Task<long> ConfirmEmail(long id, string code)
383381
return 0;
384382
}
385383
}
386-
387-
388384
}
389385
}

src/LetsDisc.Web.Host/App_Data/Logs/Logs.txt

Lines changed: 13323 additions & 13866 deletions
Large diffs are not rendered by default.

src/LetsDisc.Web.Host/App_Data/Logs/Logs.txt.1

Lines changed: 66516 additions & 0 deletions
Large diffs are not rendered by default.

src/LetsDisc.Web.Host/src/AppPreBootstrap.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,17 @@ export class AppPreBootstrap {
2727
}).done(result => {
2828
AppConsts.appBaseUrl = result.appBaseUrl;
2929
AppConsts.remoteServiceBaseUrl = result.remoteServiceBaseUrl;
30-
30+
3131
callback();
3232
});
3333
}
3434

3535
private static getCurrentClockProvider(currentProviderName: string): abp.timing.IClockProvider {
36-
if (currentProviderName === "unspecifiedClockProvider") {
36+
if (currentProviderName === 'unspecifiedClockProvider') {
3737
return abp.timing.unspecifiedClockProvider;
3838
}
3939

40-
if (currentProviderName === "utcClockProvider") {
40+
if (currentProviderName === 'utcClockProvider') {
4141
return abp.timing.utcClockProvider;
4242
}
4343

@@ -50,7 +50,7 @@ export class AppPreBootstrap {
5050
method: 'GET',
5151
headers: {
5252
Authorization: 'Bearer ' + abp.auth.getToken(),
53-
'AspNetCore.Culture': abp.utils.getCookieValue("Abp.Localization.CultureName"),
53+
'AspNetCore.Culture': abp.utils.getCookieValue('Abp.Localization.CultureName'),
5454
'Abp.TenantId': abp.multiTenancy.getTenantIdCookie()
5555
}
5656
}).done(result => {

src/LetsDisc.Web.Host/src/app/about/about.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ export class AboutComponent extends AppComponentBase {
1414
private titleService: Title
1515
) {
1616
super(injector);
17-
this.titleService.setTitle("About - LetsDisc");
17+
this.titleService.setTitle('About - LetsDisc');
1818
}
19-
}
19+
}

src/LetsDisc.Web.Host/src/app/account/account.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ export class AccountComponent extends AppComponentBase {
3636

3737
printError(errorData) {
3838
console.log(errorData);
39-
}
40-
}
39+
}
40+
}

src/LetsDisc.Web.Host/src/app/account/login.service.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11

22
import { Injectable } from '@angular/core';
33
import { Router } from '@angular/router';
4-
import { TokenAuthServiceProxy, AuthenticateModel, AuthenticateResultModel, ExternalLoginProviderInfoModel, ExternalAuthenticateModel, ExternalAuthenticateResultModel } from '@shared/service-proxies/service-proxies';
4+
import {
5+
TokenAuthServiceProxy,
6+
AuthenticateModel,
7+
AuthenticateResultModel,
8+
ExternalAuthenticateModel,
9+
ExternalAuthenticateResultModel
10+
} from '@shared/service-proxies/service-proxies';
511
import { UrlHelper } from '@shared/helpers/UrlHelper';
612
import { AppConsts } from '@shared/AppConsts';
713

@@ -68,7 +74,10 @@ export class LoginService {
6874
this.authenticateResult = authenticateResult;
6975

7076
if (authenticateResult.accessToken) {
71-
this.login(authenticateResult.accessToken, authenticateResult.encryptedAccessToken, authenticateResult.expireInSeconds, this.rememberMe);
77+
this.login(authenticateResult.accessToken,
78+
authenticateResult.encryptedAccessToken,
79+
authenticateResult.expireInSeconds,
80+
this.rememberMe);
7281

7382
} else {
7483
this._logService.warn('Unexpected authenticateResult!');
@@ -78,7 +87,7 @@ export class LoginService {
7887

7988
private login(accessToken: string, encryptedAccessToken: string, expireInSeconds: number, rememberMe?: boolean): void {
8089

81-
var tokenExpireDate = rememberMe ? (new Date(new Date().getTime() + 1000 * expireInSeconds)) : undefined;
90+
const tokenExpireDate = rememberMe ? (new Date(new Date().getTime() + 1000 * expireInSeconds)) : undefined;
8291

8392
this._tokenService.setToken(
8493
accessToken,
@@ -92,7 +101,7 @@ export class LoginService {
92101
abp.appPath
93102
);
94103

95-
var initialUrl = UrlHelper.initialUrl;
104+
let initialUrl = UrlHelper.initialUrl;
96105
if (initialUrl.indexOf('/login') > 0) {
97106
initialUrl = AppConsts.appBaseUrl;
98107
}
@@ -106,4 +115,4 @@ export class LoginService {
106115
this.authenticateResult = null;
107116
this.rememberMe = false;
108117
}
109-
}
118+
}

src/LetsDisc.Web.Host/src/app/app.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ export class AppComponent extends AppComponentBase implements OnInit, AfterViewI
1717
}
1818

1919
ngOnInit(): void {
20-
20+
2121
SignalRAspNetCoreHelper.initSignalR();
2222

2323
abp.event.on('abp.notifications.received', userNotification => {
2424
abp.notifications.showUiNotifyForUserNotification(userNotification);
2525

26-
//Desktop notification
27-
Push.create("AbpZeroTemplate", {
26+
// Desktop notification
27+
Push.create('AbpZeroTemplate', {
2828
body: userNotification.notification.data.message,
2929
icon: abp.appPath + 'assets/app-logo-small.png',
3030
timeout: 6000,
@@ -43,7 +43,7 @@ export class AppComponent extends AppComponentBase implements OnInit, AfterViewI
4343

4444
onResize(event) {
4545
// exported from $.AdminBSB.activateAll
46-
//$.AdminBSB.leftSideBar.setMenuHeight();
46+
// $.AdminBSB.leftSideBar.setMenuHeight();
4747
$.AdminBSB.leftSideBar.checkStatuForResize(false);
4848

4949
// exported from $.AdminBSB.activateDemo

0 commit comments

Comments
 (0)