Showing 102 of 102 total issues
Class Device
has 49 methods (exceeds 20 allowed). Consider refactoring. Open
class Device < AbstractDevice
attr_accessor :usb_ssh_port, :mode, :tool_port, :ios_version
attr_reader :data_dir
def initialize(username, password, hostname, port)
Method initialize
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize *args
super *args
@icons = Qt::FileIconProvider.new
Method initialize
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize *args
super *args
@layout = Qt::GridLayout.new
setLayout(@layout)
Method menu
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
def menu
##########################################
# MENU
##########################################
Class App
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
class App
attr_accessor :uuid, :app_dir, :binary, :cache_dir, :services_map
attr_reader :data_dir
def initialize(uuid)
File device.rb
has 302 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative 'abstract_device'
require_relative 'ssh_port_forwarder'
require_relative 'device_ca_interface'
require_relative 'usb_muxd_wrapper'
require 'json'
Method initialize
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(username, password, hostname, port)
@username = username
@password = password
@hostname = hostname
@port = port
Method initialize
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize *args
super *args
@fuzz_config_layout = Qt::GridLayout.new
setLayout @fuzz_config_layout
Method initialize
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(*args)
super(*args)
@layout = Qt::GridLayout.new
setLayout(@layout)
setWindowTitle("CA Certificate Management")
File fs_viewer_tab_widget.rb
has 272 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative '../lib/rsync_git_manager'
module Idb
class FSViewerControlGroupBox < Qt::GroupBox
def initialize *args
Method initialize
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize *args
super *args
@pbs_to_watch = Hash.new
@pbs_to_watch["general"] = ""
Method menu
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def menu
##########################################
# MENU
##########################################
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File app.rb
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative 'plist_util'
require_relative 'app_binary'
require_relative 'CgBI'
require_relative 'ios8_last_launch_services_map_wrapper'
require_relative 'ios10_application_state_db_wrapper'
Method initialize
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def initialize *args
super *args
@layout = Qt::GridLayout.new
setLayout(@layout)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method setup_local_port_forward
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
def setup_local_port_forward
@local_forward_tab = Qt::Widget.new self
forward_config_layout = Qt::GridLayout.new
@local_forward_tab.setLayout forward_config_layout
addTab(@local_forward_tab,"Local")
Method setup_remote_port_forward
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
def setup_remote_port_forward
@remote_forward_tab = Qt::Widget.new self
forward_config_layout = Qt::GridLayout.new
@remote_forward_tab.setLayout forward_config_layout
addTab(@remote_forward_tab,"Remote")
Method initialize
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize *args
super *args
layout = Qt::VBoxLayout.new
setLayout(layout)
Similar blocks of code found in 2 locations. Consider refactoring. Open
def refresh
@list.clear
@list.setEnabled true
@default_protection.update
sqlite_dbs = $selected_app.find_sqlite_dbs
- 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 79.
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
def refresh
@list.clear
@list.setEnabled true
@default_protection.update
plist_files = $selected_app.find_plist_files
- 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 79.
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 initialize
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize *args
super *args
@model = Qt::StandardItemModel.new