Showing 16 of 70 total issues
File AccountController.cs
has 348 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using System.Web;
using System.Web.Mvc;
Method Update
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public void Update(UserCreateModel model)
{
var entity = UserManager.FindById(model.Id);
entity.UserName = model.Email;
Method SeedInstitution
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void SeedInstitution(ApplicationDbContext dbContext)
{
var collection = new List<Institution>
{
new Institution
Class AccountController
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
Open
[Authorize]
public class AccountController : BaseController
{
private ApplicationSignInManager _signInManager;
private ApplicationUserManager _userManager;
Method ManageFiles
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static ICollection<File> ManageFiles(UserCreateModel model)
{
var files = new List<File>();
var httpFileCollection = HttpContext.Current.Request.Files;
Function save
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
vm.save = function() {
vm.form.submitted = true;
if (vm.form.$valid) {
Method RegisterBundles
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/library").Include(
"~/node_modules/jquery/dist/jquery.js",
"~/node_modules/angular/angular.js",
Method Create
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static ApplicationUserManager Create(IdentityFactoryOptions<ApplicationUserManager> options, IOwinContext context)
{
var manager = new ApplicationUserManager(new UserStore<User>(context.Get<ApplicationDbContext>()));
// Configure validation logic for usernames
manager.UserValidator = new UserValidator<User>(manager)
Method ManageFiles
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private ICollection<File> ManageFiles(QuestionModel model)
{
var files = new List<File>();
const FileType fileType = FileType.Document;
var fileCollection = HttpContext.Current.Request.Files;
Method Upload
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static UploadConfig Upload(HttpPostedFile fileBase, FileType fileType)
{
//var fileName = $"{Guid.NewGuid()}.{Path.GetFileName(fileBase.FileName)}";
var fileName = String.Format("{0}{1}",Guid.NewGuid(),Path.GetFileName(fileBase.FileName));
Method SeedApplicationUser
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static User SeedApplicationUser(DbContext dbContext)
{
const string email = "admin-rms@bs-23.com";
const string password = "HakunaMatata-23";
Function edit
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
vm.edit = function () {
vm.form.submitted = true;
var model = {
id: vm.id,
Method ExecuteResult
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public override void ExecuteResult(ControllerContext context)
{
if (context == null)
{
throw new ArgumentNullException(nameof(context));
Function create
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
vm.create = function () {
vm.form.submitted = true;
var model = {
text: vm.text,
Function openQuestionModal
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
vm.openQuestionModal = function(pageIndex) {
var questionsInAllPages = [];
vm.pages.forEach(function(p) {
questionsInAllPages.push.apply(questionsInAllPages, p.quizQuestions);
Method Security
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public async Task<ActionResult> Security(ManageMessageId? message)
{
ViewBag.StatusMessage =
message == ManageMessageId.ChangePasswordSuccess
? "Your password has been changed."