Showing 511 of 511 total issues
Cyclomatic complexity for gettext is too high. [7/6] Open
def gettext(document_photo)
client = Aws::Rekognition::Client.new({
region: Rails.application.credentials.dig(:aws, :region),
credentials: Aws::Credentials.new(
Rails.application.credentials.dig(:aws, :access_key_id),
- Read upRead up
- Exclude checks
This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.
An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.
Assignment Branch Condition size for execute is too high. [16.28/15] Open
def execute
variables = ensure_hash(params[:variables])
query = params[:query]
operation_name = params[:operationName]
context = {
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for change is too high. [16/15] Open
def change
create_table :active_storage_blobs do |t|
t.string :key, null: false
t.string :filename, null: false
t.string :content_type
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Function render
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { Line } = Progress;
return (
<Fragment>
Assignment Branch Condition size for perform is too high. [15.52/15] Open
def perform(contract_id)
@client = Aws::Rekognition::Client.new({
region: Rails.application.credentials.dig(:aws, :region),
credentials: Aws::Credentials.new(
Rails.application.credentials.dig(:aws, :access_key_id),
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Function renderActions
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderActions() {
if (this.state.successfullUploaded) {
return (
<Button
style={{
Function render
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let { location } = this.props;
let isModal = !!(
location.state &&
Function SigningSteps
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function SigningSteps(history) {
let url = history.history.location.pathname;
let current = 0;
switch (url) {
Function HowItWorks
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function HowItWorks() {
return (
<Section id="como-funciona">
<FlexboxGrid justify="space-around">
<FlexboxGrid.Item colspan={15}>
Method gettext
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def gettext(document_photo)
client = Aws::Rekognition::Client.new({
region: Rails.application.credentials.dig(:aws, :region),
credentials: Aws::Credentials.new(
Rails.application.credentials.dig(:aws, :access_key_id),
Function LandingPage
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const LandingPage = () => {
const [loginModal, setLoginModal] = useState(false);
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
return (
Function render
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<div>
<div className="show-fake-browser navbar-page">
<Container>
Method gettext
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def gettext(document_photo)
client = Aws::Rekognition::Client.new({
region: Rails.application.credentials.dig(:aws, :region),
credentials: Aws::Credentials.new(
Rails.application.credentials.dig(:aws, :access_key_id),
- 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
Function sendRequest
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
sendRequest(file) {
return new Promise((resolve, reject) => {
const req = new XMLHttpRequest();
req.upload.addEventListener("progress", event => {
Function registerValidSW
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function registerValidSW(swUrl, config) {
navigator.serviceWorker
.register(swUrl)
.then(registration => {
registration.onupdatefound = () => {
Function componentDidMount
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
componentDidMount() {
// instantiate Video.js
this.player = videojs(this.videoNode, videoJsOptions, () => {
// print version information at startup
Function Pricing
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function Pricing() {
return (
<PricingSection id="precos">
<FlexboxGrid justify="center">
<FlexboxGrid.Item colspan={15}>
Function handleUploadImages
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function* handleUploadImages() {
const { images } = yield select(state => state.record);
const selectedImages = shuffle(images).slice(0, 3);
Function upload
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function upload(state = initial, action) {
switch (action.type) {
case SET_VIDEO_UPLOAD_STATUS:
return {
...state,
Function Navbar
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function Navbar() {
return (
<header>
<nav className="navbar navbar-expand-lg navbar-dark bg-info py-4">
<div className="container">