Showing 15 of 15 total issues
Class ArgumentBuilder
has 37 methods (exceeds 20 allowed). Consider refactoring. Open
class ArgumentBuilder < BaseArgumentBuilder
def method_argument_name
name if has_input_value? && !helper_argument?
end
Class UserDefinedBuilder
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class UserDefinedBuilder < ObjectBuilder
def initialize(info)
@info = info
end
Class Value
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class Value
setup_instance_method! :init
METHOD_MAP = {
TYPE_INVALID => [:get_none, :set_none],
Class IObjectInfo
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class IObjectInfo < IRegisteredTypeInfo
def type_name
Lib.g_object_info_get_type_name self
end
Class CallbackArgumentBuilder
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class CallbackArgumentBuilder < BaseArgumentBuilder
def method_argument_name
@method_argument_name ||= name || new_variable
end
Class ObjectBuilder
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class ObjectBuilder < RegisteredTypeBuilder
include WithLayout
# Dummy builder for the ObjectBase class
class ObjectBaseBuilder
Method modul
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def modul
unless defined? @module
build_dependencies
instantiate_module
setup_lib_for_ffi unless lib_already_set_up
- 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 signal_connect
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.signal_connect(object, detailed_signal, data = nil, after = false, &block)
Method marshaller
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.marshaller(closure, return_value, param_values, _invocation_hint,
_marshal_data)
Method set_up_destroy_notifier_relations
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def set_up_destroy_notifier_relations
@base_argument_builders.each do |bldr|
if (idx = bldr.destroy_idx) >= 0
target = @base_argument_builders[idx]
if target.specialized_type_tag == :callback &&
- 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 conversion
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def conversion
case @type_info.flattened_tag
when :utf8, :filename
if @ownership_transfer == :everything
"GirFFI::AllocationHelper.free_after #{@argument}, &:to_utf8"
- 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 set_up_user_data_relations
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def set_up_user_data_relations
@base_argument_builders.each do |bldr|
if (idx = bldr.closure_idx) >= 0
target_bldr = @base_argument_builders[idx]
unless target_bldr.specialized_type_tag == :void
- 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 create_for
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.create_for path
stage = PhotoWall.new
stage.instance_eval do
@path = path
- 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
module GLib
# Overrides for GList, GLib's doubly linked list implementation.
class List
include ListMethods
- 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 29.
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
module GLib
# Overrides for GSList, GLib's singly-linked list implementation.
class SList
include ListMethods
- 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 29.
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