Showing 32 of 82 total issues
Function link
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function (scope, element) {
scope.$watch('article', function (newValue) {
if (!newValue) {
return;
}
Function link
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function (scope, element, attrs, ngModel) {
ngModel.$render = function() {
if (ngModel.$viewValue) {
if (!carbon.Loader.load('embedProviders')) {
carbon.Loader.register('embedProviders', {
Method create
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def create
# Check
field = (resource_params.keys.map(&:to_sym) & resource_class.authentication_keys).first
@resource = nil
- 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 update
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update
# make sure user is authorized
unless @resource
return render json: {
success: false,
Function scrollToHelper_
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
element, x1, x2, prop, t, v, step, timeFunc) {
Function smoothScrollTo
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
container, from, to, prop, duration, timeFunc) {
Function createNewComment
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
var createNewComment = function(srcElement, scope, container, offsetTop, guidAttribute) {
Function update
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
update: function (params, data, optSuccess, optError, optConfig) {
Method update
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def update
# make sure user is authorized
unless @resource
return render json: {
success: false,
- 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 abs_url_for
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def abs_url_for *attributes
attributes.each do |attr_name|
define_method "#{attr_name}_abs_url" do |size = nil|
image = self.send(attr_name)
- 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
Avoid too many return
statements within this function. Open
return time + ' دقيقة للقراءة';
Method change
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def change
add_column :articles, :user_name, :string
add_column :articles, :topic_title, :string
add_column :articles, :category_color, :string
- 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"