File ToolStripMenuIMG.cs
has 879 lines of code (exceeds 250 allowed). Consider refactoring. Open
using System;
using System.Windows.Forms;
using System.Collections.Generic;
using Tools.Utilities;
using System.Drawing;
Class ToolStripMenuIMG
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
public class ToolStripMenuIMG : RibbonTab
{
#region Attributes
private Panel _currentTabPage;
private GUI _gui;
Method BuildToolsDrawing
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void BuildToolsDrawing()
{
_ts_draw_pencil = new RibbonButton();
_ts_draw_pencil.ToolTip = "Pencil";
_ts_draw_pencil.Click += new EventHandler(tsb_Click);
Method BuildToolsText
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void BuildToolsText()
{
_ts_font_label = new RibbonLabel();
_ts_font_label.Text = "Font";
Method BuildPanelDrawing
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void BuildPanelDrawing()
{
_ts_undo = new RibbonButton("Undo");
_ts_undo.ToolTip = "Undo";
_ts_undo.Click += new EventHandler(tsb_Click);
Method BuildPanelMain
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void BuildPanelMain()
{
_ts_main_open = new RibbonButton("Open");
_ts_main_open.ToolTip = "Open";
_ts_main_open.Click += new EventHandler(tsb_Click);
Method SwitchMode
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void SwitchMode()
{
_modeView.Image = Tools.Utilities.Resources.ResourceIconSet32Default.shape_square;
_modeView.SmallImage = Tools.Utilities.Resources.ResourceIconSet16Default.shape_square;
_modeEdition.Image = Tools.Utilities.Resources.ResourceIconSet32Default.shape_square;
Method BuildToolsSize
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void BuildToolsSize()
{
_ts_resize = new RibbonButton("Resize");
_ts_resize.Click += new EventHandler(tsb_Click);
_ts_resize.SmallImage = Tools.Utilities.Resources.ResourceIconSet16Default.layer_to_image_size;
Method BuildToolsReturn
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void BuildToolsReturn()
{
_ts_returnH = new RibbonButton("Return horizontal");
_ts_returnH.MinSizeMode = RibbonElementSizeMode.Compact;
_ts_returnH.Style = RibbonButtonStyle.Normal;
Method BuildPanelView
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void BuildPanelView()
{
_ts_tool_addImage = new RibbonButton("Insert image");
_ts_tool_addImage.Click += new EventHandler(tsb_Click);
_ts_tool_addImage.SmallImage = Tools.Utilities.Resources.ResourceIconSet16Default.insert_object;
Method BuildPanelNavigation
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void BuildPanelNavigation()
{
_ts_fullscreen = new RibbonButton("Full screen");
_ts_fullscreen.ToolTip = "Full screen";
_ts_fullscreen.Click += new EventHandler(tsb_Click);
Method BuildPanelMode
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void BuildPanelMode()
{
_modeView = new RibbonButton();
_modeView.Name = "View";
_modeView.Text = _modeView.Name;
Method BuildToolsAdjustment
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void BuildToolsAdjustment()
{
_ts_tool_contrast = new RibbonButton("Contraste");
_ts_tool_contrast.Click += new EventHandler(tsb_Click);
_ts_tool_contrast.SmallImage = Tools.Utilities.Resources.ResourceIconSet16Default.contrast;
Method BuildPanelParsing
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void BuildPanelParsing()
{
_ts_code_qr = new RibbonButton("QR code");
_ts_code_qr.Click += new EventHandler(tsb_Click);
_ts_code_qr.Image = Tools.Utilities.Resources.ResourceIconSet32Default.qrcode;
Method tsb_Click
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void tsb_Click(object sender, EventArgs e)
{
try
{
if (sender.GetType().Name.Equals("RibbonButton"))
Similar blocks of code found in 2 locations. Consider refactoring. Open
public void EnableAll()
{
_panelMain.Enabled = true;
_panelView.Enabled = true;
//_panelNavigation.Enabled = true;
- 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 141.
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
public void DisableAll()
{
_panelMain.Enabled = false;
_panelView.Enabled = false;
//_panelNavigation.Enabled = false;
- 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 141.
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
case Mode.EDITION:
_panelDrawing.Visible = true;
_panelNavigation.Visible = false;
_panelParsing.Visible = false;
_panelText.Visible = true;
- 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 87.
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
case Mode.ANALYSE:
_panelDrawing.Visible = false;
_panelNavigation.Visible = false;
_panelParsing.Visible = true;
_panelText.Visible = false;
- 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 87.
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
private void _valueLookingFor_TextBoxTextChanged(object sender, EventArgs e)
{
try
{
ToolBarEventArgs action = new ToolBarEventArgs("textchanged_" + _valueLookingFor.TextBoxText);
- 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 76.
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