< Summary

Line coverage
100%
Covered lines: 114
Uncovered lines: 0
Coverable lines: 114
Total lines: 187
Line coverage: 100%
Branch coverage
87%
Covered branches: 7
Total branches: 8
Branch coverage: 87.5%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
File 1: !XamlIlPopulate(...)75%44100%
File 2: Initialize()100%11100%
File 2: OnFrameworkInitializationCompleted()100%22100%
File 2: DisableAvaloniaDataAnnotationValidation()100%22100%

File(s)

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

#LineLine coverage
 81<Application xmlns="https://github.com/avaloniaui"
 2             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 3             x:Class="LOCKnet.App.App"
 4             xmlns:local="using:LOCKnet.App"
 5             xmlns:conv="using:LOCKnet.App.Converters"
 6             xmlns:materialIcons="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
 27             RequestedThemeVariant="Dark">
 8    <!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. -->
 9
 10    <Application.DataTemplates>
 211        <local:ViewLocator/>
 12    </Application.DataTemplates>
 13
 14    <Application.Resources>
 15        <!-- Color tokens -->
 616        <Color x:Key="ColorBg">#111111</Color>
 617        <Color x:Key="ColorSurface">#1A1A1A</Color>
 618        <Color x:Key="ColorSurfaceHover">#232323</Color>
 619        <Color x:Key="ColorSurfaceActive">#2C2C2C</Color>
 620        <Color x:Key="ColorInput">#181818</Color>
 621        <Color x:Key="ColorBorder">#333333</Color>
 22
 623        <Color x:Key="ColorAccent">#FF6B00</Color>
 624        <Color x:Key="ColorAccentHover">#FF8126</Color>
 25
 626        <Color x:Key="ColorTextPrimary">#F5F5F5</Color>
 627        <Color x:Key="ColorTextSecondary">#AAAAAA</Color>
 628        <Color x:Key="ColorTextMuted">#666666</Color>
 29
 630        <Color x:Key="ColorError">#FF3B30</Color>
 631        <Color x:Key="ColorSuccess">#30D158</Color>
 32
 33        <!-- SolidColorBrush tokens (derived from Color tokens) -->
 834        <SolidColorBrush x:Key="BrushBg" Color="{StaticResource ColorBg}"/>
 1035        <SolidColorBrush x:Key="BrushSurface" Color="{StaticResource ColorSurface}"/>
 1036        <SolidColorBrush x:Key="BrushSurfaceHover" Color="{StaticResource ColorSurfaceHover}"/>
 637        <SolidColorBrush x:Key="BrushSurfaceActive" Color="{StaticResource ColorSurfaceActive}"/>
 1038        <SolidColorBrush x:Key="BrushInput" Color="{StaticResource ColorInput}"/>
 1039        <SolidColorBrush x:Key="BrushBorder" Color="{StaticResource ColorBorder}"/>
 1040        <SolidColorBrush x:Key="BrushAccent" Color="{StaticResource ColorAccent}"/>
 1041        <SolidColorBrush x:Key="BrushTextPrimary" Color="{StaticResource ColorTextPrimary}"/>
 1042        <SolidColorBrush x:Key="BrushTextSecondary" Color="{StaticResource ColorTextSecondary}"/>
 843        <SolidColorBrush x:Key="BrushTextMuted" Color="{StaticResource ColorTextMuted}"/>
 1044        <SolidColorBrush x:Key="BrushError" Color="{StaticResource ColorError}"/>
 845        <SolidColorBrush x:Key="BrushSuccess" Color="{StaticResource ColorSuccess}"/>
 46
 47        <!-- CornerRadius tokens -->
 648        <CornerRadius x:Key="RadiusSm">4</CornerRadius>
 649        <CornerRadius x:Key="RadiusMd">8</CornerRadius>
 650        <CornerRadius x:Key="RadiusLg">12</CornerRadius>
 651        <CornerRadius x:Key="RadiusXl">16</CornerRadius>
 52
 753    <conv:IconSelectedBrushConverter x:Key="IconSelectedBrushConverter"/>
 754    <conv:StringToMaterialIconKindConverter x:Key="StringToMaterialIconKindConverter"/>
 755    <conv:CredentialTypeIsApiKeyConverter x:Key="CredentialTypeIsApiKeyConverter"/>
 756    <conv:CredentialTypeIsBackupCodesConverter x:Key="CredentialTypeIsBackupCodesConverter"/>
 57    </Application.Resources>
 58
 59    <Application.Styles>
 260        <FluentTheme />
 261        <materialIcons:MaterialIconStyles />
 62
 63        <!-- Button.primary -->
 264        <Style Selector="Button.primary">
 665            <Setter Property="Background" Value="{StaticResource BrushAccent}"/>
 666            <Setter Property="Foreground" Value="White"/>
 667            <Setter Property="FontWeight" Value="SemiBold"/>
 668            <Setter Property="CornerRadius" Value="{StaticResource RadiusMd}"/>
 669            <Setter Property="Padding" Value="0,12"/>
 70        </Style>
 271        <Style Selector="Button.primary:pointerover /template/ ContentPresenter">
 672            <Setter Property="Background" Value="{StaticResource ColorAccentHover}"/>
 673            <Setter Property="Foreground" Value="White"/>
 74        </Style>
 75
 76        <!-- Button.secondary -->
 277        <Style Selector="Button.secondary">
 678            <Setter Property="Background" Value="{StaticResource BrushSurface}"/>
 679            <Setter Property="Foreground" Value="{StaticResource BrushTextSecondary}"/>
 680            <Setter Property="CornerRadius" Value="{StaticResource RadiusMd}"/>
 681            <Setter Property="Padding" Value="0,12"/>
 82        </Style>
 283        <Style Selector="Button.secondary:pointerover /template/ ContentPresenter">
 684            <Setter Property="Background" Value="{StaticResource BrushSurfaceHover}"/>
 685            <Setter Property="Foreground" Value="{StaticResource BrushTextPrimary}"/>
 86        </Style>
 87
 88        <!-- Button.ghost -->
 289        <Style Selector="Button.ghost">
 690            <Setter Property="Background" Value="Transparent"/>
 691            <Setter Property="Foreground" Value="{StaticResource BrushTextSecondary}"/>
 692            <Setter Property="CornerRadius" Value="{StaticResource RadiusMd}"/>
 93        </Style>
 294        <Style Selector="Button.ghost:pointerover /template/ ContentPresenter">
 695            <Setter Property="Background" Value="{StaticResource BrushSurfaceHover}"/>
 696            <Setter Property="Foreground" Value="{StaticResource BrushTextPrimary}"/>
 97        </Style>
 98
 99        <!-- Button.danger -->
 2100        <Style Selector="Button.danger">
 6101            <Setter Property="Background" Value="Transparent"/>
 6102            <Setter Property="Foreground" Value="{StaticResource BrushError}"/>
 6103            <Setter Property="CornerRadius" Value="{StaticResource RadiusMd}"/>
 104        </Style>
 2105        <Style Selector="Button.danger:pointerover /template/ ContentPresenter">
 6106            <Setter Property="Background" Value="{StaticResource BrushSurfaceHover}"/>
 6107            <Setter Property="Foreground" Value="{StaticResource BrushError}"/>
 108        </Style>
 109
 110        <!-- TextBox global style -->
 2111        <Style Selector="TextBox">
 6112            <Setter Property="Background" Value="{StaticResource BrushInput}"/>
 6113            <Setter Property="BorderBrush" Value="{StaticResource BrushBorder}"/>
 6114            <Setter Property="Foreground" Value="{StaticResource BrushTextPrimary}"/>
 6115            <Setter Property="CornerRadius" Value="{StaticResource RadiusMd}"/>
 6116            <Setter Property="Padding" Value="12,10"/>
 6117            <Setter Property="CaretBrush" Value="{StaticResource BrushAccent}"/>
 118        </Style>
 2119        <Style Selector="TextBox:focus /template/ Border#PART_BorderElement">
 6120            <Setter Property="BorderBrush" Value="{StaticResource BrushAccent}"/>
 6121            <Setter Property="Background" Value="{StaticResource BrushInput}"/>
 122        </Style>
 2123        <Style Selector="TextBox:pointerover /template/ Border#PART_BorderElement">
 6124            <Setter Property="BorderBrush" Value="{StaticResource BrushAccent}"/>
 6125            <Setter Property="Background" Value="{StaticResource BrushInput}"/>
 126        </Style>
 127
 128        <!-- ListBoxItem global style -->
 2129        <Style Selector="ListBoxItem">
 6130            <Setter Property="Background" Value="Transparent"/>
 6131            <Setter Property="Padding" Value="0"/>
 6132            <Setter Property="Margin" Value="0,4"/>
 133        </Style>
 2134        <Style Selector="ListBoxItem:pointerover /template/ ContentPresenter">
 6135            <Setter Property="Background" Value="Transparent"/>
 136        </Style>
 2137        <Style Selector="ListBoxItem:selected /template/ ContentPresenter">
 6138            <Setter Property="Background" Value="Transparent"/>
 139        </Style>
 2140        <Style Selector="ListBoxItem:selected:focus /template/ ContentPresenter">
 6141            <Setter Property="Background" Value="Transparent"/>
 142        </Style>
 2143        <Style Selector="ListBoxItem:selected:pointerover /template/ ContentPresenter">
 6144            <Setter Property="Background" Value="Transparent"/>
 145        </Style>
 146
 147    </Application.Styles>
 148</Application>

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

#LineLine coverage
 1using Avalonia;
 2using Avalonia.Controls.ApplicationLifetimes;
 3using Avalonia.Data.Core.Plugins;
 4using Avalonia.Markup.Xaml;
 5using LOCKnet.App.ViewModels;
 6using LOCKnet.App.Views;
 7using System.Linq;
 8
 9namespace LOCKnet.App;
 10
 11public partial class App : Application
 12{
 13  public override void Initialize()
 214  {
 215    AvaloniaXamlLoader.Load(this);
 216  }
 17
 18  public override void OnFrameworkInitializationCompleted()
 219  {
 220    if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
 121    {
 122      DisableAvaloniaDataAnnotationValidation();
 123      desktop.MainWindow = new MainWindow
 124      {
 125        DataContext = new MainWindowViewModel(),
 126      };
 127    }
 28
 229    base.OnFrameworkInitializationCompleted();
 230  }
 31
 32  private void DisableAvaloniaDataAnnotationValidation()
 133  {
 134    var dataValidationPluginsToRemove =
 135      BindingPlugins.DataValidators.OfType<DataAnnotationsValidationPlugin>().ToArray();
 536    foreach (var plugin in dataValidationPluginsToRemove)
 137      BindingPlugins.DataValidators.Remove(plugin);
 138  }
 39}