< Summary

Class:UserProfileWebInterfaceBridge
Assembly:UserProfile
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/UserProfile/UserProfileWebInterfaceBridge.cs
Covered lines:1
Uncovered lines:17
Coverable lines:18
Total lines:63
Line coverage:5.5% (1 of 18)
Covered branches:0
Total branches:0
Covered methods:1
Total methods:14
Method coverage:7.1% (1 of 14)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
SaveVerifiedName(...)0%2100%
SaveUnverifiedName(...)0%2100%
SaveDescription(...)0%2100%
SaveAdditionalInfo(...)0%2100%
RequestFullUserProfile(...)0%2100%
RequestOwnProfileUpdate()0%2100%
RequestFullUserProfileAsync(...)0%2100%
GetOwn()0%110100%
Get(...)0%6200%
GetByName(...)0%2100%
SignUp()0%2100%
SendSaveAvatar(...)0%2100%
SaveLinks(...)0%2100%
LogOut()0%2100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/UserProfile/UserProfileWebInterfaceBridge.cs

#LineLine coverage
 1using Cysharp.Threading.Tasks;
 2using DCL.Interface;
 3using DCL.UserProfiles;
 4using System;
 5using System.Collections.Generic;
 6using System.Linq;
 7using System.Threading;
 8using UnityEngine;
 9
 10public class UserProfileWebInterfaceBridge : IUserProfileBridge
 11{
 12    public UniTask<UserProfile> SaveVerifiedName(string name, CancellationToken cancellationToken) =>
 013        UserProfileController.i.SaveVerifiedName(name, cancellationToken);
 14
 15    public UniTask<UserProfile> SaveUnverifiedName(string name, CancellationToken cancellationToken) =>
 016        UserProfileController.i.SaveUnverifiedName(name, cancellationToken);
 17
 18    public UniTask<UserProfile> SaveDescription(string description, CancellationToken cancellationToken) =>
 019        UserProfileController.i.SaveDescription(description, cancellationToken);
 20
 21    public UniTask<UserProfile> SaveAdditionalInfo(AdditionalInfo additionalInfo,
 22        CancellationToken cancellationToken) =>
 023        UserProfileController.i.SaveAdditionalInfo(additionalInfo, cancellationToken);
 24
 025    public void RequestFullUserProfile(string userId) => WebInterface.SendRequestUserProfile(userId);
 26
 27    public void RequestOwnProfileUpdate() =>
 028        WebInterface.RequestOwnProfileUpdate();
 29
 30    public UniTask<UserProfile> RequestFullUserProfileAsync(string userId, CancellationToken cancellationToken) =>
 031        UserProfileController.i.RequestFullUserProfileAsync(userId, cancellationToken);
 32
 86033    public UserProfile GetOwn() => UserProfile.GetOwnUserProfile();
 34
 35    public UserProfile Get(string userId)
 36    {
 037        if (userId == null) return null;
 038        return UserProfileController.userProfilesCatalog.Get(userId);
 39    }
 40
 41    public UserProfile GetByName(string userName, bool caseSensitive)
 42    {
 043        return UserProfileController.userProfilesCatalog.GetValues()
 44                                    .FirstOrDefault(p =>
 45                                     {
 046                                         if (caseSensitive)
 047                                             return p.userName == userName;
 48
 049                                         return p.userName.Equals(userName, StringComparison.OrdinalIgnoreCase);
 50                                     });
 51    }
 52
 053    public void SignUp() => WebInterface.RedirectToSignUp();
 54
 55    public void SendSaveAvatar(AvatarModel avatar, Texture2D face256Snapshot, Texture2D bodySnapshot, bool isSignUpFlow 
 056        WebInterface.SendSaveAvatar(avatar, face256Snapshot, bodySnapshot, isSignUpFlow);
 57
 58    public UniTask<UserProfile> SaveLinks(List<UserProfileModel.Link> links, CancellationToken cancellationToken) =>
 059        UserProfileController.i.SaveLinks(links, cancellationToken);
 60
 61    public void LogOut() =>
 062        WebInterface.LogOut();
 63}