Showing 488 of 488 total issues
Similar blocks of code found in 5 locations. Consider refactoring. Open
var buildNumber = new Label {
Text = String.Format("{0}: {1}", TR.Tr("build_label"), PlatformSpecific.GetBuildNumber()),
FontSize = FontSizeController.GetSize(NamedSize.Small, typeof(Label)),
HorizontalTextAlignment = TextAlignment.Start,
FontAttributes = FontAttributes.Bold,
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 103.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 5 locations. Consider refactoring. Open
var platform = new Label {
Text = String.Format("{0}: {1}", TR.Tr("platform_label"), PlatformSpecific.GetPlatform()),
FontSize = FontSizeController.GetSize(NamedSize.Small, typeof(Label)),
HorizontalTextAlignment = TextAlignment.Start,
FontAttributes = FontAttributes.Bold,
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 103.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
mainStackLayout.SizeChanged += (sender, e) => {
try
{
if (buttonsLayout != null)
{
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 103.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
mainStackLayout.SizeChanged += (sender, e) => {
try {
if (buttonsLayout != null) {
mainStackLayout.Children.Remove(buttonsLayout);
mainStackLayout.Children.Add(buttonsLayout);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 103.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Method ExecuteRestorePremiumCommand
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected void ExecuteRestorePremiumCommand()
{
if (restored)
{
Task.Run(async () =>
Method OnElementChanged
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected override void OnElementChanged(ElementChangedEventArgs<FloatingActionButton> e)
{
base.OnElementChanged(e);
if (Control == null)
Method EncryptStringAES
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static byte[] EncryptStringAES(string plainText, string password, int reEncryptionCount, string hash, out bool ok)
{
ok = false;
byte[] bytes;
Method GenerateTXT
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void GenerateTXT()
{
CleanCache();
// Get NSWItems
Method GenerateTXT
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void GenerateTXT()
{
CleanCache();
// Get NSWItems
Method GenerateCleverPassword
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static string GenerateCleverPassword(string passwordPattern)
{
Random rand = new Random(DateTime.Now.Millisecond);
var generatedPassword = "";
Method GetItemMenu
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
static Grid GetItemMenu()
{
var itemEditLayout = new Grid {
BackgroundColor = Theme.Current.AppHeaderBackground,
HorizontalOptions = LayoutOptions.FillAndExpand,
Method EnterPassword
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void EnterPassword()
{
// FIXME: create correct model view separation, change password should go to model!!!
var popup = new EntryPopup(TR.Tr("enter_new_password"), string.Empty, true);
popup.PopupClosed += (o, closedArgs) => {
Method ExecuteOpenMenuCommand
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected void ExecuteOpenMenuCommand(object item)
{
if (item != null) {
var itemMdl = (ItemModel)item;
if (itemMdl.IconID != premadeIconIdentifier) {
Method CreateLabel
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void CreateLabel()
{
var popup = new EntryPopup(TR.Tr("create_label"), null, false);
popup.PopupClosed += (o, closedArgs) => {
if (closedArgs.OkClicked) {
Method updateList
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
void updateList()
{
try {
var backupPath = PlatformSpecific.GetBackupPath();
var backupFiles = PlatformSpecific.GetFileNames(backupPath);
Method LanguageSelector
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void LanguageSelector()
{
var langs = Lang.availableLangs();
var strLangs = new List<string>();
var systemLang = "";
Method ExecuteTapGestureRecognizer
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
async Task ExecuteTapGestureRecognizer(View view)
{
var flowCell = view as IFlowViewCell;
if (flowCell != null)
{
Method ExecuteThemeSelectedCommand
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected void ExecuteThemeSelectedCommand(string selectedTheme)
{
string themeCode = null;
if (!string.IsNullOrEmpty(selectedTheme) && string.Compare(selectedTheme, TR.Cancel) != 0) {
Method fontAdd
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
static void fontAdd(string name, string typeface, bool beginning = false)
{
if (Device.RuntimePlatform == Device.Android) {
if (typeface != null) {
typeface = typeface + fontExtension + "#" + typeface;
Method GetCurrentCultureInfo
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public System.Globalization.CultureInfo GetCurrentCultureInfo()
{
var netLanguage = "en";
var prefLanguageOnly = "en";
if (NSLocale.PreferredLanguages.Length > 0)