< Summary

Line coverage
90%
Covered lines: 171
Uncovered lines: 19
Coverable lines: 190
Total lines: 327
Line coverage: 90%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
File 1: !XamlIlPopulate(...)100%22100%
File 1: Build_1(...)100%210%
File 2: .ctor()100%11100%

File(s)

/home/runner/work/LOCKnet/LOCKnet/src/LOCKnet.App/Views/CredentialDetailView.axaml

#LineLine coverage
 21<UserControl xmlns="https://github.com/avaloniaui"
 2             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 3             xmlns:vm="using:LOCKnet.App.ViewModels"
 4             xmlns:mi="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
 5             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
 6             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
 7             mc:Ignorable="d" d:DesignWidth="900" d:DesignHeight="600"
 8             x:Class="LOCKnet.App.Views.CredentialDetailView"
 9             x:DataType="vm:CredentialDetailViewModel"
 110             x:Name="ROOT"
 111             Background="{StaticResource BrushBg}">
 12
 13    <Design.DataContext>
 14        <vm:CredentialDetailViewModel/>
 15    </Design.DataContext>
 16
 217    <Grid RowDefinitions="*">
 318        <ScrollViewer Grid.Row="0"
 19                      HorizontalScrollBarVisibility="Disabled"
 120                      VerticalScrollBarVisibility="Auto">
 421            <Border Width="540"
 22                    HorizontalAlignment="Center"
 123                    Background="{StaticResource BrushSurface}"
 124                    CornerRadius="{StaticResource RadiusLg}"
 25                    Padding="44,40"
 126                    Margin="0,24">
 327                <StackPanel Spacing="20">
 28
 29                    <!-- Header -->
 330                    <TextBlock Text="{Binding WindowTitle}"
 31                               FontSize="22"
 132                               FontWeight="Bold"
 133                               Foreground="{StaticResource BrushTextPrimary}"/>
 34
 35                    <!-- Title -->
 36                    <!-- Credential Type Selector -->
 337                    <StackPanel Spacing="6">
 338                        <TextBlock Text="Typ"
 39                                   FontSize="12"
 140                                   Foreground="{StaticResource BrushTextSecondary}"/>
 341                        <StackPanel Orientation="Horizontal" Spacing="20">
 242                            <RadioButton Content="Passwort"
 143                                         GroupName="CredType"
 144                                         IsChecked="{Binding IsPasswordCredential, Mode=TwoWay}"/>
 245                            <RadioButton Content="API-Schlüssel"
 146                                         GroupName="CredType"
 147                                         IsChecked="{Binding IsApiKeyCredential, Mode=TwoWay}"/>
 248                            <RadioButton Content="Backup Codes"
 149                                         GroupName="CredType"
 150                                         IsChecked="{Binding IsBackupCodesCredential, Mode=TwoWay}"/>
 51                        </StackPanel>
 52                    </StackPanel>
 53
 354                    <StackPanel Spacing="6">
 355                        <TextBlock Text="Titel *"
 56                                   FontSize="12"
 157                                   Foreground="{StaticResource BrushTextSecondary}"/>
 258                        <TextBox Text="{Binding Title, Mode=TwoWay}"
 159                                 Watermark="z.B. GitHub, Google…"/>
 60                    </StackPanel>
 61
 62                    <!-- Username -->
 363                    <StackPanel Spacing="6">
 364                        <TextBlock Text="{Binding UsernameLabel}"
 65                                   FontSize="12"
 166                                   Foreground="{StaticResource BrushTextSecondary}"/>
 267                        <TextBox Text="{Binding Username, Mode=TwoWay}"
 168                                 Watermark="optional"/>
 69                    </StackPanel>
 70
 71                    <!-- Password / API Secret -->
 472                    <StackPanel Spacing="6" IsVisible="{Binding !IsBackupCodesCredential}">
 373                        <TextBlock Text="{Binding SecretFieldLabel}"
 74                                   FontSize="12"
 175                                   Foreground="{StaticResource BrushTextSecondary}"/>
 376                        <Grid ColumnDefinitions="*,Auto">
 77                            <!-- Masked (default) -->
 478                            <TextBox Grid.Column="0"
 179                                     Text="{Binding Password, Mode=TwoWay}"
 80                                     PasswordChar="●"
 181                                     Watermark="{Binding SecretFieldWatermark}"
 82                                     CornerRadius="8,0,0,8"
 183                                     IsVisible="{Binding !IsPasswordVisible}"/>
 84                            <!-- Unmasked -->
 385                            <TextBox Grid.Column="0"
 186                                     Text="{Binding Password, Mode=TwoWay}"
 187                                     Watermark="{Binding SecretFieldWatermark}"
 88                                     CornerRadius="8,0,0,8"
 189                                     IsVisible="{Binding IsPasswordVisible}"/>
 390                            <Button Grid.Column="1"
 191                                    Content="👁️"
 192                                    Command="{Binding TogglePasswordVisibilityCommand}"
 193                                    Background="{StaticResource BrushBorder}"
 194                                    Foreground="{StaticResource BrushTextPrimary}"
 95                                    CornerRadius="0,8,8,0"
 196                                    Padding="12,10"
 197                                    ToolTip.Tip="Passwort verstecken"
 198                                    IsVisible="{Binding IsPasswordVisible}"/>
 399                            <Button Grid.Column="1"
 1100                                    Content="🙈"
 1101                                    Command="{Binding TogglePasswordVisibilityCommand}"
 1102                                    Background="{StaticResource BrushBorder}"
 1103                                    Foreground="{StaticResource BrushTextPrimary}"
 104                                    CornerRadius="0,8,8,0"
 1105                                    Padding="12,10"
 1106                                    ToolTip.Tip="Passwort anzeigen"
 1107                                    IsVisible="{Binding !IsPasswordVisible}"/>
 108                        </Grid>
 109
 2110                        <Grid ColumnDefinitions="*,Auto"
 1111                              IsVisible="{Binding Password, Converter={x:Static StringConverters.IsNotNullOrEmpty}}">
 3112                            <Border Grid.Column="0"
 113                                    Margin="0,2,0,0">
 3114                                <StackPanel Spacing="4">
 3115                                    <Grid ColumnDefinitions="*,*,*,*,*"
 116                                          ColumnSpacing="4">
 5117                                        <Border Grid.Column="0" Height="4" CornerRadius="2" Background="{Binding Strengt
 5118                                        <Border Grid.Column="1" Height="4" CornerRadius="2" Background="{Binding Strengt
 5119                                        <Border Grid.Column="2" Height="4" CornerRadius="2" Background="{Binding Strengt
 5120                                        <Border Grid.Column="3" Height="4" CornerRadius="2" Background="{Binding Strengt
 5121                                        <Border Grid.Column="4" Height="4" CornerRadius="2" Background="{Binding Strengt
 122                                    </Grid>
 4123                                    <TextBlock Text="{Binding StrengthLabel}"
 124                                               FontSize="11"
 1125                                               Foreground="{Binding StrengthColor}"
 126                                               HorizontalAlignment="Right"/>
 127                                </StackPanel>
 128                            </Border>
 129                        </Grid>
 130
 3131                        <StackPanel IsVisible="{Binding IsPasswordCredential}">
 4132                        <Button Content="🎲 Generieren"
 133                                Classes="ghost"
 1134                                Command="{Binding ToggleGeneratorCommand}"
 135                                HorizontalAlignment="Left"
 1136                                Padding="10,6"/>
 137
 3138                        <Border Background="{StaticResource BrushInput}"
 1139                                CornerRadius="{StaticResource RadiusMd}"
 140                                Padding="16,12"
 1141                                IsVisible="{Binding ShowGenerator}">
 3142                            <StackPanel Spacing="12">
 3143                                <TextBlock Text="Passwort generieren"
 144                                           FontSize="13"
 1145                                           FontWeight="SemiBold"
 1146                                           Foreground="{StaticResource BrushTextPrimary}"/>
 147
 3148                                <StackPanel Spacing="4">
 3149                                    <Grid ColumnDefinitions="*,Auto">
 3150                                        <TextBlock Text="Laenge"
 151                                                   FontSize="12"
 1152                                                   Foreground="{StaticResource BrushTextSecondary}"/>
 3153                                        <TextBlock Grid.Column="1"
 1154                                                   Text="{Binding PasswordLength}"
 155                                                   FontSize="12"
 1156                                                   Foreground="{StaticResource BrushTextPrimary}"/>
 157                                    </Grid>
 4158                                    <Slider Minimum="8"
 159                                            Maximum="64"
 1160                                            Value="{Binding PasswordLength, Mode=TwoWay}"
 161                                            TickFrequency="1"
 1162                                            IsSnapToTickEnabled="True"/>
 163                                </StackPanel>
 164
 1165                                <WrapPanel>
 4166                                    <CheckBox Content="Grossbuchstaben" IsChecked="{Binding UseUppercase, Mode=TwoWay}" 
 4167                                    <CheckBox Content="Kleinbuchstaben" IsChecked="{Binding UseLowercase, Mode=TwoWay}" 
 4168                                    <CheckBox Content="Zahlen" IsChecked="{Binding UseDigits, Mode=TwoWay}" Margin="0,0,
 3169                                    <CheckBox Content="Sonderzeichen" IsChecked="{Binding UseSpecial, Mode=TwoWay}"/>
 170                                </WrapPanel>
 171
 4172                                <Button Content="Passwort generieren"
 173                                        Classes="primary"
 1174                                        Command="{Binding GeneratePasswordCommand}"
 175                                        HorizontalAlignment="Stretch"
 1176                                        HorizontalContentAlignment="Center"/>
 177                            </StackPanel>
 178                        </Border>
 179                        </StackPanel>
 180                    </StackPanel>
 181
 182                    <!-- Backup Codes -->
 4183                    <StackPanel Spacing="8" IsVisible="{Binding IsBackupCodesCredential}">
 3184                        <TextBlock Text="Backup-Codes *"
 185                                   FontSize="12"
 1186                                   Foreground="{StaticResource BrushTextSecondary}"/>
 4187                        <TextBox Text="{Binding BackupCodesInput, Mode=TwoWay}"
 1188                                 Watermark="Ein Code pro Zeile oder mit ; / , getrennt"
 189                                 AcceptsReturn="True"
 1190                                 Height="90"
 191                                 TextWrapping="Wrap"/>
 4192                        <Button Content="Codes importieren"
 193                                Classes="ghost"
 1194                                Command="{Binding ImportBackupCodesCommand}"
 195                                HorizontalAlignment="Left"
 1196                                Padding="10,6"/>
 197
 3198                        <StackPanel Orientation="Horizontal" Spacing="8">
 3199                            <Button Content="Aktive kopieren"
 200                                    Classes="ghost"
 1201                                    Command="{Binding CopyActiveBackupCodesCommand}"/>
 3202                            <Button Content="Alle kopieren"
 203                                    Classes="ghost"
 1204                                    Command="{Binding CopyAllBackupCodesCommand}"/>
 205                        </StackPanel>
 206
 3207                        <ItemsControl ItemsSource="{Binding BackupCodes}">
 208                            <ItemsControl.ItemTemplate>
 1209                                <DataTemplate>
 1210                                    <Grid ColumnDefinitions="Auto,*,Auto,Auto" ColumnSpacing="8" Margin="0,2">
 0211                                        <Button Grid.Column="0"
 0212                                                Content="✓"
 213                                                Classes="ghost"
 0214                                                Command="{Binding #ROOT.DataContext.ToggleBackupCodeUsedCommand}"
 0215                                                CommandParameter="{Binding}"
 216                                                Width="26"
 0217                                                Height="26"
 218                                                VerticalAlignment="Center"/>
 0219                                        <TextBlock Grid.Column="1"
 0220                                                   Text="{Binding Value}"
 221                                                   VerticalAlignment="Center"/>
 0222                                        <TextBlock Grid.Column="2"
 0223                                                   Text="verwendet"
 0224                                                   Foreground="{StaticResource BrushTextMuted}"
 225                                                   VerticalAlignment="Center"
 0226                                                   IsVisible="{Binding IsUsed}"/>
 0227                                        <StackPanel Grid.Column="3" Orientation="Horizontal" Spacing="6">
 0228                                            <Button Content="Kopieren"
 229                                                    Classes="ghost"
 0230                                                    Command="{Binding #ROOT.DataContext.CopyBackupCodeCommand}"
 0231                                                    CommandParameter="{Binding}"/>
 0232                                            <Button
 0233                                                Content="Entfernen"
 234                                                Classes="ghost"
 0235                                                Command="{Binding #ROOT.DataContext.RemoveBackupCodeCommand}"
 0236                                                CommandParameter="{Binding}"/>
 237                                        </StackPanel>
 238                                    </Grid>
 239                                </DataTemplate>
 240                            </ItemsControl.ItemTemplate>
 241                        </ItemsControl>
 242                    </StackPanel>
 243
 244                    <!-- URL -->
 3245                    <StackPanel Spacing="6">
 3246                        <TextBlock Text="URL"
 247                                   FontSize="12"
 1248                                   Foreground="{StaticResource BrushTextSecondary}"/>
 2249                        <TextBox Text="{Binding Url, Mode=TwoWay}"
 1250                                 Watermark="https://..."/>
 251                    </StackPanel>
 252
 3253                    <StackPanel Spacing="6">
 3254                        <TextBlock Text="Icon"
 255                                   FontSize="12"
 1256                                   Foreground="{StaticResource BrushTextSecondary}"/>
 5257                        <WrapPanel ItemHeight="36" ItemWidth="36" Orientation="Horizontal">
 11258                            <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey
 11259                            <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey
 11260                            <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey
 11261                            <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey
 11262                            <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey
 11263                            <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey
 11264                            <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey
 11265                            <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey
 11266                            <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey
 11267                            <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey
 11268                            <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey
 11269                            <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey
 11270                            <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey
 11271                            <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey
 11272                            <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey
 11273                            <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey
 11274                            <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey
 11275                            <Button Classes="ghost" Width="36" Height="36" Margin="0,0,8,8" Background="{Binding IconKey
 276                        </WrapPanel>
 277                    </StackPanel>
 278
 279                    <!-- Notes -->
 3280                    <StackPanel Spacing="6">
 3281                        <TextBlock Text="Notizen"
 282                                   FontSize="12"
 1283                                   Foreground="{StaticResource BrushTextSecondary}"/>
 4284                        <TextBox Text="{Binding Notes, Mode=TwoWay}"
 1285                                 Watermark="optional"
 286                                 AcceptsReturn="True"
 1287                                 Height="80"
 288                                 TextWrapping="Wrap"/>
 289                    </StackPanel>
 290
 291                    <!-- Error -->
 3292                    <TextBlock Text="{Binding ErrorMessage}"
 1293                               Foreground="{StaticResource BrushError}"
 294                               FontSize="12"
 1295                               TextWrapping="Wrap"
 1296                               IsVisible="{Binding ErrorMessage, Converter={x:Static StringConverters.IsNotNullOrEmpty}}
 297
 298                    <!-- Action Buttons -->
 3299                    <Grid ColumnDefinitions="*,Auto,Auto" Margin="0,8,0,0">
 4300                        <Button Grid.Column="1"
 1301                                Content="Abbrechen"
 302                                Classes="secondary"
 1303                                Command="{Binding CancelCommand}"
 304                                Margin="0,0,10,0"/>
 3305                        <Button Grid.Column="2"
 1306                                Content="Speichern"
 307                                Classes="primary"
 1308                                Command="{Binding SaveCommand}"/>
 309                    </Grid>
 310
 311                </StackPanel>
 312            </Border>
 313        </ScrollViewer>
 314    </Grid>
 315
 316</UserControl>

/home/runner/work/LOCKnet/LOCKnet/src/LOCKnet.App/Views/CredentialDetailView.axaml.cs

#LineLine coverage
 1using Avalonia.Controls;
 2
 3namespace LOCKnet.App.Views;
 4
 5public partial class CredentialDetailView : UserControl
 6{
 17  public CredentialDetailView()
 18  {
 19    InitializeComponent();
 110  }
 11}